How to force Pods/Deployments to Master nodes?

后端 未结 3 732
北恋
北恋 2020-12-28 09:05

I\'ve setup a Kubernetes 1.5 cluster with the three master nodes tainted dedicated=master:NoSchedule. Now I want to deploy the Nginx Ingress Controller on the Maste

3条回答
  •  礼貌的吻别
    2020-12-28 09:48

    you might want to dive into the Assigning Pods to Nodes documentation. Basically you should add some labels to your nodes with sth like this:

    kubectl label nodes  =
    

    and then reference that within your Pod specification like this:

    apiVersion: v1
    kind: Pod
    metadata:
      name: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
      nodeSelector:
        label: value
    

    But I'm not sure if this works for non-critical addons when the specific node is tainted. More details could be found here

提交回复
热议问题