mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	kubeadm: Start using Tolerations in yaml code again
This commit is contained in:
		| @@ -110,7 +110,6 @@ func CreateKubeProxyAddon(configMapBytes, daemonSetbytes []byte, client *clients | ||||
| 	if err := kuberuntime.DecodeInto(api.Codecs.UniversalDecoder(), daemonSetbytes, kubeproxyDaemonSet); err != nil { | ||||
| 		return fmt.Errorf("unable to decode kube-proxy daemonset %v", err) | ||||
| 	} | ||||
| 	kubeproxyDaemonSet.Spec.Template.Spec.Tolerations = []v1.Toleration{kubeadmconstants.MasterToleration} | ||||
|  | ||||
| 	if _, err := client.ExtensionsV1beta1().DaemonSets(metav1.NamespaceSystem).Create(kubeproxyDaemonSet); err != nil { | ||||
| 		if !apierrors.IsAlreadyExists(err) { | ||||
| @@ -129,13 +128,6 @@ func CreateKubeDNSAddon(deploymentBytes, serviceBytes []byte, client *clientset. | ||||
| 	if err := kuberuntime.DecodeInto(api.Codecs.UniversalDecoder(), deploymentBytes, kubednsDeployment); err != nil { | ||||
| 		return fmt.Errorf("unable to decode kube-dns deployment %v", err) | ||||
| 	} | ||||
| 	kubednsDeployment.Spec.Template.Spec.Tolerations = []v1.Toleration{ | ||||
| 		kubeadmconstants.MasterToleration, | ||||
| 		{ | ||||
| 			Key:      "CriticalAddonsOnly", | ||||
| 			Operator: "Exists", | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
| 	if _, err := client.ExtensionsV1beta1().Deployments(metav1.NamespaceSystem).Create(kubednsDeployment); err != nil { | ||||
| 		if !apierrors.IsAlreadyExists(err) { | ||||
|   | ||||
| @@ -79,10 +79,9 @@ spec: | ||||
|           name: kube-proxy | ||||
|       hostNetwork: true | ||||
|       serviceAccountName: kube-proxy | ||||
|       # TODO: Why doesn't the Decoder recognize this new field and decode it properly? Right now it's ignored | ||||
|       # tolerations: | ||||
|       # - key: {{ .MasterTaintKey }} | ||||
|       #   effect: NoSchedule | ||||
|       tolerations: | ||||
|       - key: {{ .MasterTaintKey }} | ||||
|         effect: NoSchedule | ||||
|       volumes: | ||||
|       - name: kube-proxy | ||||
|         configMap: | ||||
| @@ -92,7 +91,6 @@ spec: | ||||
| 	KubeDNSVersion = "1.14.2" | ||||
|  | ||||
| 	KubeDNSDeployment = ` | ||||
|  | ||||
| apiVersion: extensions/v1beta1 | ||||
| kind: Deployment | ||||
| metadata: | ||||
| @@ -116,8 +114,6 @@ spec: | ||||
|     metadata: | ||||
|       labels: | ||||
|         k8s-app: kube-dns | ||||
|       annotations: | ||||
|         scheduler.alpha.kubernetes.io/critical-pod: '' | ||||
|     spec: | ||||
|       volumes: | ||||
|       - name: kube-dns-config | ||||
| @@ -243,12 +239,11 @@ spec: | ||||
|             cpu: 10m | ||||
|       dnsPolicy: Default  # Don't use cluster DNS. | ||||
|       serviceAccountName: kube-dns | ||||
|       # TODO: Why doesn't the Decoder recognize this new field and decode it properly? Right now it's ignored | ||||
|       # tolerations: | ||||
|       # - key: CriticalAddonsOnly | ||||
|       #   operator: Exists | ||||
|       # - key: {{ .MasterTaintKey }} | ||||
|       #   effect: NoSchedule | ||||
|       tolerations: | ||||
|       - key: CriticalAddonsOnly | ||||
|         operator: Exists | ||||
|       - key: {{ .MasterTaintKey }} | ||||
|         effect: NoSchedule | ||||
|       # TODO: Remove this affinity field as soon as we are using manifest lists | ||||
|       affinity: | ||||
|         nodeAffinity: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user