openreplay/scripts/helmcharts/toolings/charts/kyverno/templates/reports-controller/deployment.yaml
2023-06-09 18:13:40 +02:00

154 lines
6.1 KiB
YAML

{{- if .Values.reportsController.enabled -}}
{{- if not .Values.templating.debug -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "kyverno.reports-controller.name" . }}
namespace: {{ template "kyverno.namespace" . }}
labels:
{{- include "kyverno.reports-controller.labels" . | nindent 4 }}
spec:
replicas: {{ template "kyverno.deployment.replicas" .Values.reportsController.replicas }}
{{- with .Values.reportsController.updateStrategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "kyverno.reports-controller.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "kyverno.reports-controller.labels" . | nindent 8 }}
{{- with .Values.reportsController.podLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.reportsController.podAnnotations }}
annotations: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
spec:
{{- with .Values.reportsController.imagePullSecrets }}
imagePullSecrets:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.reportsController.podSecurityContext }}
securityContext:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.reportsController.nodeSelector }}
nodeSelector:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.reportsController.tolerations }}
tolerations:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.reportsController.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.reportsController.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.reportsController.hostNetwork }}
hostNetwork: {{ . }}
{{- end }}
{{- with .Values.reportsController.dnsPolicy }}
dnsPolicy: {{ . }}
{{- end }}
{{- if or .Values.reportsController.antiAffinity.enabled .Values.reportsController.podAffinity .Values.reportsController.nodeAffinity }}
affinity:
{{- if .Values.reportsController.antiAffinity.enabled }}
{{- with .Values.reportsController.podAntiAffinity }}
podAntiAffinity:
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
{{- end }}
{{- with .Values.reportsController.podAffinity }}
podAffinity:
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
{{- with .Values.reportsController.nodeAffinity }}
nodeAffinity:
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
{{- end }}
serviceAccountName: {{ template "kyverno.reports-controller.serviceAccountName" . }}
containers:
- name: controller
image: {{ include "kyverno.reports-controller.image" (dict "image" .Values.reportsController.image "defaultTag" .Chart.AppVersion) | quote }}
ports:
- containerPort: 9443
name: https
protocol: TCP
- containerPort: 8000
name: metrics
protocol: TCP
args:
{{- if .Values.reportsController.tracing.enabled }}
- --enableTracing
- --tracingAddress={{ .Values.reportsController.tracing.address }}
- --tracingPort={{ .Values.reportsController.tracing.port }}
{{- with .Values.reportsController.tracing.creds }}
- --tracingCreds={{ . }}
{{- end }}
{{- end }}
- --disableMetrics={{ .Values.reportsController.metering.disabled }}
{{- if not .Values.reportsController.metering.disabled }}
- --otelConfig={{ .Values.reportsController.metering.config }}
- --metricsPort={{ .Values.reportsController.metering.port }}
{{- with .Values.reportsController.metering.collector }}
- --otelCollector={{ . }}
{{- end }}
{{- with .Values.reportsController.metering.creds }}
- --transportCreds={{ . }}
{{- end }}
{{- end }}
{{- if or .Values.imagePullSecrets .Values.existingImagePullSecrets }}
- --imagePullSecrets={{- join "," (concat (keys .Values.imagePullSecrets) .Values.existingImagePullSecrets) }}
{{- end }}
{{- include "kyverno.features.flags" (pick (mergeOverwrite .Values.features .Values.reportsController.featuresOverride)
"admissionReports"
"backgroundScan"
"configMapCaching"
"logging"
"omitEvents"
"policyExceptions"
"reports"
"registryClient"
) | nindent 12 }}
{{- range $key, $value := .Values.reportsController.extraArgs }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- end }}
env:
- name: INIT_CONFIG
value: {{ template "kyverno.config.configMapName" . }}
- name: METRICS_CONFIG
value: {{ template "kyverno.config.metricsConfigMapName" . }}
- name: KYVERNO_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: KYVERNO_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TUF_ROOT
value: {{ .Values.reportsController.tufRootMountPath }}
{{- with .Values.reportsController.resources }}
resources: {{ tpl (toYaml .) $ | nindent 12 }}
{{- end }}
{{- with .Values.reportsController.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: {{ .Values.reportsController.tufRootMountPath }}
name: sigstore
volumes:
- name: sigstore
{{- toYaml (required "A valid .Values.reportsController.sigstoreVolume entry is required" .Values.reportsController.sigstoreVolume) | nindent 8 }}
{{- end -}}
{{- end -}}