From c5ffa90e7393fb7013088c3760aad25c265657a5 Mon Sep 17 00:00:00 2001 From: groundhog2k <10630407+groundhog2k@users.noreply.github.com> Date: Fri, 7 May 2021 08:26:36 +0200 Subject: [PATCH] Added PodDisruptionBudget to scalabale charts and minor configuration fixes (#407) * Add support for PodDisruptionBudget to all scalable charts Fixes #386 * Add support for PodDisruptionBudget to all scalable charts Fixes #386 * Add support for PodDisruptionBudget to all scalable charts Fixes #386 --- charts/elasticsearch/Chart.yaml | 2 +- charts/elasticsearch/README.md | 4 ++-- .../elasticsearch/templates/statefulset.yaml | 5 ++++- charts/elasticsearch/values.yaml | 7 ++++-- charts/graylog/Chart.yaml | 2 +- charts/graylog/README.md | 6 ++++- charts/graylog/templates/pdp.yaml | 22 +++++++++++++++++++ charts/graylog/templates/statefulset.yaml | 3 +++ charts/graylog/values.yaml | 16 +++++++++++++- charts/mariadb/Chart.yaml | 2 +- charts/mariadb/README.md | 5 ++++- charts/mariadb/templates/statefulset.yaml | 6 +++++ charts/mariadb/values.yaml | 9 ++++++++ charts/metrics-server/Chart.yaml | 2 +- charts/metrics-server/README.md | 2 +- charts/metrics-server/templates/pdb.yaml | 8 +++---- charts/mongodb/Chart.yaml | 2 +- charts/mongodb/README.md | 4 ++-- charts/mongodb/templates/statefulset.yaml | 5 ++++- charts/mongodb/values.yaml | 8 +++++-- charts/postgres/Chart.yaml | 2 +- charts/postgres/README.md | 5 ++++- charts/postgres/templates/statefulset.yaml | 7 ++++++ charts/postgres/values.yaml | 9 ++++++++ charts/rabbitmq/Chart.yaml | 2 +- charts/rabbitmq/README.md | 9 ++++++-- charts/rabbitmq/templates/pdp.yaml | 22 +++++++++++++++++++ charts/rabbitmq/templates/serviceaccount.yaml | 9 ++++++-- charts/rabbitmq/templates/statefulset.yaml | 5 ++++- charts/rabbitmq/values.yaml | 18 +++++++++++++-- charts/redis/Chart.yaml | 2 +- charts/redis/README.md | 6 ++++- charts/redis/templates/pdp.yaml | 22 +++++++++++++++++++ charts/redis/templates/statefulset.yaml | 3 +++ charts/redis/values.yaml | 10 +++++++++ 35 files changed, 216 insertions(+), 35 deletions(-) create mode 100644 charts/graylog/templates/pdp.yaml create mode 100644 charts/rabbitmq/templates/pdp.yaml create mode 100644 charts/redis/templates/pdp.yaml diff --git a/charts/elasticsearch/Chart.yaml b/charts/elasticsearch/Chart.yaml index e2a386d2..27ff6543 100644 --- a/charts/elasticsearch/Chart.yaml +++ b/charts/elasticsearch/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.1.102 +version: 0.1.103 appVersion: 7.10.2 diff --git a/charts/elasticsearch/README.md b/charts/elasticsearch/README.md index bc10688e..6da3c54a 100644 --- a/charts/elasticsearch/README.md +++ b/charts/elasticsearch/README.md @@ -1,6 +1,6 @@ # Elasticsearch -   +   A Helm chart for Elasticsearch on Kubernetes @@ -76,7 +76,7 @@ $ helm uninstall my-release | tolerations | list | `[]` | Pod tolerations | | podManagementPolicy | string | `OrderedReady` | Pod management policy | | updateStrategyType | string | `RollingUpdate` | Update strategy | -| replicaCount | int | `1` | Number of replicas (Not supported - Don't change in this chart version) | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history ## Service paramters diff --git a/charts/elasticsearch/templates/statefulset.yaml b/charts/elasticsearch/templates/statefulset.yaml index 3da552f0..e394638c 100644 --- a/charts/elasticsearch/templates/statefulset.yaml +++ b/charts/elasticsearch/templates/statefulset.yaml @@ -7,7 +7,10 @@ metadata: spec: serviceName: {{ include "elasticsearch.fullname" . }}-internal podManagementPolicy: {{ .Values.podManagementPolicy }} - replicas: {{ .Values.replicaCount }} + replicas: 1 + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} updateStrategy: type: {{ .Values.updateStrategyType }} selector: diff --git a/charts/elasticsearch/values.yaml b/charts/elasticsearch/values.yaml index de69c462..1c137cdc 100644 --- a/charts/elasticsearch/values.yaml +++ b/charts/elasticsearch/values.yaml @@ -21,10 +21,11 @@ serviceAccount: podAnnotations: {} -## Management policy, update strategy and number of replicas +## Pod management policy podManagementPolicy: OrderedReady + +## Pod update strategy updateStrategyType: RollingUpdate -replicaCount: 1 podSecurityContext: fsGroup: 1000 @@ -88,6 +89,8 @@ tolerations: [] affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {} diff --git a/charts/graylog/Chart.yaml b/charts/graylog/Chart.yaml index 3dc78915..2ee12f8f 100644 --- a/charts/graylog/Chart.yaml +++ b/charts/graylog/Chart.yaml @@ -7,7 +7,7 @@ type: application maintainers: - name: groundhog2k -version: 0.1.16 +version: 0.1.17 appVersion: "4.0.6" diff --git a/charts/graylog/README.md b/charts/graylog/README.md index afbc4774..71ebaff9 100644 --- a/charts/graylog/README.md +++ b/charts/graylog/README.md @@ -1,6 +1,6 @@ # Graylog -   +   A Helm chart for Graylog on Kubernetes @@ -81,6 +81,10 @@ $ helm uninstall my-release | podManagementPolicy | string | `OrderedReady` | Pod management policy | | updateStrategyType | string | `RollingUpdate` | Update strategy | | replicaCount | int | `1` | Number of replicas (Not supported - Don't change in this chart version) | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history +| podDisruptionBudget | object | `{}` | Pod disruption budget | +| podDisruptionBudget.minAvailable | int | `nil` | Minimum number of pods that must be available after eviction | +| podDisruptionBudget.maxUnavailable | int | `nil` | Maximum number of pods that can be unavailable after eviction | ## Service paramters diff --git a/charts/graylog/templates/pdp.yaml b/charts/graylog/templates/pdp.yaml new file mode 100644 index 00000000..cfc40797 --- /dev/null +++ b/charts/graylog/templates/pdp.yaml @@ -0,0 +1,22 @@ +{{- if and (.Values.podDisruptionBudget) (or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable) }} +{{- if semverCompare ">=1.21" .Capabilities.KubeVersion.Version }} +apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 +{{- end }} +kind: PodDisruptionBudget +metadata: + name: {{ include "graylog.fullname" . }} + labels: + {{- include "graylog.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "graylog.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/graylog/templates/statefulset.yaml b/charts/graylog/templates/statefulset.yaml index 27d5aca3..cab07dce 100644 --- a/charts/graylog/templates/statefulset.yaml +++ b/charts/graylog/templates/statefulset.yaml @@ -11,6 +11,9 @@ spec: serviceName: {{ include "graylog.fullname" . }}-internal podManagementPolicy: {{ .Values.podManagementPolicy }} replicas: {{ .Values.replicaCount }} + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} updateStrategy: type: {{ .Values.updateStrategyType }} template: diff --git a/charts/graylog/values.yaml b/charts/graylog/values.yaml index 8ed86777..55a898b1 100644 --- a/charts/graylog/values.yaml +++ b/charts/graylog/values.yaml @@ -29,9 +29,13 @@ serviceAccount: podAnnotations: {} -## Management policy, update strategy and number of replicas +## Pod management policy podManagementPolicy: OrderedReady + +## Pod update strategy updateStrategyType: RollingUpdate + +## Number of replicas replicaCount: 1 ## Pod security options (default: Graylog as fsGroup) @@ -113,6 +117,16 @@ tolerations: [] affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: + +## Pod disruption budget +podDisruptionBudget: {} + ## Minimum number of pods that must be available after eviction + # minAvailable: + ## Maximum number of pods that can be unavailable after eviction + # maxUnavailable: + ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {} diff --git a/charts/mariadb/Chart.yaml b/charts/mariadb/Chart.yaml index 7c9b1211..f8a3bb15 100644 --- a/charts/mariadb/Chart.yaml +++ b/charts/mariadb/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.2.10 +version: 0.2.11 appVersion: "10.5.9" diff --git a/charts/mariadb/README.md b/charts/mariadb/README.md index 31fb80aa..18f1d187 100644 --- a/charts/mariadb/README.md +++ b/charts/mariadb/README.md @@ -1,6 +1,6 @@ # MariaDB -   +   A Helm chart for MariaDB on Kubernetes @@ -69,6 +69,9 @@ $ helm uninstall my-release | serviceAccount.name | string | `""` | Name of the service account | | affinity | object | `{}` | Affinity for pod assignment | | tolerations | list | `[]` | Tolerations for pod assignment | +| podManagementPolicy | string | `"OrderedReady"` | Pod management policy | +| updateStrategyType | string | `"RollingUpdate"` | Pod update strategy | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history ## Service paramters diff --git a/charts/mariadb/templates/statefulset.yaml b/charts/mariadb/templates/statefulset.yaml index f0a6d069..e46ee5dd 100644 --- a/charts/mariadb/templates/statefulset.yaml +++ b/charts/mariadb/templates/statefulset.yaml @@ -6,7 +6,13 @@ metadata: {{- include "mariadb.labels" . | nindent 4 }} spec: replicas: 1 + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} serviceName: {{ include "mariadb.fullname" . }} + podManagementPolicy: {{ .Values.podManagementPolicy }} + updateStrategy: + type: {{ .Values.updateStrategyType }} selector: matchLabels: {{- include "mariadb.selectorLabels" . | nindent 6 }} diff --git a/charts/mariadb/values.yaml b/charts/mariadb/values.yaml index c983ad53..a36f0c09 100644 --- a/charts/mariadb/values.yaml +++ b/charts/mariadb/values.yaml @@ -28,6 +28,12 @@ nodeSelector: {} ## Additional pod annotations podAnnotations: {} +## Pod management policy +podManagementPolicy: OrderedReady + +## Pod update strategy +updateStrategyType: RollingUpdate + ## Pod security options podSecurityContext: fsGroup: 999 @@ -65,6 +71,9 @@ tolerations: [] affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: + ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {} diff --git a/charts/metrics-server/Chart.yaml b/charts/metrics-server/Chart.yaml index 66c7e1f3..a0055417 100644 --- a/charts/metrics-server/Chart.yaml +++ b/charts/metrics-server/Chart.yaml @@ -7,7 +7,7 @@ type: application maintainers: - name: groundhog2k -version: 2.12.6 +version: 2.12.7 appVersion: "v0.4.4" diff --git a/charts/metrics-server/README.md b/charts/metrics-server/README.md index 79ba4e14..b147e89a 100644 --- a/charts/metrics-server/README.md +++ b/charts/metrics-server/README.md @@ -1,6 +1,6 @@ # metrics-server -   +   [Metrics Server](https://github.com/kubernetes-incubator/metrics-server) is a cluster-wide aggregator of resource usage data. Resource metrics are used by components like `kubectl top` and the [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale) to scale workloads. To autoscale based upon a custom metric, see the [Prometheus Adapter chart](https://github.com/helm/charts/blob/master/stable/prometheus-adapter). diff --git a/charts/metrics-server/templates/pdb.yaml b/charts/metrics-server/templates/pdb.yaml index 0ebe5bf1..79c36e93 100644 --- a/charts/metrics-server/templates/pdb.yaml +++ b/charts/metrics-server/templates/pdb.yaml @@ -1,7 +1,7 @@ -{{- if .Values.podDisruptionBudget.enabled -}} -{{- if semverCompare ">=1.21" .Capabilities.KubeVersion.Version -}} +{{- if .Values.podDisruptionBudget.enabled }} +{{- if semverCompare ">=1.21" .Capabilities.KubeVersion.Version }} apiVersion: policy/v1 -{{- else -}} +{{- else }} apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget @@ -23,4 +23,4 @@ spec: selector: matchLabels: app: {{ template "metrics-server.name" . }} -{{- end -}} +{{- end }} diff --git a/charts/mongodb/Chart.yaml b/charts/mongodb/Chart.yaml index 1523e113..73395f78 100644 --- a/charts/mongodb/Chart.yaml +++ b/charts/mongodb/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.2.11 +version: 0.2.12 appVersion: "4.2.13" diff --git a/charts/mongodb/README.md b/charts/mongodb/README.md index 3542d1a8..3d09b961 100644 --- a/charts/mongodb/README.md +++ b/charts/mongodb/README.md @@ -1,6 +1,6 @@ # MongoDB -   +   A Helm chart for MongoDB on Kubernetes @@ -72,7 +72,7 @@ $ helm uninstall my-release | tolerations | list | `[]` | Pod tolerations | | podManagementPolicy | string | `OrderedReady` | Pod management policy | | updateStrategyType | string | `RollingUpdate` | Update strategy | -| replicaCount | int | `1` | Number of replicas (Not supported - Don't change in this chart version) | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history ## Service paramters diff --git a/charts/mongodb/templates/statefulset.yaml b/charts/mongodb/templates/statefulset.yaml index 981134b6..85ecbb6b 100644 --- a/charts/mongodb/templates/statefulset.yaml +++ b/charts/mongodb/templates/statefulset.yaml @@ -10,7 +10,10 @@ spec: {{- include "mongodb.selectorLabels" . | nindent 6 }} serviceName: {{ include "mongodb.fullname" . }}-internal podManagementPolicy: {{ .Values.podManagementPolicy }} - replicas: {{ .Values.replicaCount }} + replicas: 1 + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} updateStrategy: type: {{ .Values.updateStrategyType }} template: diff --git a/charts/mongodb/values.yaml b/charts/mongodb/values.yaml index 926d2204..91919943 100644 --- a/charts/mongodb/values.yaml +++ b/charts/mongodb/values.yaml @@ -28,10 +28,11 @@ podAnnotations: {} podSecurityContext: fsGroup: 999 -## Don't touch - no other options supported in this chart version +## Pod management policy podManagementPolicy: OrderedReady + +## Pod update strategy updateStrategyType: RollingUpdate -replicaCount: 1 ## Default security options to run Redis as non-root, read only container without privilege escalation securityContext: @@ -94,6 +95,9 @@ tolerations: [] ## Pod affinity affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: + ## Additional arguments for the container entrypoint process args: [] diff --git a/charts/postgres/Chart.yaml b/charts/postgres/Chart.yaml index 4e2beb51..d1b6b705 100644 --- a/charts/postgres/Chart.yaml +++ b/charts/postgres/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.2.9 +version: 0.2.10 appVersion: "13.2" diff --git a/charts/postgres/README.md b/charts/postgres/README.md index 89abedc8..c6ae2657 100644 --- a/charts/postgres/README.md +++ b/charts/postgres/README.md @@ -1,6 +1,6 @@ # PostgreSQL -   +   A Helm chart for PostgreSQL on Kubernetes @@ -71,6 +71,9 @@ $ helm uninstall my-release | serviceAccount.name | string | `""` | Name of the service account | | affinity | object | `{}` | | | tolerations | list | `[]` | | +| podManagementPolicy | string | `"OrderedReady"` | Pod management policy | +| updateStrategyType | string | `"RollingUpdate"` | Pod update strategy | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history ## Service paramters diff --git a/charts/postgres/templates/statefulset.yaml b/charts/postgres/templates/statefulset.yaml index 9f6a2028..30b2a6ad 100644 --- a/charts/postgres/templates/statefulset.yaml +++ b/charts/postgres/templates/statefulset.yaml @@ -6,7 +6,14 @@ metadata: {{- include "postgres.labels" . | nindent 4 }} spec: replicas: 1 + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} serviceName: {{ include "postgres.fullname" . }} + podManagementPolicy: {{ .Values.podManagementPolicy }} + updateStrategy: + type: {{ .Values.updateStrategyType }} + selector: selector: matchLabels: {{- include "postgres.selectorLabels" . | nindent 6 }} diff --git a/charts/postgres/values.yaml b/charts/postgres/values.yaml index 35e2b931..66f8abd7 100644 --- a/charts/postgres/values.yaml +++ b/charts/postgres/values.yaml @@ -25,6 +25,12 @@ serviceAccount: ## Additional pod annotations podAnnotations: {} +## Pod management policy +podManagementPolicy: OrderedReady + +## Pod update strategy +updateStrategyType: RollingUpdate + ## Pod security context uses file system group 999 (postgres) podSecurityContext: fsGroup: 999 @@ -64,6 +70,9 @@ tolerations: [] affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: + ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {} diff --git a/charts/rabbitmq/Chart.yaml b/charts/rabbitmq/Chart.yaml index ec14ad39..076a4e31 100644 --- a/charts/rabbitmq/Chart.yaml +++ b/charts/rabbitmq/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.2.15 +version: 0.2.16 appVersion: "3.8.15" diff --git a/charts/rabbitmq/README.md b/charts/rabbitmq/README.md index 8836817b..58424e10 100644 --- a/charts/rabbitmq/README.md +++ b/charts/rabbitmq/README.md @@ -1,6 +1,6 @@ # RabbitMQ -   +   A Helm chart for a RabbitMQ cluster on Kubernetes @@ -66,13 +66,18 @@ $ helm uninstall my-release | env | list | `[]` | Additional container environmment variables | | args | list | `[]` | Additional container command arguments | | rbac.create | bool | `true` | Enable creation of RBAC | -| serviceAccount.create | bool | `false` | Enable service account creation | +| serviceAccount.annotations | object | `{}` | Additional service account annotations | +| serviceAccount.create | bool | `true` | Enable service account creation | | serviceAccount.name | string | `""` | Optional name of the service account | | affinity | object | `{}` | Affinity for pod assignment | | tolerations | list | `[]` | Tolerations for pod assignment | | podManagementPolicy | string | `"OrderedReady"` | Pod management policy | | updateStrategyType | string | `"RollingUpdate"` | Pod update strategy | | replicaCount | int | `1` | Number of replicas | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history +| podDisruptionBudget | object | `{}` | Pod disruption budget | +| podDisruptionBudget.minAvailable | int | `nil` | Minimum number of pods that must be available after eviction | +| podDisruptionBudget.maxUnavailable | int | `nil` | Maximum number of pods that can be unavailable after eviction | ## Service paramters diff --git a/charts/rabbitmq/templates/pdp.yaml b/charts/rabbitmq/templates/pdp.yaml new file mode 100644 index 00000000..c5c2f0ad --- /dev/null +++ b/charts/rabbitmq/templates/pdp.yaml @@ -0,0 +1,22 @@ +{{- if and (.Values.podDisruptionBudget) (or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable) }} +{{- if semverCompare ">=1.21" .Capabilities.KubeVersion.Version }} +apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 +{{- end }} +kind: PodDisruptionBudget +metadata: + name: {{ include "rabbitmq.fullname" . }} + labels: + {{- include "rabbitmq.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "rabbitmq.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/rabbitmq/templates/serviceaccount.yaml b/charts/rabbitmq/templates/serviceaccount.yaml index ac0df972..e33e46ba 100644 --- a/charts/rabbitmq/templates/serviceaccount.yaml +++ b/charts/rabbitmq/templates/serviceaccount.yaml @@ -3,7 +3,12 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "rabbitmq.serviceAccountName" . }} - labels: {{- include "rabbitmq.labels" . | nindent 4 }} + labels: + {{- include "rabbitmq.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} secrets: - name: {{ include "rabbitmq.fullname" . }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/rabbitmq/templates/statefulset.yaml b/charts/rabbitmq/templates/statefulset.yaml index df001b72..3d2afea3 100644 --- a/charts/rabbitmq/templates/statefulset.yaml +++ b/charts/rabbitmq/templates/statefulset.yaml @@ -11,7 +11,10 @@ spec: serviceName: {{ include "rabbitmq.fullname" . }}-internal podManagementPolicy: {{ .Values.podManagementPolicy }} replicas: {{ .Values.replicaCount }} - updateStrategy: + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} + updateStrategy: type: {{ .Values.updateStrategyType }} template: metadata: diff --git a/charts/rabbitmq/values.yaml b/charts/rabbitmq/values.yaml index b499d0fd..00b4c265 100644 --- a/charts/rabbitmq/values.yaml +++ b/charts/rabbitmq/values.yaml @@ -28,8 +28,10 @@ podAnnotations: {} podSecurityContext: fsGroup: 999 +## Pod management policy podManagementPolicy: OrderedReady +## Pod update strategy updateStrategyType: RollingUpdate ## Default security options to run RabbitMq as read only container without privilege escalation @@ -93,6 +95,16 @@ nodeSelector: {} tolerations: [] affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: + +## Pod disruption budget +podDisruptionBudget: {} + ## Minimum number of pods that must be available after eviction + # minAvailable: + ## Maximum number of pods that can be unavailable after eviction + # maxUnavailable: + ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {} @@ -120,8 +132,10 @@ readinessProbe: ## Service account (necessary in cluster mode) serviceAccount: create: true - ## The name of the ServiceAccount to use. (If not set and create is true, a name is generated using the rabbitmq.fullname template) - # name: + # Annotations to add to the service account + annotations: {} + # The name of the ServiceAccount to use. (If not set and create is true, a name is generated using the rabbitmq.fullname template) + name: "" ## Create RBAC (necessary in cluster mode) rbac: diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml index 9d1637bd..bc34388a 100644 --- a/charts/redis/Chart.yaml +++ b/charts/redis/Chart.yaml @@ -8,7 +8,7 @@ maintainers: - name: groundhog2k # This is the chart version -version: 0.4.3 +version: 0.4.4 # This is the version number of the application being deployed. appVersion: "6.2.3" diff --git a/charts/redis/README.md b/charts/redis/README.md index 1dd2dc0d..05db9825 100644 --- a/charts/redis/README.md +++ b/charts/redis/README.md @@ -1,6 +1,6 @@ # Redis -   +   A Helm chart for Redis on Kubernetes @@ -107,6 +107,10 @@ $ helm uninstall my-release | tolerations | list | `[]` | Tolerations for pod assignment | | podManagementPolicy | string | `"OrderedReady"` | Pod management policy | | updateStrategyType | string | `"RollingUpdate"` | Pod update strategy | +| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history +| podDisruptionBudget | object | `{}` | Pod disruption budget | +| podDisruptionBudget.minAvailable | int | `nil` | Minimum number of pods that must be available after eviction | +| podDisruptionBudget.maxUnavailable | int | `nil` | Maximum number of pods that can be unavailable after eviction | ## Service paramters diff --git a/charts/redis/templates/pdp.yaml b/charts/redis/templates/pdp.yaml new file mode 100644 index 00000000..bec0d88c --- /dev/null +++ b/charts/redis/templates/pdp.yaml @@ -0,0 +1,22 @@ +{{- if and (.Values.podDisruptionBudget) (or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable) }} +{{- if semverCompare ">=1.21" .Capabilities.KubeVersion.Version }} +apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 +{{- end }} +kind: PodDisruptionBudget +metadata: + name: {{ include "redis.fullname" . }} + labels: + {{- include "redis.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "redis.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/redis/templates/statefulset.yaml b/charts/redis/templates/statefulset.yaml index bb5dcd02..b080d16e 100644 --- a/charts/redis/templates/statefulset.yaml +++ b/charts/redis/templates/statefulset.yaml @@ -10,6 +10,9 @@ spec: {{- else }} replicas: 1 {{- end }} + {{- if .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} serviceName: {{ include "redis.fullname" . }} podManagementPolicy: {{ .Values.podManagementPolicy }} updateStrategy: diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index 70bc1ecb..985ccdce 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -84,6 +84,16 @@ tolerations: [] affinity: {} +## Maximum number of revisions maintained in revision history +revisionHistoryLimit: + +## Pod disruption budget +podDisruptionBudget: {} + ## Minimum number of pods that must be available after eviction + # minAvailable: + ## Maximum number of pods that can be unavailable after eviction + # maxUnavailable: + ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {} -- GitLab