UNCLASSIFIED

Commit b061249b authored by Kavitha Thulasiraman's avatar Kavitha Thulasiraman
Browse files

add affinity

parent b5920ac1
...@@ -74,6 +74,15 @@ spec: ...@@ -74,6 +74,15 @@ spec:
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
containers: containers:
- name: twistlock-console - name: twistlock-console
image: {{ .Values.console.image.repository }}:{{ .Values.console.image.tag }} image: {{ .Values.console.image.repository }}:{{ .Values.console.image.tag }}
......
...@@ -27,3 +27,6 @@ console: ...@@ -27,3 +27,6 @@ console:
persistence: persistence:
size: 100Gi size: 100Gi
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
nodeSelector: {}
affinity: {}
# Affinity
* [kubernetes affinity ](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
Pod constraints for istio operator is implemented following the kubernetes affinity documentation. Istio Operator can constraint a pod using nodeSelector or Affinity/Antti-affinity feature
## nodeSelector
in the values.yaml add nodeSelector like:
```
nodeSelector:
<key>: <values>
```
## nodeAffinity
in the values of yaml. add nodeaffinity like:
```
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/e2e-az-name
operator: In
values:
- e2e-az1
- e2e-az2
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: another-node-label-key
operator: In
values:
- another-node-label-value
```
## podAffinity
in the values.yaml add pod affinity/antiaffinity like:
```
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S1
topologyKey: topology.kubernetes.io/zone
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S2
topologyKey: topology.kubernetes.io/zone
```
...@@ -2,7 +2,7 @@ istio: ...@@ -2,7 +2,7 @@ istio:
enabled: true enabled: true
imagePullSecrets: imagePullSecrets:
- name: private-registry-mil - name: private-registry
console: console:
persistence: persistence:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment