Found a way to access a remote kubernetes cluster without ssh'ing to one of the nodes in the cluster. You need to edit the ~ / .kube / config file as shown below:
apiVersion: v1 clusters: - cluster: server: http://<master-ip>:<port> name: test contexts: - context: cluster: test user: test name: test
Then set the context by doing:
kubectl config use-context test
After that, you will be able to interact with the cluster.
Note. To add the certification and key, use the following link: http://kubernetes.io/docs/user-guide/kubeconfig-file/
Alternatively, you can also try the following command
kubectl config set-cluster test-cluster --server=http://<master-ip>:<port> --api-version=v1 kubectl config use-context test-cluster
Phagun baya
source share