Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/rabbitmq-ha] Add support for additional pod affinity settings. (
Browse files Browse the repository at this point in the history
#20391)

* [stable/rabbitmq-ha] Add support for additional pod affinity settings.

Signed-off-by: l.h. riley <liam.h.riley@gmail.com>

* [stable/rabbitmq-ha] affinity overrides default podAntiAffinity settings.

Signed-off-by: l.h. riley <liam.h.riley@gmail.com>
  • Loading branch information
lhriley committed Feb 18, 2020
1 parent 04796e4 commit ca058a2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable/rabbitmq-ha/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: rabbitmq-ha
apiVersion: v1
appVersion: 3.8.0
version: 1.38.2
version: 1.39.0
description: Highly available RabbitMQ cluster, the open source message broker
software that implements the Advanced Message Queuing Protocol (AMQP).
keywords:
Expand Down
5 changes: 3 additions & 2 deletions stable/rabbitmq-ha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ and their default values.
| `persistentVolume.name` | Persistent volume name | `data` |
| `persistentVolume.size` | Persistent volume size | `8Gi` |
| `persistentVolume.storageClass` | Persistent volume storage class | `-` |
| `podAntiAffinity` | Pod antiaffinity, `hard` or `soft` | `soft` |
| `podAntiAffinityTopologyKey` | TopologyKey for antiaffinity, default is hostname
| `podAntiAffinity` | Pod anti-affinity, `hard` or `soft` | `soft` |
| `podAntiAffinityTopologyKey` | TopologyKey for anti-affinity, default is hostname | `"kubernetes.io/hostname"` |
| `affinity` | Affinity settings. If specified, this will disable `podAntiAffinity` settings. If you still need anti-affinity, you must include the configuration here. | `{}` |
| `podDisruptionBudget` | Pod Disruption Budget rules | `{}` |
| `podManagementPolicy` | Whether the pods should be restarted in parallel or one at a time. Either `OrderedReady` or `Parallel`. | `OrderedReady` |
| `prometheus.exporter.enabled` | Configures Prometheus Exporter to expose and scrape stats | `false` |
Expand Down
8 changes: 8 additions & 0 deletions stable/rabbitmq-ha/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ spec:
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
{{- end }}
{{- if .Values.affinity }}
affinity:
{{- with .Values.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- else }}
{{- if eq .Values.podAntiAffinity "hard" }}
affinity:
podAntiAffinity:
Expand All @@ -285,6 +291,8 @@ spec:
app: {{ template "rabbitmq-ha.name" . }}
release: {{ .Release.Name }}
{{- end }}
{{- end }}

{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions stable/rabbitmq-ha/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ statefulSetAnnotations: {}
podAntiAffinity: soft
podAntiAffinityTopologyKey: "kubernetes.io/hostname"

## Affinity settings
## Defining 'affinity' will disable any podAntiAffinity settings.
## If you still need anti-affinity, you must include the configuration here.
##
affinity: {}

## Create default configMap
##
existingConfigMap: false
Expand Down

0 comments on commit ca058a2

Please sign in to comment.