Skip to content

Commit

Permalink
Expose webhook affinity via values.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
shearn89 committed Dec 12, 2024
1 parent 57e62b9 commit 89bcdbe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/policy-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sources:
type: application

name: policy-controller
version: 0.7.2
version: 0.8.0
appVersion: 0.8.2

maintainers:
Expand Down
3 changes: 2 additions & 1 deletion charts/policy-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- This README.md is generated. Please edit README.md.gotmpl -->

![Version: 0.7.2](https://img.shields.io/badge/Version-0.7.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.2](https://img.shields.io/badge/AppVersion-0.8.2-informational?style=flat-square)
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.2](https://img.shields.io/badge/AppVersion-0.8.2-informational?style=flat-square)

The Helm chart for Policy Controller

Expand Down Expand Up @@ -161,6 +161,7 @@ helm uninstall [RELEASE_NAME]
| leasescleanup.image.version | string | `"latest-dev"` | |
| loglevel | string | `"info"` | |
| serviceMonitor.enabled | bool | `false` | |
| webhook.affinity | object | `{}` | |
| webhook.configData | object | `{}` | |
| webhook.customLabels | object | `{}` | |
| webhook.env | object | `{}` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ spec:
serviceAccountName: {{ include "webhook.serviceAccountName" . }}
# To avoid node becoming SPOF, spread our replicas to different nodes.
affinity:
{{- if .Values.webhook.affinity }}
{{- toYaml .Values.webhook.affinity | nindent 8 }}
{{- else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
Expand All @@ -41,6 +44,7 @@ spec:
control-plane: {{ template "policy-controller.fullname" . }}-webhook
topologyKey: kubernetes.io/hostname
weight: 100
{{- end }}
containers:
- name: {{ template "policy-controller.name" . }}-{{ .Values.webhook.name }}
image: "{{ template "policy-controller.image" .Values.webhook.image }}"
Expand Down
3 changes: 3 additions & 0 deletions charts/policy-controller/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"webhook": {
"type": "object",
"properties": {
"affinity": {
"type": "object"
},
"configData": {
"type": "object"
},
Expand Down
3 changes: 3 additions & 0 deletions charts/policy-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ webhook:
capabilities:
drop:
- ALL
# The default affinity config is to spread the webhook across nodes.
# See charts/policy-controller/templates/webhook/deployment_webhook.yaml#L39 for more info.
affinity: {}
podDisruptionBudget:
enabled: true
minAvailable: 1
Expand Down

0 comments on commit 89bcdbe

Please sign in to comment.