So, try this. Edit your kube config file inside the ~/.kube/config like:
apiVersion: v1
clusters:
- cluster:
server: http://<master-ip>:<port>
name: test
contexts:
- context:
cluster: test
user: test
name: test
Set the context by running:
kubectl config use-context test
Now you can interact with the cluster. Also, to add the certification follow: http://kubernetes.io/docs/user-guide/kubeconfig-file/
Or run this command:
kubectl config set-cluster test-cluster --server=http://<master-ip>:<port> --api-version=v1
kubectl config use-context test-cluster