Skip to content

Commit

Permalink
feat: webbook name configuration.
Browse files Browse the repository at this point in the history
Now the controller creates is own root CA and needs to configure the
webhooks with the proper CA certificate bundle. Therefore, it's
necessary to define in the CLI arguments the webhooks names which
the controller must update after creating the root CA.

Signed-off-by: José Guilherme Vanz <[email protected]>
  • Loading branch information
jvanz committed Aug 30, 2023
1 parent 6ef175e commit 2d17a9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions charts/kubewarden-controller/chart-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ resources:
memory: 50Mi
# Controller replicas
replicas: 1
# values to configure the webhook used to validate/mudate custom resources
webHooks:
validatingWebHooks: "kubewarden-controller-validating-webhook-configuration"
mutatingWebHooks: "kubewarden-controller-mutating-webhook-configuration"
auditScanner:
enable: true
# The default audit-scanner ServiceAccount is bound to the ClusterRoles:
Expand Down
3 changes: 3 additions & 0 deletions charts/kubewarden-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ spec:
- --enable-metrics
{{- end }}
- --always-accept-admission-reviews-on-deployments-namespace
- --validating-webhooks={{ .Values.webHooks.validatingWebHooks }}
- --mutating-webhooks={{ .Values.webHooks.mutatingWebHooks }}
- --controller-webhook-service={{ include "kubewarden-controller.fullname" . }}-webhook-service
command:
- /manager
{{- if .Values.telemetry.enabled }}
Expand Down
4 changes: 2 additions & 2 deletions charts/kubewarden-controller/templates/webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: MutatingWebhookConfiguration
metadata:
annotations:
{{- include "kubewarden-controller.annotations" . | nindent 4 }}
name: kubewarden-controller-mutating-webhook-configuration
name: {{ .Values.webHooks.mutatingWebHooks }}
labels:
{{- include "kubewarden-controller.labels" . | nindent 4 }}
webhooks:
Expand Down Expand Up @@ -78,7 +78,7 @@ kind: ValidatingWebhookConfiguration
metadata:
annotations:
{{- include "kubewarden-controller.annotations" . | nindent 4 }}
name: kubewarden-controller-validating-webhook-configuration
name: {{ .Values.webHooks.validatingWebHooks }}
labels:
{{- include "kubewarden-controller.labels" . | nindent 4 }}
webhooks:
Expand Down
4 changes: 4 additions & 0 deletions charts/kubewarden-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ resources:
memory: 50Mi
# Controller replicas
replicas: 1
# values to configure the webhook used to validate/mudate custom resources
webHooks:
validatingWebHooks: "kubewarden-controller-validating-webhook-configuration"
mutatingWebHooks: "kubewarden-controller-mutating-webhook-configuration"
auditScanner:
enable: true
# The default audit-scanner ServiceAccount is bound to the ClusterRoles:
Expand Down

0 comments on commit 2d17a9b

Please sign in to comment.