From 1542168068a594a4be9d5928a26b86cb6d85deeb Mon Sep 17 00:00:00 2001 From: mlmhl Date: Tue, 17 Mar 2020 17:21:14 +0800 Subject: [PATCH] add toleration of master node --- pkg/controller/csi/enhancer/ceph.go | 12 ++++++++++++ pkg/controller/csi/enhancer/tencentCloud.go | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/pkg/controller/csi/enhancer/ceph.go b/pkg/controller/csi/enhancer/ceph.go index 093bbf0..d0a7bec 100644 --- a/pkg/controller/csi/enhancer/ceph.go +++ b/pkg/controller/csi/enhancer/ceph.go @@ -123,6 +123,12 @@ func (e *cephEnhancer) enhanceCephRBD(csiDeploy *csiv1.CSI) error { HostNetwork: true, HostPID: true, DNSPolicy: corev1.DNSClusterFirstWithHostNet, + Tolerations: []corev1.Toleration{ + { + Key: "node-role.kubernetes.io/master", + Effect: corev1.TaintEffectNoSchedule, + }, + }, Containers: []corev1.Container{ { Name: "csi-rbd", @@ -189,6 +195,12 @@ func (e *cephEnhancer) enhanceCephFS(csiDeploy *csiv1.CSI) error { Spec: corev1.PodSpec{ HostNetwork: true, DNSPolicy: corev1.DNSClusterFirstWithHostNet, + Tolerations: []corev1.Toleration{ + { + Key: "node-role.kubernetes.io/master", + Effect: corev1.TaintEffectNoSchedule, + }, + }, Containers: []corev1.Container{ { Name: "csi-cephfs", diff --git a/pkg/controller/csi/enhancer/tencentCloud.go b/pkg/controller/csi/enhancer/tencentCloud.go index 2cca81f..1bc18b3 100644 --- a/pkg/controller/csi/enhancer/tencentCloud.go +++ b/pkg/controller/csi/enhancer/tencentCloud.go @@ -110,6 +110,12 @@ func (e *tencentCloudEnhancer) generateDriverTemplate( HostPID: true, HostIPC: true, DNSPolicy: corev1.DNSClusterFirstWithHostNet, + Tolerations: []corev1.Toleration{ + { + Key: "node-role.kubernetes.io/master", + Effect: corev1.TaintEffectNoSchedule, + }, + }, Containers: []corev1.Container{ { Name: "com-tencent-cloud-csi-cbs",