Skip to content

Commit

Permalink
feat: add pdb to policy-controller
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Woodbine <[email protected]>
  • Loading branch information
BobyMCbobs committed Sep 13, 2023
1 parent 8d69870 commit 9a0fd36
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/policy-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ The Helm chart for Policy Controller
| webhook.resources.requests.memory | string | `"128Mi"` | |
| webhook.securityContext.enabled | bool | `false` | |
| webhook.securityContext.runAsUser | int | `65532` | |
| webhook.podDisruptionBudget.enabled | bool | `true` | |
| webhook.podDisruptionBudget.minAvailable | int | `1` | |
| webhook.podDisruptionBudget.maxUnavailable | int | `null` | |
| webhook.service.annotations | object | `{}` | |
| webhook.service.port | int | `443` | |
| webhook.service.type | string | `"ClusterIP"` | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{ if .Values.webhook.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "policy-controller.fullname" . }}-webhook
labels:
{{- include "policy-controller.labels" . | nindent 4 }}
control-plane: {{ template "policy-controller.fullname" . }}-webhook
{{- if .Values.labels }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
annotations:
{{- if .Values.annotations }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
minAvailable: {{ .Values.webhook.podDisruptionBudget.minAvailable }}
maxUnavailable: {{ .Values.webhook.podDisruptionBudget.maxUnavailable }}
selector:
matchLabels:
{{- include "policy-controller.selectorLabels" . | nindent 6 }}
control-plane: {{ template "policy-controller.fullname" . }}-webhook
{{- end }}
4 changes: 4 additions & 0 deletions charts/policy-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ webhook:
capabilities:
drop:
- ALL
podDisruptionBudget:
enabled: true
minAvailable: 1
# maxUnavailable: 3
serviceAccount:
annotations: {}
create: true
Expand Down

0 comments on commit 9a0fd36

Please sign in to comment.