Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for installation of the admission controller webhooks outside of helm hooks (fixes #315) #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions wiz-admission-controller/templates/opawebhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ metadata:
labels:
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.installAsHook }}
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
{{- if $useCertManagerCerts }}
"cert-manager.io/inject-ca-from": {{ include "wiz-admission-controller.certManagerInject" . }}
{{- end }}
Expand Down Expand Up @@ -56,8 +58,10 @@ metadata:
labels:
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.installAsHook }}
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
{{- if $useCertManagerCerts }}
"cert-manager.io/inject-ca-from": {{ include "wiz-admission-controller.certManagerInject" . }}
{{- end }}
Expand Down Expand Up @@ -95,8 +99,10 @@ metadata:
labels:
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.installAsHook }}
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
{{- if $useCertManagerCerts }}
"cert-manager.io/inject-ca-from": {{ include "wiz-admission-controller.certManagerInject" . }}
{{- end }}
Expand Down Expand Up @@ -134,8 +140,10 @@ metadata:
labels:
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.installAsHook }}
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
{{- if $useCertManagerCerts }}
"cert-manager.io/inject-ca-from": {{ include "wiz-admission-controller.certManagerInject" . }}
{{- end }}
Expand Down Expand Up @@ -174,9 +182,11 @@ metadata:
labels:
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.installAsHook }}
# Using helm hook to create certs only for chart install
"helm.sh/hook": "pre-install, pre-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
{{- with (coalesce .Values.webhook.secret.annotations .Values.opaWebhook.secret.annotations) }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions wiz-admission-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ webhook:

injectCaFrom: "" # Inject Certificate to webhook configurations. Format: "namespace/certificate". Prerequisite - https://cert-manager.io/docs/installation.
createSelfSignedCert: false # Create and use a self-signed certificate using `cert-manager`. Prerequisite - https://cert-manager.io/docs/installation.
installAsHook: true # Install the webhooks as helm hooks so they are deleted on every install or upgrade.
secret:
name: "" # Name of the Certificate secret.
annotations: {} # Annotations of the Certificate secret.
Expand Down