Skip to content

Commit c3c69fa

Browse files
helm chart improvements
1 parent ba42a56 commit c3c69fa

File tree

3 files changed

+64
-127
lines changed

3 files changed

+64
-127
lines changed

helm/temporal-worker-controller/templates/manager.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
selector:
2121
matchLabels:
2222
{{- include "temporal-worker-controller.selectorLabels" . | nindent 6 }}
23-
replicas: 1
23+
replicas: {{ .Values.replicas }}
2424
template:
2525
metadata:
2626
annotations:
@@ -34,10 +34,9 @@ spec:
3434
{{- toYaml . | nindent 8 }}
3535
{{- end }}
3636
spec:
37-
{{- if .Values.affinity.enabled }}
37+
{{- with .Values.affinity }}
3838
affinity:
39-
{{- toYaml .Values.affinity.podAntiAffinity | nindent 8 }}
40-
{{- toYaml .Values.affinity.nodeAffinity | nindent 8 }}
39+
{{- toYaml . | nindent 8 }}
4140
{{- end }}
4241
securityContext:
4342
runAsNonRoot: true
@@ -124,4 +123,12 @@ spec:
124123
secretName: webhook-server-cert
125124
{{- end }}
126125
serviceAccountName: {{ .Values.serviceAccount.name | default (printf "%s-service-account" .Release.Name) }}
127-
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
126+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
127+
{{- with .Values.nodeSelector }}
128+
nodeSelector:
129+
{{- toYaml . | nindent 8 }}
130+
{{- end }}
131+
{{- with .Values.tolerations }}
132+
tolerations:
133+
{{- toYaml . | nindent 8 }}
134+
{{- end }}

helm/temporal-worker-controller/values.schema.json

Lines changed: 19 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -112,100 +112,9 @@
112112
}
113113
},
114114
"affinity": {
115-
"type": "object",
116-
"properties": {
117-
"enabled": {
118-
"type": "boolean",
119-
"description": "Whether to enable affinity rules"
120-
},
121-
"podAntiAffinity": {
122-
"type": "object",
123-
"properties": {
124-
"preferredDuringSchedulingIgnoredDuringExecution": {
125-
"type": "array",
126-
"items": {
127-
"type": "object",
128-
"properties": {
129-
"weight": {
130-
"type": "integer"
131-
},
132-
"podAffinityTerm": {
133-
"type": "object",
134-
"properties": {
135-
"labelSelector": {
136-
"type": "object",
137-
"properties": {
138-
"matchExpressions": {
139-
"type": "array",
140-
"items": {
141-
"type": "object",
142-
"properties": {
143-
"key": {
144-
"type": "string"
145-
},
146-
"operator": {
147-
"type": "string"
148-
},
149-
"values": {
150-
"type": "array",
151-
"items": {
152-
"type": "string"
153-
}
154-
}
155-
}
156-
}
157-
}
158-
}
159-
},
160-
"topologyKey": {
161-
"type": "string"
162-
}
163-
}
164-
}
165-
}
166-
}
167-
}
168-
}
169-
},
170-
"nodeAffinity": {
171-
"type": "object",
172-
"properties": {
173-
"requiredDuringSchedulingIgnoredDuringExecution": {
174-
"type": "object",
175-
"properties": {
176-
"nodeSelectorTerms": {
177-
"type": "array",
178-
"items": {
179-
"type": "object",
180-
"properties": {
181-
"matchExpressions": {
182-
"type": "array",
183-
"items": {
184-
"type": "object",
185-
"properties": {
186-
"key": {
187-
"type": "string"
188-
},
189-
"operator": {
190-
"type": "string"
191-
},
192-
"values": {
193-
"type": "array",
194-
"items": {
195-
"type": "string"
196-
}
197-
}
198-
}
199-
}
200-
}
201-
}
202-
}
203-
}
204-
}
205-
}
206-
}
207-
}
208-
}
115+
"default": {},
116+
"description": "A Kubernetes Affinity, if required. For more information, see [Affinity v1 core](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#affinity-v1-core).\n\nFor example:\naffinity:\n nodeAffinity:\n requiredDuringSchedulingIgnoredDuringExecution:\n nodeSelectorTerms:\n - matchExpressions:\n - key: foo.bar.com/role\n operator: In\n values:\n - master",
117+
"type": "object"
209118
},
210119
"authProxy": {
211120
"type": "object",
@@ -289,6 +198,22 @@
289198
"description": "Whether to create the namespace"
290199
}
291200
}
201+
},
202+
"nodeSelector": {
203+
"default": {},
204+
"description": "The nodeSelector on Pods tells Kubernetes to schedule Pods on the nodes with matching labels. For more information, see [Assigning Pods to Nodes](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/).\n\nThis default ensures that Pods are only scheduled to Linux nodes. It prevents Pods being scheduled to Windows nodes in a mixed OS cluster.",
205+
"type": "object"
206+
},
207+
"tolerations": {
208+
"default": [],
209+
"description": "A list of Kubernetes Tolerations, if required. For more information, see [Toleration v1 core](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#toleration-v1-core).\n\nFor example:\ntolerations:\n- key: foo.bar.com/role\n operator: Equal\n value: master\n effect: NoSchedule",
210+
"items": {},
211+
"type": "array"
212+
},
213+
"replicas": {
214+
"default": 1,
215+
"description": "Number of replicas of manager to run.\n\nThe default is 1, but in production set this to 2 or 3 to provide high availability.",
216+
"type": "number"
292217
}
293218
}
294219
}

