Skip to content

Commit

Permalink
Added support of sidecars (for oauth2-proxy in example) and extraMani…
Browse files Browse the repository at this point in the history
…fests
  • Loading branch information
Milogo Boris (Agyla) committed May 15, 2024
1 parent a1b4f60 commit 4a907bf
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/policy-reporter/charts/ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: ui
description: Policy Reporter UI

type: application
version: 2.10.5
version: 2.11.0
appVersion: 1.9.2
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"

0 comments on commit 4a907bf

Please sign in to comment.