Configure kubectl command to access remote kubernetes cluster on azure
Configure kubectl command to access remote kubernetes cluster on azure
Configure kubectl command to access remote kubernetes cluster on azure
Re: Configure kubectl command to access remote kubernetes cluster on azure
Found a way to access remote kubernetes cluster without ssh'ing to one of the nodes in cluster. You need to edit ~/.kube/config file as below :
```
apiVersion: v1
clusters:
- cluster:
server: http://:
name: test
contexts:
- context:
cluster: test
user: test
name: test
```
Then set context by executing:
```
kubectl config use-context test
```
After this you should be able to interact with the cluster.
Note : To add certification and key use following link : [http://kubernetes.io/docs/user-guide/kubeconfig-file/](http://kubernetes.io/docs/user-guide/kubeconfig-file/)
Alternately, you can also try following command
```
kubectl config set-cluster test-cluster --server=http://: --api-version=v1
kubectl config use-context test-cluster
```
```
apiVersion: v1
clusters:
- cluster:
server: http://:
name: test
contexts:
- context:
cluster: test
user: test
name: test
```
Then set context by executing:
```
kubectl config use-context test
```
After this you should be able to interact with the cluster.
Note : To add certification and key use following link : [http://kubernetes.io/docs/user-guide/kubeconfig-file/](http://kubernetes.io/docs/user-guide/kubeconfig-file/)
Alternately, you can also try following command
```
kubectl config set-cluster test-cluster --server=http://: --api-version=v1
kubectl config use-context test-cluster
```