Skip to content

Commit 661f6b8

Browse files
Romain JACQUETrjacquet31
authored andcommitted
wip: move to the mongodb operator
use podantiaffinity to spread mongo pods over the cluster nodes
1 parent 0b86799 commit 661f6b8

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

charts/mongodb-operated/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type: application
88
# This is the chart version. This version number should be incremented each time you make changes
99
# to the chart and its templates, including the app version.
1010
# Versions are expected to follow Semantic Versioning (https://semver.org/)
11-
version: 0.2.0
11+
version: 0.2.1
1212

1313
# This is the version number of the application being deployed. This version number should be
1414
# incremented each time you make changes to the application. Versions are not expected to

charts/mongodb-operated/templates/mongdb-community.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ spec:
2222
imagePullSecrets:
2323
{{- toYaml . | nindent 12 }}
2424
{{- end }}
25+
{{- with .Values.affinity }}
26+
affinity:
27+
{{- toYaml . | nindent 12 }}
28+
{{- end }}
2529
containers:
2630
- name: mongod
2731
imagePullPolicy: {{ .Values.image.pullPolicy }}

charts/mongodb-operated/values.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ image:
2222
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
2323
imagePullSecrets: []
2424

25+
# could be used to have one replica per node
26+
# https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
27+
affinity: {}
28+
# podAntiAffinity:
29+
# preferredDuringSchedulingIgnoredDuringExecution:
30+
# - weigth: 100
31+
# podAffinityTerm:
32+
# labelSelector:
33+
# matchExpressions:
34+
# - key: app
35+
# operator: In
36+
# values:
37+
# - appsdb-mongodb-operated-svc
38+
# topologyKey: "kubernetes.io/hostname"
2539

2640
# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
2741
# workaround for https://github.com/mongodb/mongodb-kubernetes/issues/489

0 commit comments

Comments
 (0)