Skip to content

Commit

Permalink
Parametrize delete operations and timeout for webhook in helm chart
Browse files Browse the repository at this point in the history
The readme mentions how to [enable delete operations](https://github.com/open-policy-agent/gatekeeper\#enable-delete-operations) by saying you should modify the yaml for the ValidatingWebhookConfiguration. However, there is no way to do this in the helm chart withough using your own fork.
This fix allows to overwrite the value if you use the helm chart as a dependency.

Additionally the webhook timeout was parametrized because in our organization we actually have a few clusters with slower response times.

Both changes are not breaking any existing integrations, they just allow to overwrite default values
  • Loading branch information
jonnylangefeld committed Jan 5, 2021
1 parent 6ceb3f4 commit e598302
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ Note: For admission webhooks registered for DELETE operations, use Kubernetes v1
- DELETE
```
If you use the helm chart, set `enableDeleteOperations=true`.
You can now check for deletes.
#### Viewing the Request Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ webhooks:
operations:
- CREATE
- UPDATE
{{- if .Values.enableDeleteOperations }}
- DELETE
{{- end}}
resources:
- '*'
sideEffects: None
timeoutSeconds: 3
timeoutSeconds: {{ .Values.validatingWebhookTimeoutSeconds }}
- clientConfig:
caBundle: Cg==
service:
Expand All @@ -51,8 +54,11 @@ webhooks:
operations:
- CREATE
- UPDATE
{{- if .Values.enableDeleteOperations }}
- DELETE
{{- end}}
resources:
- namespaces
sideEffects: None
timeoutSeconds: 3
timeoutSeconds: {{ .Values.validatingWebhookTimeoutSeconds }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ auditInterval: 60
constraintViolationsLimit: 20
auditFromCache: false
disableValidatingWebhook: false
validatingWebhookTimeoutSeconds: 3
enableDeleteOperations: false
auditChunkSize: 0
logLevel: INFO
emitAdmissionEvents: false
Expand Down

0 comments on commit e598302

Please sign in to comment.