0

I have a single node c=kubernetes cluster and I'm untainting the master node. I'm using the following command to create my cluster.

#Only on the Master Node: On the master node initialize the cluster.
sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --ignore-preflight-errors=NumCPU

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

#Add pod network add-on
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml


# Ref: https://github.com/calebhailey/homelab/issues/3
kubectl taint nodes --all node-role.kubernetes.io/master-

kubectl get nodes
kubectl get pods --all-namespaces

#for nginx 
kubectl create deployment nginx --image=nginx

#for deployment nginx server
#https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

since the admin.cnfig file is being automatically generated, it has allocated the server to https://172.17.0.2:6443 I want it to use '0.0.0.0:3000' instead. How can I do that?

nimramubashir
  • 61
  • 1
  • 9
  • If you want your kube-apiserver to listen on all available network interfacas, you can run your `kubeadm init` command with `--apiserver-advertise-address 0.0.0.0` flag. To set custom port number you will need to pass another argument `--apiserver-bind-port 3000`. Please let me know if this is what you want to achieve. – mario Jul 07 '21 at 20:23

1 Answers1

0

What would be the reason to restrict a multi cluster only to one node? maybe you can give some more specific information and there is another workaround.

Lukonjun
  • 226
  • 1
  • 10