If you like to access kubernetes cluster from anywhere, then you would like to access it from your laptop as well. This document helps in this.
Kubernetes uses client-server model. Kubectl is client app which can connect to Kubernetes API-server remotely. For doing this, client must be able to authenticate the server.
Use Kubernetes documentation for this
Copy admin.conf from kubernetes cluster (refer KUBECONFIG env variable in the cluster master for the location) to laptop.
Set KUBECONFIG env variable in your laptop. Path will be admin.conf location in your laptop
Fire kubectl command for validation
Steps to configure kubectl
Deepaks-MacBook-Air:~ deepak$ scp root@10.106.73.232:/etc/kubernetes/admin.conf .
root@10.106.73.232's password:
admin.conf 100% 5453 1.5MB/s 00:00
Deepaks-MacBook-Air:~ deepak$ pwd
/Users/deepak
Deepaks-MacBook-Air:~ deepak$ export KUBECONFIG=/Users/deepak/admin.conf
Deepaks-MacBook-Air:~ deepak$ kubectl get pods
No resources found.
Deepaks-MacBook-Air:~ deepak$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
ubuntu-231 Ready <none> 5d v1.10.0
ubuntu-232 Ready master 5d v1.10.0
https://github.com/Azure/acs-engine/issues/2418