Skip to content

Commit

Permalink
Merge pull request #53 from phillipsj/feature/annotations-selectors-t…
Browse files Browse the repository at this point in the history
…olerations-chart-updates

Changes required to support mixed workload clusters.
  • Loading branch information
phillipsj authored Feb 18, 2022
2 parents 3f5c5cf + 2e7956b commit 20612fc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/aks-operator-crd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ annotations:
catalog.cattle.io/hidden: "true"
catalog.cattle.io/release-name: rancher-aks-operator-crd
catalog.cattle.io/os: linux
catalog.cattle.io/permits-os: linux,windows

2 changes: 2 additions & 0 deletions charts/aks-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ annotations:
catalog.cattle.io/kube-version: ">= 1.18.0-0"
catalog.cattle.io/namespace: cattle-system
catalog.cattle.io/os: linux
catalog.cattle.io/permits-os: linux,windows
catalog.cattle.io/provides-gvr: aksclusterconfigs.aks.cattle.io/v1
catalog.cattle.io/rancher-version: ">= 2.6.0-alpha"
catalog.cattle.io/release-name: rancher-aks-operator
catalog.cattle.io/scope: management

16 changes: 16 additions & 0 deletions charts/aks-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@
{{- "" -}}
{{- end -}}
{{- end -}}

{{/*
Windows cluster will add default taint for linux nodes,
add below linux tolerations to workloads could be scheduled to those linux nodes
*/}}
{{- define "linux-node-tolerations" -}}
- key: "cattle.io/os"
value: "linux"
effect: "NoSchedule"
operator: "Equal"
{{- end -}}

{{- define "linux-node-selector" -}}
kubernetes.io/os: linux
{{- end -}}

8 changes: 8 additions & 0 deletions charts/aks-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ spec:
labels:
ke.cattle.io/operator: aks
spec:
nodeSelector: {{ include "linux-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
tolerations: {{ include "linux-node-tolerations" . | nindent 6}}
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 6 }}
{{- end }}
serviceAccountName: aks-operator
securityContext:
fsGroup: 1007
Expand Down
7 changes: 7 additions & 0 deletions charts/aks-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ httpProxy: ""
httpsProxy: ""
noProxy: ""
additionalTrustedCAs: false
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## List of node taints to tolerate (requires Kubernetes >= 1.6)
tolerations: []

0 comments on commit 20612fc

Please sign in to comment.