6
6
# Example values.yaml:
7
7
# resources:
8
8
# %{camelName}:
9
- # replicas: 2 # Note: 2 replicas will also add a small third tiebreaker node
9
+ # # Instead of using just a number to specify the number of replicas, we use
10
+ # # a list of names. This allows controlling exactly which replica gets shut down
11
+ # # when scaling down, which is useful when eg. decommissioning a node.
12
+ # # Note: 2 replicas will also add a small third tiebreaker node
13
+ # namedReplicas:
14
+ # - replica1
15
+ # - replica2
10
16
# memory: 1Gi # Provide at least 1Gi of RAM to avoid OOM kills
11
17
# cpu: 1
12
18
# disk: 10Gi
37
43
elasticsearchRefs :
38
44
- name : {{ .Chart.Name }}%{suffix}
39
45
nodeSets :
40
- - name : default
41
- count : {{ .Values.resources.%{camelName}.replicas }}
46
+ {{ range $replica := .Values.resources.%{camelName}.namedReplicas }}
47
+ - name : {{ $replica }}
48
+ count : 1
42
49
config :
43
50
node.store.allow_mmap : true # disable this if you haven't increased vm.max_map_count
44
51
podTemplate :
@@ -53,11 +60,11 @@ spec:
53
60
- name : elasticsearch
54
61
resources :
55
62
requests :
56
- memory : {{ .Values.resources.%{camelName}.memory }}
57
- cpu : {{ .Values.resources.%{camelName}.cpu }}
63
+ memory : {{ $ .Values.resources.%{camelName}.memory }}
64
+ cpu : {{ $ .Values.resources.%{camelName}.cpu }}
58
65
limits :
59
- memory : {{ .Values.resources.%{camelName}.memory }}
60
- cpu : {{ .Values.resources.%{camelName}.cpu }}
66
+ memory : {{ $ .Values.resources.%{camelName}.memory }}
67
+ cpu : {{ $ .Values.resources.%{camelName}.cpu }}
61
68
tolerations :
62
69
- key : role
63
70
value : database
@@ -72,12 +79,13 @@ spec:
72
79
- ReadWriteOnce
73
80
resources :
74
81
requests :
75
- storage : {{ .Values.resources.%{camelName}.disk }}
76
- {{- if eq (int .Values.resources.%{camelName}.replicas) 2 }}
82
+ storage : {{ $.Values.resources.%{camelName}.disk }}
83
+ {{ end }}
84
+ {{- if eq (len .Values.resources.%{camelName}.namedReplicas) 2 }}
77
85
- name : tiebreaker
78
86
count : 1
79
87
config :
80
- node.roles : [master, voting_only]
88
+ node.roles : [master, voting_only, remote_cluster_client ]
81
89
podTemplate :
82
90
spec :
83
91
initContainers :
0 commit comments