Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support of sidecars and extraManifests #439

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions charts/policy-reporter/charts/ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ spec:
{{- with .Values.envVars }}
{{- . | toYaml | trim | nindent 10 }}
{{- end }}
{{- if .Values.sidecarContainers }}
{{- range $name, $spec := .Values.sidecarContainers }}
- name: {{ $name }}
{{- if kindIs "string" $spec }}
{{- tpl $spec $ | nindent 10 }}
{{- else }}
{{- toYaml $spec | nindent 10 }}
{{- end }}
{{- end }}
{{- end }}
volumes:
- name: config-file
configMap:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ range .Values.extraManifests }}
---
{{ tpl . $ }}
{{ end }}
2 changes: 1 addition & 1 deletion charts/policy-reporter/charts/ui/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ui.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- $svcPort := .Values.ingress.port | default .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down
3 changes: 3 additions & 0 deletions charts/policy-reporter/charts/ui/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if .Values.service.additionalPorts }}
{{ toYaml .Values.service.additionalPorts | indent 4 }}
{{- end }}
selector:
{{- include "ui.selectorLabels" . | nindent 4 }}
{{- end }}
38 changes: 37 additions & 1 deletion charts/policy-reporter/charts/ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ image:
pullPolicy: IfNotPresent
tag: 1.9.2

# sidecarContainers - add more containers to Kyverno ui
# Key/Value where Key is the sidecar `- name: <Key>`
# Example:
# for adding OAuth authentication to Kyverno ui
# sidecarContainers:
# oauth-proxy:
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.6.0
# args:
# - --upstream=http://127.0.0.1:8080
# - --http-address=0.0.0.0:8081
# - ...
# ports:
# - containerPort: 8081
# name: oauth-proxy
# protocol: TCP
# resources: {}
sidecarContainers: {}

# possible default displayModes: light/dark
displayMode: ""

Expand Down Expand Up @@ -172,6 +190,11 @@ service:
type: ClusterIP
# integer nubmer. This is port for service
port: 8080
# additionalPorts:
# - name: authenticated
# port: 8081
# targetPort: 8081
additionalPorts: []

# enabled if replicaCount > 1
podDisruptionBudget:
Expand All @@ -193,13 +216,15 @@ ingress:
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
## Redirect ingress to an additional defined port on the service
# port: 8081
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
# - chart-example.local

# Node labels for pod assignment
# ref: https://kubernetes.io/docs/user-guide/node-selection/
Expand Down Expand Up @@ -241,3 +266,14 @@ global:
password: ""
# read credentials from secret
secretRef: ""

# Extra manifests to deploy as an array
extraManifests: []
# - |
# apiVersion: v1
# kind: ConfigMap
# metadata:
# labels:
# name: kyverno-extra
# data:
# extra-data: "value"
Loading