How to schedule master node running pod/service as a worker node

Question: How can I schedule master node running pod/service as worker node?

By deafult, only worker node could run the pod, master only response for the scheduler/configuration.

$ kubectl get nodes -o json | jq .items[].spec.taints
[
  {
    "effect": "NoSchedule",
    "key": "node-role.kubernetes.io/master"
  }
]
$ kubectl get nodes -o json | grep master
                    "node-role.kubernetes.io/master": ""
                        "key": "node-role.kubernetes.io/master"

However, you could disable the “NoSchedule” property so master node could run pod as well.

$ kubectl taint nodes --all node-role.kubernetes.io/master-
node/k8s-all-in-one untainted
$ kubectl get nodes -o json | jq .items[].spec.taints
null
$ kubectl get nodes -o json | grep master
                    "node-role.kubernetes.io/master": ""
Related Post