From 02da44720cb85bce434e2474f0405f9334f858c4 Mon Sep 17 00:00:00 2001 From: Sreejith Punnapuzha Date: Tue, 10 Nov 2020 12:02:33 -0600 Subject: [PATCH] Add toleration for taint This commit adds toleration for taint master NoSchedule to different components. This will help us in managing components that gets deployed in kubernetes master nodes Relates-To: #406 Change-Id: I9f3a30be9c4eed65dcdd1c41514abbfd9c384541 Signed-off-by: Sreejith Punnapuzha --- .../baremetal-operator/ironic_toleration_patch.yaml | 10 ++++++++++ .../function/baremetal-operator/kustomization.yaml | 3 +++ .../function/capm3/v0.3.2/manager/kustomization.yaml | 1 + .../v0.3.2/manager/manager_toleration_patch.yaml | 11 +++++++++++ .../manager/deployment_toleration_patch.yaml | 11 +++++++++++ .../flux/helm-controller/manager/kustomization.yaml | 3 +++ .../manager/deployment_toleration_patch.yaml | 11 +++++++++++ .../flux/source-controller/manager/kustomization.yaml | 3 +++ manifests/function/hwcc/manager/kustomization.yaml | 3 +++ .../hwcc/manager/manager_toleration_patch.yaml | 11 +++++++++++ tools/deployment/31_deploy_initinfra_target_node.sh | 7 ------- 11 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 manifests/function/baremetal-operator/ironic_toleration_patch.yaml create mode 100644 manifests/function/capm3/v0.3.2/manager/manager_toleration_patch.yaml create mode 100644 manifests/function/flux/helm-controller/manager/deployment_toleration_patch.yaml create mode 100644 manifests/function/flux/source-controller/manager/deployment_toleration_patch.yaml create mode 100644 manifests/function/hwcc/manager/manager_toleration_patch.yaml diff --git a/manifests/function/baremetal-operator/ironic_toleration_patch.yaml b/manifests/function/baremetal-operator/ironic_toleration_patch.yaml new file mode 100644 index 000000000..d907b3e5c --- /dev/null +++ b/manifests/function/baremetal-operator/ironic_toleration_patch.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ironic +spec: + template: + spec: + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule diff --git a/manifests/function/baremetal-operator/kustomization.yaml b/manifests/function/baremetal-operator/kustomization.yaml index d7bd1c0fd..d1bc15adb 100644 --- a/manifests/function/baremetal-operator/kustomization.yaml +++ b/manifests/function/baremetal-operator/kustomization.yaml @@ -10,3 +10,6 @@ resources: - namespace.yaml namespace: metal3 + +patchesStrategicMerge: +- ironic_toleration_patch.yaml diff --git a/manifests/function/capm3/v0.3.2/manager/kustomization.yaml b/manifests/function/capm3/v0.3.2/manager/kustomization.yaml index 131cb63d5..884e5561c 100644 --- a/manifests/function/capm3/v0.3.2/manager/kustomization.yaml +++ b/manifests/function/capm3/v0.3.2/manager/kustomization.yaml @@ -11,3 +11,4 @@ patchesStrategicMerge: - manager_image_patch.yaml - manager_pull_policy.yaml - manager_auth_proxy_patch.yaml +- manager_toleration_patch.yaml diff --git a/manifests/function/capm3/v0.3.2/manager/manager_toleration_patch.yaml b/manifests/function/capm3/v0.3.2/manager/manager_toleration_patch.yaml new file mode 100644 index 000000000..59335c8ae --- /dev/null +++ b/manifests/function/capm3/v0.3.2/manager/manager_toleration_patch.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule diff --git a/manifests/function/flux/helm-controller/manager/deployment_toleration_patch.yaml b/manifests/function/flux/helm-controller/manager/deployment_toleration_patch.yaml new file mode 100644 index 000000000..d77f19630 --- /dev/null +++ b/manifests/function/flux/helm-controller/manager/deployment_toleration_patch.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: helm-controller + namespace: flux-system +spec: + template: + spec: + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule diff --git a/manifests/function/flux/helm-controller/manager/kustomization.yaml b/manifests/function/flux/helm-controller/manager/kustomization.yaml index 42835f535..389fa9e55 100644 --- a/manifests/function/flux/helm-controller/manager/kustomization.yaml +++ b/manifests/function/flux/helm-controller/manager/kustomization.yaml @@ -2,3 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - deployment.yaml + +patchesStrategicMerge: +- deployment_toleration_patch.yaml diff --git a/manifests/function/flux/source-controller/manager/deployment_toleration_patch.yaml b/manifests/function/flux/source-controller/manager/deployment_toleration_patch.yaml new file mode 100644 index 000000000..1b0be47c4 --- /dev/null +++ b/manifests/function/flux/source-controller/manager/deployment_toleration_patch.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: source-controller + namespace: flux-system +spec: + template: + spec: + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule diff --git a/manifests/function/flux/source-controller/manager/kustomization.yaml b/manifests/function/flux/source-controller/manager/kustomization.yaml index dffc32ffe..e97f6021d 100644 --- a/manifests/function/flux/source-controller/manager/kustomization.yaml +++ b/manifests/function/flux/source-controller/manager/kustomization.yaml @@ -3,3 +3,6 @@ kind: Kustomization resources: - deployment.yaml - service.yaml + +patchesStrategicMerge: +- deployment_toleration_patch.yaml diff --git a/manifests/function/hwcc/manager/kustomization.yaml b/manifests/function/hwcc/manager/kustomization.yaml index ad13e96b3..7485e11c2 100644 --- a/manifests/function/hwcc/manager/kustomization.yaml +++ b/manifests/function/hwcc/manager/kustomization.yaml @@ -6,3 +6,6 @@ images: - name: controller newName: controller newTag: latest + +patchesStrategicMerge: +- manager_toleration_patch.yaml diff --git a/manifests/function/hwcc/manager/manager_toleration_patch.yaml b/manifests/function/hwcc/manager/manager_toleration_patch.yaml new file mode 100644 index 000000000..59335c8ae --- /dev/null +++ b/manifests/function/hwcc/manager/manager_toleration_patch.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule diff --git a/tools/deployment/31_deploy_initinfra_target_node.sh b/tools/deployment/31_deploy_initinfra_target_node.sh index 05574ce74..e25043d1c 100755 --- a/tools/deployment/31_deploy_initinfra_target_node.sh +++ b/tools/deployment/31_deploy_initinfra_target_node.sh @@ -18,13 +18,6 @@ export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"} NODENAME="node01" export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"} -# TODO remove taint -kubectl \ - --kubeconfig $KUBECONFIG \ - --context $KUBECONFIG_TARGET_CONTEXT \ - --request-timeout 10s \ - taint node $NODENAME node-role.kubernetes.io/master- - echo "Deploy infra to cluster" airshipctl phase run initinfra-target --debug