Add default provider taint and taint configuration options

This allows for more specificity when setting taint tolerations for
workloads. Three new env variables are introduced:

VKUBELET_TAINT_KEY (defaults to `virtual-kubelet.io/provider`)
VKUBELET_TAINT_VALUE (defaults to provider name)
VKUBELET_TAINT_EFFECT (defaults to `NoSchedule`)

BREAKING CHANGES:
- The default taint key of `azure.com/aci` is now
  `virtual-kubelet.io/provider`.
- Specifying a custom taint key is now done via an environment variable
  rather than the `--taint` command line flag.
This commit is contained in:
Jacob LeGrone
2018-08-14 11:57:22 -04:00
committed by Robbie Zhang
parent 9f07768875
commit d47a0b2fc0
14 changed files with 75 additions and 28 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
name: virtual-kubelet
version: 0.2.0
version: 0.3.0
appVersion: 0.3
description: A Helm chart to install virtual kubelet inside a Kubernetes cluster.
icon: https://avatars2.githubusercontent.com/u/34250142

View File

@@ -28,6 +28,12 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: VKUBELET_TAINT_KEY
value: {{ .Values.taint.key }}
- name: VKUBELET_TAINT_VALUE
value: {{ tpl .Values.taint.value $ }}
- name: VKUBELET_TAINT_EFFECT
value: {{ .Values.taint.effect }}
{{- if eq .Values.provider "azure" }}
{{- with .Values.providers.azure }}
{{- if .loganalytics.enabled }}
@@ -73,11 +79,13 @@ spec:
{{- end }}
command: ["virtual-kubelet"]
args: [
{{- if not .Values.taint.enabled }}
"--disable-taint", "true",
{{- end }}
"--provider", "{{ required "provider is required" .Values.provider }}",
"--namespace", "{{ .Values.monitoredNamespace }}",
"--nodename", "{{ required "nodeName is required" .Values.nodeName }}",
"--os", "{{ .Values.nodeOsType }}",
"--taint", "{{ .Values.nodeTaint }}"
"--os", "{{ .Values.nodeOsType }}"
]
volumes:
- name: credentials

View File

@@ -23,5 +23,8 @@ spec:
kubernetes.io/hostname: "{{ .Values.nodeName }}"
restartPolicy: Never
tolerations:
- key: "{{ .Values.nodeTaint }}"
effect: NoSchedule
{{- if .Values.taint.enabled }}
- key: "{{ .Values.taint.key }}"
value: "{{ tpl .Values.taint.value $ }}"
effect: "{{ .Values.taint.effect }}"
{{- end }}

View File

@@ -6,12 +6,18 @@ image:
## `provider` should be one of aws, azure, azurebatch, etc...
provider:
nodeName: "virtual-kubelet"
nodeTaint: "azure.com/aci"
nodeOsType: "Linux"
monitoredNamespace: ""
apiserverCert:
apiserverKey:
taint:
enabled: true
key: virtual-kubelet.io/provider
value: "{{ .Values.provider }}"
## `effect` must be `NoSchedule`, `PreferNoSchedule` or `NoExecute`.
effect: NoSchedule
providers:
azure:
## Set to true if deploying to Azure Kubernetes Service (AKS), otherwise false