Skip to content

Commit 7b334f7

Browse files
authored
Fix to check if affinity is enabled (#606)
1 parent 3dc8b73 commit 7b334f7

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,19 @@ If you have dedicated Ingress nodes, label them with
200200
Event Providers on specific nodes, label those nodes with
201201
`openwhisk-role=provider`.
202202

203+
### Disabling affinity (not recommended)
204+
If the Kubernetes cluster does not allow you to assign a label to a node, or you cannot use the affinity attribute, you can disable it.
205+
Please note that it is suitable for testing purposes only and may interfere with the OpenWhisk control plane.
206+
207+
You can disable affinity by editing the `mycluster.yaml` file:
208+
209+
```yaml
210+
affinity:
211+
enabled: false
212+
invoker:
213+
options: "-Dwhisk.kubernetes.user-pod-node-affinity.enabled=false"
214+
```
215+
203216
## Customize the Deployment
204217
205218
You must create a `mycluster.yaml` file to record key aspects of your

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ spec:
5656
{{- end }}
5757
restartPolicy: {{ .Values.invoker.restartPolicy }}
5858

59+
{{- if .Values.affinity.enabled }}
5960
affinity:
6061
{{ include "openwhisk.affinity.invoker" . | indent 8 }}
6162
{{- if eq .Values.invoker.containerFactory.impl "kubernetes" }}
6263
{{ include "openwhisk.affinity.selfAntiAffinity" ( printf "%s-invoker" .Release.Name ) | indent 8 }}
6364
{{- end }}
65+
{{- end }}
6466

6567
{{- if .Values.toleration.enabled }}
6668
tolerations:

helm/openwhisk/templates/user-events-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
spec:
4040
restartPolicy: {{ .Values.user_events.restartPolicy }}
4141

42-
{{- if .Values.metrics.userMetricsEnabled }}
42+
{{- if and .Values.affinity.enabled .Values.metrics.userMetricsEnabled }}
4343
affinity:
4444
{{ include "openwhisk.affinity.core" . | indent 8 }}
4545
{{ include "openwhisk.affinity.selfAntiAffinity" ( printf "%s-user-events" .Release.Name ) | indent 8 }}

0 commit comments

Comments
 (0)