Skip to content

Commit 1ed5edd

Browse files
committed
update UI chart
Signed-off-by: Frank Jogeleit <[email protected]>
1 parent 7f97df3 commit 1ed5edd

File tree

13 files changed

+82
-119
lines changed

13 files changed

+82
-119
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ TIMESTAMP := $(shell date '+%Y-%m-%d_%I:%M:%S%p')
1818
GOOS ?= $(shell go env GOOS)
1919
GOARCH ?= $(shell go env GOARCH)
2020
REGISTRY ?= ghcr.io
21-
REPO ?= kyverno
21+
OWNER ?= kyverno
2222
IMAGE ?= policy-reporter
2323
LD_FLAGS := -s -w -linkmode external -extldflags "-static"
2424
LOCAL_PLATFORM := linux/$(GOARCH)
2525
PLATFORMS := linux/arm64,linux/amd64,linux/s390x
26-
REPO := $(REGISTRY)/$(REPO)/$(IMAGE)
26+
REPO := $(REGISTRY)/$(OWNER)/$(IMAGE)
2727
COMMA := ,
2828

2929
ifndef VERSION

charts/policy-reporter/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Check the [Documentation](https://kyverno.github.io/policy-reporter/guide/02-get
5454
| image.registry | string | `"ghcr.io"` | |
5555
| image.repository | string | `"kyverno/policy-reporter"` | |
5656
| image.pullPolicy | string | `"IfNotPresent"` | |
57-
| image.tag | string | `"2.17.2"` | |
57+
| image.tag | string | `"f4fa523"` | |
5858
| imagePullSecrets | list | `[]` | |
5959
| priorityClassName | string | `""` | |
6060
| replicaCount | int | `1` | |

charts/policy-reporter/charts/kyvernoPlugin/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
8080

8181
{{- define "kyvernoplugin.securityContext" -}}
8282
{{- if semverCompare "<1.19" .Capabilities.KubeVersion.Version }}
83-
{{ toYaml (omit .Values.securityContext "seccompProfile") }}
83+
{{- toYaml (omit .Values.securityContext "seccompProfile") }}
8484
{{- else }}
85-
{{ toYaml .Values.securityContext }}
85+
{{- toYaml .Values.securityContext }}
8686
{{- end }}
8787
{{- end }}
8888

charts/policy-reporter/charts/kyvernoPlugin/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ spec:
5656
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
5757
imagePullPolicy: {{ .Values.image.pullPolicy }}
5858
{{- if .Values.securityContext }}
59-
securityContext: {{ include "kyvernoplugin.securityContext" . | nindent 12 }}
59+
securityContext: {{- include "kyvernoplugin.securityContext" . | nindent 12 }}
6060
{{- end }}
6161
args:
6262
- --port={{ .Values.port.number }}

charts/policy-reporter/charts/ui/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: ui
33
description: Policy Reporter UI
44

55
type: application
6-
version: 2.10.2
7-
appVersion: 1.9.1
6+
version: 2.0.0-alpha
7+
appVersion: 2.0.0-alpha

charts/policy-reporter/charts/ui/README.md

+14-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ui
22

3-
![Version: 2.10.2](https://img.shields.io/badge/Version-2.10.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.9.1](https://img.shields.io/badge/AppVersion-1.9.1-informational?style=flat-square)
3+
![Version: 2.0.0-alpha](https://img.shields.io/badge/Version-2.0.0--alpha-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0-alpha](https://img.shields.io/badge/AppVersion-2.0.0--alpha-informational?style=flat-square)
44

55
Policy Reporter UI
66

@@ -14,33 +14,27 @@ Policy Reporter UI
1414
| image.registry | string | `"ghcr.io"` | |
1515
| image.repository | string | `"kyverno/policy-reporter-ui"` | |
1616
| image.pullPolicy | string | `"IfNotPresent"` | |
17-
| image.tag | string | `"1.9.1"` | |
17+
| image.tag | string | `"59749d3ec2f2b73aede3ed5393d9c83cc762bc2f"` | |
1818
| displayMode | string | `""` | |
19-
| refreshInterval | int | `10000` | |
2019
| annotations | object | `{}` | |
21-
| log.size | int | `200` | |
22-
| views.dashboard.policyReports | bool | `true` | |
23-
| views.dashboard.clusterPolicyReports | bool | `true` | |
24-
| views.logs | bool | `true` | |
25-
| views.policyReports | bool | `true` | |
26-
| views.clusterPolicyReports | bool | `true` | |
27-
| views.kyvernoPolicies | bool | `true` | |
28-
| views.kyvernoVerifyImages | bool | `true` | |
2920
| plugins.kyverno | bool | `false` | |
30-
| clusterName | string | `""` | |
21+
| clusterName | string | `"default"` | |
3122
| clusters | list | `[]` | |
3223
| labelFilter | list | `[]` | |
24+
| defaultFilter.resources[0] | string | `"Deployment"` | |
25+
| defaultFilter.resources[1] | string | `"CronJob"` | |
26+
| defaultFilter.resources[2] | string | `"DaemonSet"` | |
27+
| defaultFilter.resources[3] | string | `"StatefulSet"` | |
28+
| defaultFilter.resources[4] | string | `"Service"` | |
29+
| defaultFilter.resources[5] | string | `"Secret"` | |
30+
| defaultFilter.resources[6] | string | `"ConfigMap"` | |
31+
| defaultFilter.clusterResources[0] | string | `"Node"` | |
32+
| defaultFilter.clusterResources[1] | string | `"Namespace"` | |
33+
| logging.enabled | bool | `false` | |
3334
| logging.encoding | string | `"console"` | |
3435
| logging.logLevel | int | `0` | |
3536
| logging.development | bool | `false` | |
36-
| api.logging | bool | `false` | |
37-
| api.overwriteHost | bool | `true` | |
38-
| redis.enabled | bool | `false` | |
39-
| redis.address | string | `""` | |
40-
| redis.database | int | `0` | |
41-
| redis.prefix | string | `"policy-reporter-ui"` | |
42-
| redis.username | string | `""` | |
43-
| redis.password | string | `""` | |
37+
| server.overwriteHost | bool | `true` | |
4438
| policyReporter.port | int | `8080` | |
4539
| kyvernoPlugin.port | int | `8080` | |
4640
| volumes | list | `[]` | |

charts/policy-reporter/charts/ui/templates/_helpers.tpl

+2-11
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ Create the name of the service account to use
115115

116116
{{- define "ui.securityContext" -}}
117117
{{- if semverCompare "<1.19" .Capabilities.KubeVersion.Version }}
118-
{{ toYaml (omit .Values.securityContext "seccompProfile") }}
118+
{{- toYaml (omit .Values.securityContext "seccompProfile") }}
119119
{{- else }}
120-
{{ toYaml .Values.securityContext }}
120+
{{- toYaml .Values.securityContext }}
121121
{{- end }}
122122
{{- end }}
123123

@@ -129,12 +129,3 @@ Create the name of the service account to use
129129
{{- .Release.Namespace -}}
130130
{{- end -}}
131131
{{- end -}}
132-
133-
{{/* Get the namespace name. */}}
134-
{{- define "ui.logLevel" -}}
135-
{{- if .Values.api.logging -}}
136-
-1
137-
{{- else -}}
138-
{{- .Values.logging.logLevel -}}
139-
{{- end -}}
140-
{{- end -}}

charts/policy-reporter/charts/ui/templates/config.yaml

+29-31
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,40 @@ metadata:
1111
{{- include "ui.labels" . | nindent 4 }}
1212
data:
1313
config.yaml: |-
14-
logSize: {{ .Values.log.size }}
15-
displayMode: {{ .Values.displayMode | quote }}
16-
refreshInterval: {{ .Values.refreshInterval }}
17-
clusterName: {{ .Values.clusterName | quote }}
18-
views:
19-
dashboard:
20-
policyReports: {{ .Values.views.dashboard.policyReports }}
21-
clusterPolicyReports: {{ .Values.views.dashboard.clusterPolicyReports }}
22-
logs: {{ .Values.views.logs }}
23-
policyReports: {{ .Values.views.policyReports }}
24-
clusterPolicyReports: {{ .Values.views.clusterPolicyReports }}
25-
kyvernoPolicies: {{ .Values.views.kyvernoPolicies }}
26-
kyvernoVerifyImages: {{ .Values.views.kyvernoVerifyImages }}
27-
{{- with .Values.clusters }}
2814
clusters:
15+
- name: {{ .Values.clusterName | quote }}
16+
host: http://{{ include "ui.policyReportServiceName" . }}:{{ .Values.policyReporter.port }}
17+
{{- if or .Values.global.basicAuth.username .Values.global.basicAuth.secretRef }}
18+
basicAuth:
19+
username: {{ .Values.global.basicAuth.username }}
20+
password: {{ .Values.global.basicAuth.password }}
21+
secretRef: {{ .Values.global.basicAuth.secretRef }}
22+
{{- end }}
23+
{{- if or .Values.plugins.kyverno .Values.global.plugins.kyverno }}
24+
plugins:
25+
- name: kyverno
26+
host: http://{{ include "ui.kyvernoPluginServiceName" . }}:{{ .Values.kyvernoPlugin.port }}
27+
{{- end }}
28+
{{- with .Values.clusters }}
2929
{{- toYaml . | nindent 4 }}
3030
{{- end }}
31-
{{- with .Values.labelFilter }}
32-
labelFilter:
33-
{{- toYaml . | nindent 4 }}
34-
{{- end }}
35-
36-
{{- with .Values.redis }}
37-
redis:
38-
{{- toYaml . | nindent 6 }}
39-
{{- end }}
31+
32+
ui:
33+
{{- with .Values.labelFilter }}
34+
labelFilter:
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
37+
{{- with .Values.defaultFilter }}
38+
defaultFilter:
39+
{{- toYaml . | nindent 8 }}
40+
{{- end }}
4041
4142
logging:
43+
enabled: {{ .Values.logging.enabled }}
4244
encoding: {{ .Values.logging.encoding }}
43-
logLevel: {{ include "ui.logLevel" . }}
45+
logLevel: {{ .Values.logging.logLevel }}
4446
development: {{ .Values.logging.development }}
4547
46-
apiConfig:
47-
logging: {{ .Values.api.logging }}
48-
overwriteHost: {{ .Values.api.overwriteHost }}
49-
basicAuth:
50-
username: {{ .Values.global.basicAuth.username }}
51-
password: {{ .Values.global.basicAuth.password }}
52-
secretRef: {{ .Values.global.basicAuth.secretRef }}
48+
server:
49+
overwriteHost: {{ .Values.server.overwriteHost }}
50+
mode: release

charts/policy-reporter/charts/ui/templates/deployment.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,11 @@ spec:
4646
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4747
imagePullPolicy: {{ .Values.image.pullPolicy }}
4848
{{- if .Values.securityContext }}
49-
securityContext: {{ include "ui.securityContext" . | nindent 12 }}
49+
securityContext: {{- include "ui.securityContext" . | nindent 12 }}
5050
{{- end }}
5151
args:
52-
- -config=/app/config.yaml
53-
- -policy-reporter=http://{{ include "ui.policyReportServiceName" . }}:{{ .Values.policyReporter.port }}
54-
{{- if or .Values.plugins.kyverno .Values.global.plugins.kyverno }}
55-
- -kyverno-plugin=http://{{ include "ui.kyvernoPluginServiceName" . }}:{{ .Values.kyvernoPlugin.port }}
56-
{{- end }}
52+
- run
53+
- --config=/app/config.yaml
5754
ports:
5855
- name: http
5956
containerPort: 8080

charts/policy-reporter/charts/ui/values.yaml

+23-38
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,28 @@ image:
99
registry: ghcr.io
1010
repository: kyverno/policy-reporter-ui
1111
pullPolicy: IfNotPresent
12-
tag: 1.9.1
12+
tag: d8a8ab2
1313

1414
# possible default displayModes: light/dark
1515
displayMode: ""
1616

17-
# default refreshInterval, set 0 to disable it
18-
refreshInterval: 10000
19-
2017
# Key/value pairs that are attached to all resources.
2118
annotations: {}
2219

23-
log:
24-
# holds the latest 200 validation results in the UI Log
25-
size: 200
26-
27-
# enable/disable views as needed in the Policy Reporter UI
28-
# disabled log view will also disable the UI as push target
29-
views:
30-
dashboard:
31-
policyReports: true
32-
clusterPolicyReports: true
33-
logs: true
34-
policyReports: true
35-
clusterPolicyReports: true
36-
kyvernoPolicies: true
37-
kyvernoVerifyImages: true
38-
3920
plugins:
4021
kyverno: false
4122

4223
# Custom Cluster Name which is used in the ClusterSelect, if you configured additional clusters below.
43-
clusterName: ""
24+
clusterName: "default"
4425

4526
# Attention: be sure that your APIs are not accessable for the outside world
4627
# Use tools like VPN, private Networks or internal Network Load Balancer to expose your APIs in a secure way to the UI
4728
clusters: []
4829
# - name: External Cluster
49-
# api: https://policy-reporter.external.cluster # reachable external Policy Reporter REST API
50-
# kyvernoApi: https://policy-reporter-kyverno-plugin.external.cluster # (optional) reachable external Policy Reporter Kyverno Plugin REST API
30+
# host: https://policy-reporter.external.cluster # reachable external Policy Reporter REST API
31+
# plugins:
32+
# - name: kyverno
33+
# host: https://policy-reporter-kyverno-plugin.external.cluster # (optional) reachable external Policy Reporter Kyverno Plugin REST API
5134
# skipTLS: false
5235
# certificate: "/app/certs/root.ca"
5336
# secreRef: "" # name of an existing secret to read the clusterconfiguration from, supported keys: api, kyvernoApi, username, password, skipTLS, certificate
@@ -71,27 +54,29 @@ clusters: []
7154
# labelFilter: ["owner"]
7255
labelFilter: []
7356

57+
defaultFilter:
58+
resources:
59+
- Deployment
60+
- CronJob
61+
- DaemonSet
62+
- StatefulSet
63+
- Service
64+
- Secret
65+
- ConfigMap
66+
clusterResources:
67+
- Node
68+
- Namespace
69+
7470
# Proxy request logging
7571
logging:
76-
encoding: console # possible encodings are console and json
77-
logLevel: 0 # default info
72+
enabled: false # enables access logging for proxy requests
73+
encoding: console # possible encodings are console and json
74+
logLevel: 0 # default info
7875
development: false # more human readable structure, removes log sampling
7976

80-
api:
81-
logging: false # enables access logging for proxy requests, sets log level to debug
77+
server:
8278
overwriteHost: true # overwrites request host and sets X-Forwarded--Host and X-Origin-Host headers
8379

84-
# use redis as external log storage instead of an in memory store
85-
# recommended when using a HA setup with more then one replica
86-
# to get all logs on each instance
87-
redis:
88-
enabled: false
89-
address: ""
90-
database: 0
91-
prefix: "policy-reporter-ui"
92-
username: ""
93-
password: ""
94-
9580
# configurations related to the PolicyReporter API
9681
policyReporter:
9782
port: 8080

charts/policy-reporter/templates/_helpers.tpl

-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ Create UI target host based on configuration
7878
{{- .Values.target.ui.host }}
7979
{{- else if not .Values.ui.enabled }}
8080
{{- "" }}
81-
{{- else if and .Values.ui.enabled (and .Values.ui.views.logs .Values.ui.service.enabled) }}
82-
{{- printf "http://%s:%s" (include "ui.fullname" .) (.Values.ui.service.port | toString) }}
8381
{{- else }}
8482
{{- "" }}
8583
{{- end }}

charts/policy-reporter/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ spec:
5757
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
5858
imagePullPolicy: {{ .Values.image.pullPolicy }}
5959
{{- if .Values.securityContext }}
60-
securityContext: {{ include "policyreporter.securityContext" . | nindent 12 }}
60+
securityContext: {{- include "policyreporter.securityContext" . | nindent 12 }}
6161
{{- end }}
6262
args:
6363
- --port={{ .Values.port.number }}

charts/policy-reporter/values.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ image:
55
registry: ghcr.io
66
repository: kyverno/policy-reporter
77
pullPolicy: IfNotPresent
8-
tag: 2.17.2
8+
tag: f4fa523
99

1010
imagePullSecrets: []
1111

@@ -198,7 +198,7 @@ global:
198198
# The name of service policy-report. Defaults to ReleaseName.
199199
backend: ""
200200
# overwrite the fullname of all resources including subcharts
201-
fullnameOverride: ""
201+
fullnameOverride: "policy-reporter"
202202
# configure the namespace of all resources including subcharts
203203
namespace: ""
204204
# additional labels added on each resource

0 commit comments

Comments
 (0)