helm/temporal-worker-controller/values.yaml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,34 +53,33 @@ securityContext:
5353
# Configure the nodeAffinity expression according to the platforms which are
5454
# supported by your solution. It is considered best practice to support multiple
5555
# architectures. You can build your manager image using the makefile target docker-buildx.
56-
affinity:
57-
enabled: false
58-
podAntiAffinity:
59-
preferredDuringSchedulingIgnoredDuringExecution:
60-
- weight: 100
61-
podAffinityTerm:
62-
labelSelector:
63-
matchExpressions:
64-
- key: control-plane
65-
operator: In
66-
values:
67-
- controller-manager
68-
topologyKey: kubernetes.io/hostname
69-
nodeAffinity:
70-
requiredDuringSchedulingIgnoredDuringExecution:
71-
nodeSelectorTerms:
72-
- matchExpressions:
73-
- key: kubernetes.io/arch
74-
operator: In
75-
values:
76-
- amd64
77-
- arm64
78-
- ppc64le
79-
- s390x
80-
- key: kubernetes.io/os
81-
operator: In
82-
values:
83-
- linux
56+
affinity: {}
57+
# podAntiAffinity:
58+
# preferredDuringSchedulingIgnoredDuringExecution:
59+
# - weight: 100
60+
# podAffinityTerm:
61+
# labelSelector:
62+
# matchExpressions:
63+
# - key: control-plane
64+
# operator: In
65+
# values:
66+
# - controller-manager
67+
# topologyKey: kubernetes.io/hostname
68+
# nodeAffinity:
69+
# requiredDuringSchedulingIgnoredDuringExecution:
70+
# nodeSelectorTerms:
71+
# - matchExpressions:
72+
# - key: kubernetes.io/arch
73+
# operator: In
74+
# values:
75+
# - amd64
76+
# - arm64
77+
# - ppc64le
78+
# - s390x
79+
# - key: kubernetes.io/os
80+
# operator: In
81+
# values:
82+
# - linux
8483

8584
# Opt out of these resources if you want to disable the
8685
# auth proxy (https://github.com/brancz/kube-rbac-proxy)
@@ -113,3 +112,9 @@ certmanager:
113112
# Not yet supported
114113
prometheus:
115114
enabled: false
115+
116+
nodeSelector: {}
117+
118+
tolerations: []
119+
120+
replicas: 1

0 commit comments

Comments
 (0)