From 5981228f6fbbe56162b192162b6dfdb005e7c9d1 Mon Sep 17 00:00:00 2001 From: zyy17 Date: Tue, 26 Mar 2024 12:04:01 +0800 Subject: [PATCH] refactor: add tolerations and affinity (#120) --- charts/greptimedb-operator/Chart.yaml | 2 +- charts/greptimedb-operator/README.md | 4 +++- .../greptimedb-operator/templates/deployment.yaml | 13 +++++++++++-- charts/greptimedb-operator/values.yaml | 6 ++++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/charts/greptimedb-operator/Chart.yaml b/charts/greptimedb-operator/Chart.yaml index cb3057b..60706ba 100644 --- a/charts/greptimedb-operator/Chart.yaml +++ b/charts/greptimedb-operator/Chart.yaml @@ -3,7 +3,7 @@ kubeVersion: ">=1.18.0-0" description: The greptimedb-operator Helm chart for Kubernetes name: greptimedb-operator appVersion: 0.1.0-alpha.23 -version: 0.1.12 +version: 0.1.13 type: application home: https://github.com/GreptimeTeam/greptimedb-operator sources: diff --git a/charts/greptimedb-operator/README.md b/charts/greptimedb-operator/README.md index f8f878b..c88089c 100644 --- a/charts/greptimedb-operator/README.md +++ b/charts/greptimedb-operator/README.md @@ -2,7 +2,7 @@ The greptimedb-operator Helm chart for Kubernetes -![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0-alpha.23](https://img.shields.io/badge/AppVersion-0.1.0--alpha.23-informational?style=flat-square) +![Version: 0.1.13](https://img.shields.io/badge/Version-0.1.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0-alpha.23](https://img.shields.io/badge/AppVersion-0.1.0--alpha.23-informational?style=flat-square) ## Source Code - https://github.com/GreptimeTeam/greptimedb-operator @@ -40,6 +40,7 @@ Kubernetes: `>=1.18.0-0` | Key | Type | Default | Description | |-----|------|---------|-------------| +| affinity | object | `{}` | The pod affinity | | fullnameOverride | string | `""` | Provide a name to substitute for the full names of resources | | image.imagePullPolicy | string | `"IfNotPresent"` | The image pull policy for the controller | | image.pullSecrets | list | `[]` | The image pull secrets | @@ -54,3 +55,4 @@ Kubernetes: `>=1.18.0-0` | serviceAccount.annotations | object | `{}` | Annotations to add to the service account | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | The pod tolerations | diff --git a/charts/greptimedb-operator/templates/deployment.yaml b/charts/greptimedb-operator/templates/deployment.yaml index 0d0f1e7..bb148b0 100644 --- a/charts/greptimedb-operator/templates/deployment.yaml +++ b/charts/greptimedb-operator/templates/deployment.yaml @@ -25,8 +25,17 @@ spec: {{- end }} serviceAccountName: {{ include "greptimedb-operator.serviceAccountName" . }} terminationGracePeriodSeconds: 10 - {{- if .Values.nodeSelector }} - nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} {{- end }} containers: - name: manager diff --git a/charts/greptimedb-operator/values.yaml b/charts/greptimedb-operator/values.yaml index 6c3585c..20a2941 100644 --- a/charts/greptimedb-operator/values.yaml +++ b/charts/greptimedb-operator/values.yaml @@ -45,3 +45,9 @@ fullnameOverride: "" # -- The operator node selector nodeSelector: {} + +# -- The pod tolerations +tolerations: [] + +# -- The pod affinity +affinity: {}