[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:
Reinhard Nägele
2017-08-07 19:23:15 +02:00
committed by GitHub
parent d9a6aa31cc
commit e002378c13
3 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -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:
+2
View File
@@ -25,6 +25,8 @@ image:
# Annotations to be added to MongoDB pods
podAnnotations: {}
podAntiAffinity: "soft"
resources: {}
# limits:
# cpu: 100m