Skip to content

Commit

Permalink
improve chart config
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <[email protected]>
  • Loading branch information
fjogeleit committed Sep 2, 2024
1 parent 6a7c3a2 commit 35bce00
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 33 deletions.
2 changes: 1 addition & 1 deletion charts/policy-reporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |
It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord
type: application
version: 3.0.0-beta.7
version: 3.0.0-beta.8
appVersion: 3.0.0-beta

icon: https://github.com/kyverno/kyverno/raw/main/img/logo.png
Expand Down
14 changes: 5 additions & 9 deletions charts/policy-reporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Policy Reporter watches for PolicyReport Resources.
It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord

![Version: 3.0.0-beta.7](https://img.shields.io/badge/Version-3.0.0--beta.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0-beta](https://img.shields.io/badge/AppVersion-3.0.0--beta-informational?style=flat-square)
![Version: 3.0.0-beta.8](https://img.shields.io/badge/Version-3.0.0--beta.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0-beta](https://img.shields.io/badge/AppVersion-3.0.0--beta-informational?style=flat-square)

## Documentation

Expand Down Expand Up @@ -56,7 +56,7 @@ Check the [Documentation](https://kyverno.github.io/policy-reporter/guide/02-get
| image.registry | string | `"ghcr.io"` | |
| image.repository | string | `"kyverno/policy-reporter"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.tag | string | `"246288e"` | |
| image.tag | string | `"6a7c3a2"` | |
| imagePullSecrets | list | `[]` | |
| priorityClassName | string | `""` | |
| replicaCount | int | `1` | |
Expand Down Expand Up @@ -350,7 +350,7 @@ Check the [Documentation](https://kyverno.github.io/policy-reporter/guide/02-get
| ui.image.registry | string | `"ghcr.io"` | Image registry |
| ui.image.repository | string | `"kyverno/policy-reporter-ui"` | Image repository |
| ui.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy |
| ui.image.tag | string | `"2.0.0-beta.8"` | Image tag Defaults to `Chart.AppVersion` if omitted |
| ui.image.tag | string | `"2.0.0-beta.9"` | Image tag Defaults to `Chart.AppVersion` if omitted |
| ui.replicaCount | int | `1` | Deployment replica count |
| ui.tempDir | string | `"/tmp"` | Temporary Directory to persist session data for authentication |
| ui.logging.encoding | string | `"console"` | log encoding possible encodings are console and json |
Expand All @@ -374,12 +374,8 @@ Check the [Documentation](https://kyverno.github.io/policy-reporter/guide/02-get
| ui.oauth.secretRef | string | `""` | Provide OpenID Connect configuration via Secret supported keys: `provider`, `clientId`, `clientSecret` |
| ui.displayMode | string | `""` | DisplayMode dark/light uses the OS configured prefered color scheme as default |
| ui.customBoards | list | `[]` | Additional customizable dashboards |
| ui.sources | list | `[{"chartType":"result","exceptions":false,"excludes":{"results":["warn","error"]},"name":"kyverno"}]` | source specific configurations |
| ui.sources[0] | object | `{"chartType":"result","exceptions":false,"excludes":{"results":["warn","error"]},"name":"kyverno"}` | kyverno specific UI confiurations |
| ui.sources[0].chartType | string | `"result"` | show results per category, other option: severity |
| ui.sources[0].exceptions | bool | `false` | enabled action button to generate PolicyExceptions from the UI |
| ui.sources[0].excludes | object | `{"results":["warn","error"]}` | exclude results or (cluster)kinds per source |
| ui.clusters | list | `[{"name":"Default","secretRef":"policy-report-ui-default-cluster"}]` | Connected Policy Reporter APIs |
| ui.sources | list | `[]` | source specific configurations |
| ui.clusters | list | `[]` | Connected Policy Reporter APIs |
| ui.imagePullSecrets | list | `[]` | Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| ui.serviceAccount.create | bool | `true` | Create ServiceAccount |
| ui.serviceAccount.automount | bool | `true` | Enable ServiceAccount automaount |
Expand Down
37 changes: 32 additions & 5 deletions charts/policy-reporter/configs/ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,46 @@ server:
ui:
displayMode: {{ .Values.ui.displayMode }}

{{- with .Values.ui.clusters }}
{{- $default := false -}}
{{- range .Values.ui.clusters }}
{{- if eq .name "Default" -}}
{{- $default = true -}}
{{- end -}}
{{- end }}

clusters:
{{- toYaml . | nindent 4 }}
{{- if not $default }}
- name: Default
secretRef: {{ include "ui.fullname" . }}-default-cluster
{{- end }}
{{- with .Values.ui.clusters }}
{{- toYaml . | nindent 2 }}
{{- end }}

{{- with .Values.ui.customBoards }}
customBoards:
{{- toYaml . | nindent 4 }}
{{- toYaml . | nindent 2 }}
{{- end }}

{{- $kyverno := false -}}
{{- range .Values.ui.sources }}
{{- if eq .name "kyverno" -}}
{{- $kyverno = true -}}
{{- end -}}
{{- end }}

{{- with .Values.ui.sources }}
sources:
{{- toYaml . | nindent 4 }}
{{- if not $kyverno }}
- name: kyverno
chartType: result
exceptions: false
excludes:
results:
- warn
- error
{{- end }}
{{- with .Values.ui.sources }}
{{- toYaml . | nindent 2 }}
{{- end }}

{{- with .Values.ui.openIDConnect }}
Expand Down
2 changes: 1 addition & 1 deletion charts/policy-reporter/templates/cluster-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ index .Values.ui.clusters 0 "secretRef" }}
name: {{ include "ui.fullname" . }}-default-cluster
namespace: {{ include "policyreporter.namespace" . }}
{{- if .Values.annotations }}
annotations:
Expand Down
32 changes: 15 additions & 17 deletions charts/policy-reporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image:
registry: ghcr.io
repository: kyverno/policy-reporter
pullPolicy: IfNotPresent
tag: 246288e
tag: 6a7c3a2

imagePullSecrets: []

Expand Down Expand Up @@ -757,7 +757,7 @@ ui:
pullPolicy: IfNotPresent
# -- (string) Image tag
# Defaults to `Chart.AppVersion` if omitted
tag: "2.0.0-beta.8"
tag: "2.0.0-beta.9"

# -- Deployment replica count
replicaCount: 1
Expand Down Expand Up @@ -837,23 +837,21 @@ ui:
# enabled: false

# -- source specific configurations
sources:
# -- kyverno specific UI confiurations
- name: kyverno
# -- show results per category, other option: severity
chartType: result
# -- enabled action button to generate PolicyExceptions from the UI
exceptions: false
# -- exclude results or (cluster)kinds per source
excludes:
results:
- warn
- error
sources: []
# -- kyverno specific UI confiurations
# - name: kyverno
# -- show results per category, other option: severity
# chartType: result
# -- enabled action button to generate PolicyExceptions from the UI
# exceptions: false
# -- exclude results or (cluster)kinds per source
# excludes:
# results:
# - warn
# - error

# -- Connected Policy Reporter APIs
clusters:
- name: Default
secretRef: policy-report-ui-default-cluster
clusters: []
# - name: default
# host: http://policy-reporter:8080
# secretRef: ""
Expand Down

0 comments on commit 35bce00

Please sign in to comment.