forked from istio/istio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update nodeSelector to affinity for chart to customize pod scheduling…
… arch preference (istio#3856) Automatic merge from submit-queue. update nodeSelector to affinity for chart to customize pod scheduling arch preference Replace `nodeSelector` with node `affinity` for `nodeSelector` will be deprecated: > nodeSelector continues to work as usual, but will eventually be deprecated, as node affinity can express everything that nodeSelector can express. With the power of `affinity`, users can customized arch preference based on their requirements. When install `Istio` chart, specify pod scheduling arch(amd64, ppc64le, s390x) preference and weight as follows: - 0(Never scheduled) - 1(Least preferred) - 2(No preference) - 3(Most preferred) default value: ``` arch: amd64: 2 s390x: 2 ppc64le: 2 ```
- Loading branch information
1 parent
391a510
commit 33075b8
Showing
11 changed files
with
64 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{/* affinity - https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ */}} | ||
|
||
{{- define "nodeaffinity" }} | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
{{- include "nodeAffinityRequiredDuringScheduling" . }} | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
{{- include "nodeAffinityPreferredDuringScheduling" . }} | ||
{{- end }} | ||
|
||
{{- define "nodeAffinityRequiredDuringScheduling" }} | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: beta.kubernetes.io/arch | ||
operator: In | ||
values: | ||
{{- range $key, $val := .Values.global.arch }} | ||
{{- if gt ($val | int) 0 }} | ||
- {{ $key }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "nodeAffinityPreferredDuringScheduling" }} | ||
{{- range $key, $val := .Values.global.arch }} | ||
{{- if gt ($val | int) 0 }} | ||
- weight: {{ $val | int }} | ||
preference: | ||
matchExpressions: | ||
- key: beta.kubernetes.io/arch | ||
operator: In | ||
values: | ||
- {{ $key }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters