diff --git a/charts/policy-controller/Chart.yaml b/charts/policy-controller/Chart.yaml index c0168c04..5f095e2c 100644 --- a/charts/policy-controller/Chart.yaml +++ b/charts/policy-controller/Chart.yaml @@ -8,7 +8,7 @@ sources: type: application name: policy-controller -version: 0.7.2 +version: 0.8.0 appVersion: 0.8.2 maintainers: diff --git a/charts/policy-controller/README.md b/charts/policy-controller/README.md index ff4b691a..eaf29a31 100644 --- a/charts/policy-controller/README.md +++ b/charts/policy-controller/README.md @@ -2,7 +2,7 @@ -![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 @@ -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 | `{}` | | diff --git a/charts/policy-controller/templates/webhook/deployment_webhook.yaml b/charts/policy-controller/templates/webhook/deployment_webhook.yaml index 174ffd6d..5874e551 100644 --- a/charts/policy-controller/templates/webhook/deployment_webhook.yaml +++ b/charts/policy-controller/templates/webhook/deployment_webhook.yaml @@ -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: @@ -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 }}" diff --git a/charts/policy-controller/values.schema.json b/charts/policy-controller/values.schema.json index a6fc34ef..1685ad9b 100644 --- a/charts/policy-controller/values.schema.json +++ b/charts/policy-controller/values.schema.json @@ -61,6 +61,9 @@ "webhook": { "type": "object", "properties": { + "affinity": { + "type": "object" + }, "configData": { "type": "object" }, diff --git a/charts/policy-controller/values.yaml b/charts/policy-controller/values.yaml index 6ee8023a..11a3a44c 100644 --- a/charts/policy-controller/values.yaml +++ b/charts/policy-controller/values.yaml @@ -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