<p>I have deployed Kubernetes using the link <a href="https://kubernetes.io/docs/tasks/tools/install-kubeadm/" rel="nofollow noreferrer">Kubernetes official page</a></p>

<p>I see that Kubernetes is deployed because in the end i got this</p>

<pre><code>Your Kubernetes master has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

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

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of machines by running the following on each node
as root:

  kubeadm join 172.16.32.101:6443 --token ma1d4q.qemewtyhkjhe1u9f --discovery-token-ca-cert-hash sha256:408b1fdf7a5ea5f282741db91ebc5aa2823802056ea9da843b8ff52b1daff240
</code></pre>

<p>when i do kubectl get pods it thorws this error </p>

<pre><code># kubectl get pods 
The connection to the server 127.0.0.1:6553 was refused - did you specify the right host or port?
</code></pre>

<p>When I do see the cluster-info it says as follows </p>

<pre><code>kubectl cluster-info 
Kubernetes master is running at https://127.0.0.1:6553
</code></pre>

<p>But when i see the config it shows as follows </p>

<pre><code>apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNE1EWXlNREEyTURJd04xb1hEVEk0TURZeE56QTJNREl3TjFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBT0ZXCkxWQkJoWmZCQms4bXJrV0w2MmFGd2U0cUYvZkRHekJidnE5TFpGN3M4UW1rdDJVUlo5YmtSdWxzSlBrUXV1U2IKKy93YWRoM054S0JTQUkrTDIrUXdyaDVLSy9lU0pvbjl5TXJlWnhmRFdPTno2Y3c4K2txdnh5akVsRUdvSEhPYQpjZHpuZnJHSXVZS3lwcm1GOEIybys0VW9ldytWVUsxRG5Ra3ZwSUZmZ1VjVWF4UjVMYTVzY2ZLNFpweTU2UE4wCjh1ZjdHSkhJZFhNdXlVZVpFT3Z3ay9uUTM3S1NlWHVhcUlsWlFqcHQvN0RrUmFZeGdTWlBqSHd5c0tQOHMzU20KZHJoeEtyS0RPYU1Wczd5a2xSYjhzQjZOWDB6UitrTzhRNGJOUytOYVBwbXFhb3hac1lGTmhCeGJUM3BvUXhkQwpldmQyTmVlYndSWGJPV3hSVzNjQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFDTFBlT0s5MUdsdFJJTjdmMWZsNmlINTg0c1UKUWhBdW1xRTJkUHFNT0ZWWkxjbDVJZlhIQ1dGeE13OEQwOG1NNTZGUTNEVDd4bi9lNk5aK1l2M1JrK2hBdmdaQgpaQk9XT3k4UFJDOVQ2S1NrYjdGTDRSWDBEamdSeE5WTFIvUHd1TUczK3V2ZFhjeXhTYVJJRUtrLzYxZjJsTGZmCjNhcTdrWkV3a05pWXMwOVh0YVZGQ21UaTd0M0xrc1NsbDZXM0NTdVlEYlRQSzJBWjUzUVhhMmxYUlZVZkhCMFEKMHVOQWE3UUtscE9GdTF2UDBDRU1GMzc4MklDa1kzMDBHZlFEWFhiODA5MXhmcytxUjFQbEhJSHZKOGRqV29jNApvdTJ1b2dHc2tGTDhGdXVFTTRYRjhSV0grZXpJRkRjV1JsZnJmVHErZ2s2aUs4dGpSTUNVc2lFNEI5QT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
    **server: https://172.16.32.101:6443**
</code></pre>

<p>Even telnet shows that there is a process running on 6443 but not on 6553 
how can change the port and how can I fix the issue??</p>

<p>Any help would be of great use </p>

<p>Thanks in advance.</p>

<p>It looks like your last kubectl config interferes with the previous clusters configurations.</p>

<p>It is possible to have settings for <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/" rel="nofollow noreferrer">several different clusters</a> in one <code>.kube/config</code> or in separate files.<br>
But in some cases, you may want to manage only the cluster you've just created.  </p>

<p><strong>Note:</strong> After tearing down the exited cluster using <code>kubeadm reset</code> followed by initializing fresh cluster using <code>kubeadm init</code>, new certificates will be generated. To operate the new cluster, you have to update kubectl configuration or replace it with the new one.</p>

<p>To clean up old <code>kubectl</code> configurations and apply the last one, run the following commands:</p>

<pre><code>rm -rf $HOME/.kube
unset KUBECONFIG

# Check if you have KUBECONFIG configured in profile dot files and comment or remove it.

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
</code></pre>

<p>It gives you up-to-date configuration for the last cluster you've created using kubeadm tool.  </p>

<p><strong>Note:</strong> You should copy kubectl configuration for all users accounts which you are going to use to manage the cluster.</p>

<p><a href="http://jeffmendoza.github.io/kubernetes/v1.0/docs/user-guide/kubeconfig-file.html" rel="nofollow noreferrer">Here</a> are some examples of how to manage config file using the command line.</p>
