-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
- Loading branch information
1 parent
68105dc
commit b2ff6a3
Showing
35 changed files
with
701 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
charts/kyverno-authz-server/templates/validation-webhook/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{- define "validation-webhook.name" -}} | ||
{{ template "kyverno.lib.names.name" . }}-validation | ||
{{- end -}} | ||
|
||
{{- define "validation-webhook.labels" -}} | ||
{{- template "kyverno.lib.labels.merge" (list | ||
(include "kyverno.lib.labels.common" .) | ||
(include "validation-webhook.labels.selector" .) | ||
) -}} | ||
{{- end -}} | ||
|
||
{{- define "validation-webhook.labels.selector" -}} | ||
{{- template "kyverno.lib.labels.merge" (list | ||
(include "kyverno.lib.labels.common.selector" .) | ||
(include "kyverno.lib.labels.component" "validation-webhook") | ||
) -}} | ||
{{- end -}} | ||
|
||
{{- define "validation-webhook.service-account.name" -}} | ||
{{- if .Values.rbac.create -}} | ||
{{- default (include "validation-webhook.name" .) .Values.rbac.serviceAccount.name -}} | ||
{{- else -}} | ||
{{- required "A service account name is required when `rbac.create` is set to `false`" .Values.rbac.serviceAccount.name -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "validation-webhook.image" -}} | ||
{{- printf "%s/%s:%s" .registry .repository (default "latest" .tag) -}} | ||
{{- end -}} |
17 changes: 17 additions & 0 deletions
17
...erno-authz-server/templates/validation-webhook/certificates/cert-manager/certificate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if .Values.certificates.certManager -}} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ template "validation-webhook.name" . }} | ||
namespace: {{ template "kyverno.lib.namespace" . }} | ||
labels: | ||
{{- include "validation-webhook.labels" . | nindent 4 }} | ||
spec: | ||
secretName: {{ template "validation-webhook.name" . }} | ||
dnsNames: | ||
- {{ printf "%s.%s.svc" (include "validation-webhook.name" .) (include "kyverno.lib.namespace" .) }} | ||
{{- with .Values.certificates.certManager.issuerRef }} | ||
issuerRef: | ||
{{- tpl (toYaml .) $ | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
13 changes: 13 additions & 0 deletions
13
charts/kyverno-authz-server/templates/validation-webhook/certificates/static/secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.certificates.static -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "validation-webhook.name" . }} | ||
namespace: {{ template "kyverno.lib.namespace" . }} | ||
labels: | ||
{{- include "validation-webhook.labels" . | nindent 4 }} | ||
type: kubernetes.io/tls | ||
data: | ||
tls.crt: {{ .Values.certificates.static.crt | b64enc }} | ||
tls.key: {{ .Values.certificates.static.key | b64enc }} | ||
{{- end }} |
119 changes: 119 additions & 0 deletions
119
charts/kyverno-authz-server/templates/validation-webhook/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "validation-webhook.name" . }} | ||
namespace: {{ template "kyverno.lib.namespace" . }} | ||
labels: | ||
{{- include "validation-webhook.labels" . | nindent 4 }} | ||
{{- with .Values.deployment.annotations }} | ||
annotations: | ||
{{- tpl (toYaml .) $ | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.deployment.replicas }} | ||
replicas: {{ . }} | ||
{{- end }} | ||
revisionHistoryLimit: {{ .Values.deployment.revisionHistoryLimit }} | ||
{{- with .Values.deployment.updateStrategy }} | ||
strategy: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "validation-webhook.labels.selector" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "validation-webhook.labels" . | nindent 8 }} | ||
{{- with .Values.pod.labels }} | ||
{{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pod.annotations }} | ||
annotations: {{ tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.pod.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pod.securityContext }} | ||
securityContext: | ||
{{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pod.nodeSelector }} | ||
nodeSelector: | ||
{{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pod.tolerations }} | ||
tolerations: | ||
{{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pod.topologySpreadConstraints }} | ||
topologySpreadConstraints: | ||
{{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pod.priorityClassName }} | ||
priorityClassName: {{ . | quote }} | ||
{{- end }} | ||
{{- with .Values.pod.hostNetwork }} | ||
hostNetwork: {{ . }} | ||
{{- end }} | ||
{{- with .Values.pod.dnsPolicy }} | ||
dnsPolicy: {{ . }} | ||
{{- end }} | ||
affinity: | ||
{{- with .Values.pod.antiAffinity }} | ||
podAntiAffinity: | ||
{{- tpl (toYaml .) $ | nindent 10 }} | ||
{{- end }} | ||
{{- with .Values.pod.affinity }} | ||
podAffinity: | ||
{{- tpl (toYaml .) $ | nindent 10 }} | ||
{{- end }} | ||
{{- with .Values.pod.nodeAffinity }} | ||
nodeAffinity: | ||
{{- tpl (toYaml .) $ | nindent 10 }} | ||
{{- end }} | ||
serviceAccountName: {{ template "validation-webhook.service-account.name" . }} | ||
volumes: | ||
- name: certs | ||
secret: | ||
secretName: {{ template "validation-webhook.name" . }} | ||
containers: | ||
{{- with .Values.containers.server }} | ||
- name: server | ||
image: {{ include "validation-webhook.image" (mustMerge .image (dict "tag" (default $.Chart.Version $.Chart.AppVersion))) }} | ||
imagePullPolicy: {{ .image.pullPolicy }} | ||
{{- with .resources }} | ||
resources: | ||
{{- tpl (toYaml .) $ | nindent 12 }} | ||
{{- end }} | ||
{{- with .securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .startupProbe }} | ||
startupProbe: | ||
{{- tpl (toYaml .) $ | nindent 12 }} | ||
{{- end }} | ||
{{- with .livenessProbe }} | ||
livenessProbe: | ||
{{- tpl (toYaml .) $ | nindent 12 }} | ||
{{- end }} | ||
{{- with .readinessProbe }} | ||
readinessProbe: | ||
{{- tpl (toYaml .) $ | nindent 12 }} | ||
{{- end }} | ||
{{- with .ports }} | ||
ports: | ||
{{- tpl (toYaml .) $ | nindent 12 }} | ||
{{- end }} | ||
args: | ||
- serve | ||
- validation-webhook | ||
- --probes-address=:9080 | ||
volumeMounts: | ||
- name: certs | ||
mountPath: /tmp/k8s-webhook-server/serving-certs | ||
readOnly: true | ||
{{- end }} |
Oops, something went wrong.