mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/mongodb-replicaset] Add pod anti-affinity (#1606)
Adds pod anti-affinity with "soft" and "hard" option, "soft" being the default.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
name: mongodb-replicaset
|
||||
home: https://github.com/mongodb/mongo
|
||||
version: 1.1.0
|
||||
version: 1.2.0
|
||||
description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications.
|
||||
icon: https://webassets.mongodb.com/_com_assets/cms/mongodb-logo-rgb-j6w271g1xn.jpg
|
||||
sources:
|
||||
|
||||
@@ -160,6 +160,27 @@ spec:
|
||||
mountPath: /keydir
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if eq .Values.podAntiAffinity "hard" }}
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: "kubernetes.io/hostname"
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: "{{ template "name" . }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
{{- else if eq .Values.podAntiAffinity "soft" }}
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
podAffinityTerm:
|
||||
topologyKey: kubernetes.io/hostname
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: "{{ template "name" . }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
|
||||
@@ -25,6 +25,8 @@ image:
|
||||
# Annotations to be added to MongoDB pods
|
||||
podAnnotations: {}
|
||||
|
||||
podAntiAffinity: "soft"
|
||||
|
||||
resources: {}
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
|
||||
Reference in New Issue
Block a user