Skip to content
Merged
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
2 changes: 1 addition & 1 deletion cmd/build/helmify/kustomize-for-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ spec:
- --prometheus-port=HELMSUBST_DEPLOYMENT_AUDIT_METRICS_PORT
- --enable-external-data={{ .Values.enableExternalData }}
- HELMSUBST_METRICS_BACKEND_ARG
- --disable-cert-rotation={{ .Values.audit.disableCertRotation }}
- --disable-cert-rotation={{ or .Values.audit.disableCertRotation .Values.externalCertInjection.enabled }}
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
HELMSUBST_AUDIT_CONTROLLER_MANAGER_DEPLOYMENT_IMAGE_RELEASE: ""
ports:
Expand Down
4 changes: 4 additions & 0 deletions cmd/build/helmify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func (ks *kindSet) Write() error {
obj = "{{- if not .Values.disableMutation }}\n" + obj + "{{- end }}\n"
}

if name == "gatekeeper-webhook-server-cert" && kind == "Secret" {
obj = "{{- if not .Values.externalCertInjection.enabled }}\n" + obj + "{{- end }}\n"
}

if name == "gatekeeper-critical-pods" && kind == "ResourceQuota" {
obj = "{{- if .Values.resourceQuota }}\n" + obj + "{{- end }}\n"
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/build/helmify/static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi
| service.loadBalancerIP | The IP address of LoadBalancer service | `` |
| service.healthzPort | Service port to gatekeeper Webhook health port | `9090` |
| rbac.create | Enable the creation of RBAC resources | `true` |
| externalCertInjection.enabled | Enable the injection of an external certificate. This disables automatic certificate generation and rotation | `false` |
| externalCertInjection.secretName | Name of secret for injected certificate | `gatekeeper-webhook-server-cert` |

## Contributing Changes

Expand Down
2 changes: 1 addition & 1 deletion cmd/build/helmify/static/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ Output post install webhook probe volume entry
{{- define "gatekeeper.postInstallWebhookProbeVolume" -}}
- name: cert
secret:
secretName: gatekeeper-webhook-server-cert
secretName: {{ .Values.externalCertInjection.secretName }}
{{- end -}}
3 changes: 3 additions & 0 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,6 @@ upgradeCRDs:
extraRules: []
rbac:
create: true
externalCertInjection:
enabled: false
secretName: gatekeeper-webhook-server-cert
2 changes: 2 additions & 0 deletions manifest_staging/charts/gatekeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi
| service.loadBalancerIP | The IP address of LoadBalancer service | `` |
| service.healthzPort | Service port to gatekeeper Webhook health port | `9090` |
| rbac.create | Enable the creation of RBAC resources | `true` |
| externalCertInjection.enabled | Enable the injection of an external certificate. This disables automatic certificate generation and rotation | `false` |
| externalCertInjection.secretName | Name of secret for injected certificate | `gatekeeper-webhook-server-cert` |

## Contributing Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ Output post install webhook probe volume entry
{{- define "gatekeeper.postInstallWebhookProbeVolume" -}}
- name: cert
secret:
secretName: gatekeeper-webhook-server-cert
secretName: {{ .Values.externalCertInjection.secretName }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
{{- range .Values.metricsBackends}}
- --metrics-backend={{ . }}
{{- end }}
- --disable-cert-rotation={{ .Values.audit.disableCertRotation }}
- --disable-cert-rotation={{ or .Values.audit.disableCertRotation .Values.externalCertInjection.enabled }}
command:
- /manager
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.externalCertInjection.enabled }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -10,3 +11,4 @@ metadata:
release: '{{ .Release.Name }}'
name: gatekeeper-webhook-server-cert
namespace: '{{ .Release.Namespace }}'
{{- end }}
3 changes: 3 additions & 0 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,6 @@ upgradeCRDs:
extraRules: []
rbac:
create: true
externalCertInjection:
enabled: false
secretName: gatekeeper-webhook-server-cert