Configure kubectl command to access remote kubernetes cluster on azure

Phagun Baya :

I have a kubernetes cluster running on azure. What is the way to access the cluster from local kubectl command. I referred to here but on the kubernetes master node there is no kube config file. Also, kubectl config view results in

apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []
Phagun Baya :

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://<master-ip>:<port>
  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/

Alternately, you can also try following command

kubectl config set-cluster test-cluster --server=http://<master-ip>:<port> --api-version=v1
kubectl config use-context test-cluster

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Configure kubectl command to access remote kubernetes cluster on azure

分類Dev

Configure kubectl command to access remote kubernetes cluster on azure

分類Dev

how to configure already running cluster in kubernetes

分類Dev

Kubernetes: Nodes/Pods not showing with kubectl after building cluster with kubeadm

分類Dev

Akka.net: Access remote Actors in Cluster

分類Dev

Can't access my service in a remote Kubernetes

分類Dev

PhpMyAdmin remote access denied but command cli granted

分類Dev

allow access to all resources on kubernetes cluster except get nodes

分類Dev

How to Integrate GitLab-Ci w/ Azure Kubernetes + Kubectl + ACR for Deployments?

分類Dev

kubectl authentication to aws eks cluster

分類Dev

How to add an Azure AKS Kubernetes Cluster self-signed CA to GitLab CI/CD Kubernetes integration?

分類Dev

Kubernetes kubectl get secrets by type?

分類Dev

Configure a cluster network with Cephadm?

分類Dev

Reset Kubernetes cluster

分類Dev

Kubernetes - How to access nginx load balancing from outside the cluster using a NodePort service

分類Dev

Kubernetes Cluster Context with Multiple Namespaces

分類Dev

How to create a user in a Kubernetes cluster?

分類Dev

configure command not found cygwin

分類Dev

How can I configure the expiration time of an Azure AD access token (using ADAL)?

分類Dev

Azure Kubernetes Error when running "az aks get-credentials" command

分類Dev

Azure Container Registryからプルした後、イメージはAzure Kubernetes Clusterのどこに保存されますか?

分類Dev

Remote Access Trojan in Ubuntu?

分類Dev

Remote File Access

分類Dev

Not able to access Kubernetes Service

分類Dev

Is there a way to prevent kubectl from de-registering kubernetes nodes?

分類Dev

What is Kubernetes API analog for `kubectl auth can-i`

分類Dev

Using the dask labextenstion to connect to a remote cluster

分類Dev

HPA + Cluster Autoscaler + OPA within Federated Kubernetes cluster on GKE

分類Dev

How to use kubeadm to create kubernetes cluster?

Related 関連記事

  1. 1

    Configure kubectl command to access remote kubernetes cluster on azure

  2. 2

    Configure kubectl command to access remote kubernetes cluster on azure

  3. 3

    how to configure already running cluster in kubernetes

  4. 4

    Kubernetes: Nodes/Pods not showing with kubectl after building cluster with kubeadm

  5. 5

    Akka.net: Access remote Actors in Cluster

  6. 6

    Can't access my service in a remote Kubernetes

  7. 7

    PhpMyAdmin remote access denied but command cli granted

  8. 8

    allow access to all resources on kubernetes cluster except get nodes

  9. 9

    How to Integrate GitLab-Ci w/ Azure Kubernetes + Kubectl + ACR for Deployments?

  10. 10

    kubectl authentication to aws eks cluster

  11. 11

    How to add an Azure AKS Kubernetes Cluster self-signed CA to GitLab CI/CD Kubernetes integration?

  12. 12

    Kubernetes kubectl get secrets by type?

  13. 13

    Configure a cluster network with Cephadm?

  14. 14

    Reset Kubernetes cluster

  15. 15

    Kubernetes - How to access nginx load balancing from outside the cluster using a NodePort service

  16. 16

    Kubernetes Cluster Context with Multiple Namespaces

  17. 17

    How to create a user in a Kubernetes cluster?

  18. 18

    configure command not found cygwin

  19. 19

    How can I configure the expiration time of an Azure AD access token (using ADAL)?

  20. 20

    Azure Kubernetes Error when running "az aks get-credentials" command

  21. 21

    Azure Container Registryからプルした後、イメージはAzure Kubernetes Clusterのどこに保存されますか?

  22. 22

    Remote Access Trojan in Ubuntu?

  23. 23

    Remote File Access

  24. 24

    Not able to access Kubernetes Service

  25. 25

    Is there a way to prevent kubectl from de-registering kubernetes nodes?

  26. 26

    What is Kubernetes API analog for `kubectl auth can-i`

  27. 27

    Using the dask labextenstion to connect to a remote cluster

  28. 28

    HPA + Cluster Autoscaler + OPA within Federated Kubernetes cluster on GKE

  29. 29

    How to use kubeadm to create kubernetes cluster?

ホットタグ

アーカイブ