If --taint is specified, set the taint value to empty (#322)

Add the old tolerations the examples to make it backward compatible during the switch
This commit is contained in:
Robbie Zhang
2018-08-15 17:44:51 -07:00
committed by GitHub
parent b0e5ed758e
commit d7f97b9bfc
6 changed files with 14 additions and 1 deletions

View File

@@ -27,3 +27,5 @@ spec:
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
- key: azure.com/aci
effect: NoSchedule

View File

@@ -29,3 +29,5 @@ spec:
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
- key: azure.com/aci
effect: NoSchedule

View File

@@ -18,3 +18,5 @@ spec:
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
- key: azure.com/aci
effect: NoSchedule

View File

@@ -21,3 +21,5 @@ spec:
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
- key: azure.com/aci
effect: NoSchedule

View File

@@ -25,3 +25,5 @@ spec:
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
- key: azure.com/aci
effect: NoSchedule

View File

@@ -81,13 +81,16 @@ func New(nodeName, operatingSystem, namespace, kubeConfig, provider, providerCon
internalIP := os.Getenv("VKUBELET_POD_IP")
var defaultTaintKey string
var defaultTaintValue string
if taintKey != "" {
defaultTaintKey = taintKey
defaultTaintValue = ""
} else {
defaultTaintKey = "virtual-kubelet.io/provider"
defaultTaintValue = provider
}
vkTaintKey := getEnv("VKUBELET_TAINT_KEY", defaultTaintKey)
vkTaintValue := getEnv("VKUBELET_TAINT_VALUE", provider)
vkTaintValue := getEnv("VKUBELET_TAINT_VALUE", defaultTaintValue)
vkTaintEffectEnv := getEnv("VKUBELET_TAINT_EFFECT", "NoSchedule")
var vkTaintEffect corev1.TaintEffect
switch vkTaintEffectEnv {