From 0f384dfb4ad912891f08172ee0ecee11ca01e8fe Mon Sep 17 00:00:00 2001 From: Josh Roberts Date: Mon, 12 Jan 2026 11:16:05 +0000 Subject: [PATCH] feat: add pod scheduling support for operator HA - Add affinity, nodeSelector, tolerations to Helm values - Update deployment template to use scheduling fields - Add HA configuration example to README - Bump chart version to 0.3.6 Fixes #209 --- charts/typesense-operator/Chart.yaml | 2 +- charts/typesense-operator/README.md | 23 +++++++++++++++++++ .../templates/deployment.yaml | 9 ++++++++ charts/typesense-operator/values.yaml | 3 +++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/charts/typesense-operator/Chart.yaml b/charts/typesense-operator/Chart.yaml index 0963bd5..9fd64d6 100644 --- a/charts/typesense-operator/Chart.yaml +++ b/charts/typesense-operator/Chart.yaml @@ -14,7 +14,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.5 +version: 0.3.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/charts/typesense-operator/README.md b/charts/typesense-operator/README.md index c46bd4d..9483f30 100644 --- a/charts/typesense-operator/README.md +++ b/charts/typesense-operator/README.md @@ -18,6 +18,29 @@ helm repo update helm upgrade --install typesense-operator tyko/typesense-operator -n typesense-system --create-namespace ``` +## 🏗️ High Availability + +Deploy with multiple replicas and pod anti-affinity: + +```yaml +# values.yaml +controllerManager: + replicas: 2 + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: control-plane + operator: In + values: [controller-manager] + topologyKey: kubernetes.io/hostname +``` + +For more options, see [Kubernetes Pod Scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). + +``` +
Quick example for Open Telekom Cloud CCE diff --git a/charts/typesense-operator/templates/deployment.yaml b/charts/typesense-operator/templates/deployment.yaml index ac505f2..c360ef1 100644 --- a/charts/typesense-operator/templates/deployment.yaml +++ b/charts/typesense-operator/templates/deployment.yaml @@ -50,4 +50,13 @@ spec: securityContext: {{- toYaml .Values.controllerManager.podSecurityContext | nindent 8 }} serviceAccountName: {{ include "typesense-operator.fullname" . }}-controller-manager + {{- with .Values.controllerManager.affinity }} + affinity: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.controllerManager.nodeSelector }} + nodeSelector: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.controllerManager.tolerations }} + tolerations: {{- toYaml . | nindent 8 }} + {{- end }} terminationGracePeriodSeconds: 10 \ No newline at end of file diff --git a/charts/typesense-operator/values.yaml b/charts/typesense-operator/values.yaml index a3b18c4..33b06b4 100644 --- a/charts/typesense-operator/values.yaml +++ b/charts/typesense-operator/values.yaml @@ -24,6 +24,9 @@ controllerManager: podSecurityContext: runAsNonRoot: true replicas: 1 + affinity: {} + nodeSelector: {} + tolerations: [] serviceAccount: annotations: {} imagePullSecrets: []