Accessing remote kubernetes cluster on azure using kubectl

0 votes

I am running one of my kubernetes clusters on azure. How can I access it from a local kubectl command. I referred the docs but I do not have any kube config file. And if I view do a kube config view I get:

apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []
Sep 11, 2018 in Kubernetes by ffdfd
• 5,550 points
415 views

1 answer to this question.

0 votes

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
answered Sep 11, 2018 by ajs3033
• 7,300 points

Related Questions In Kubernetes

0 votes
1 answer

“403 Insufficient Permission” while creating a Kubernetes Cluster on Google Cloud instance

To run ./cluster/kube-up.sh, you most likely need compute scope ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,360 points
1,018 views
0 votes
1 answer

Unable to run Kubernetes on rancher cluster

switch Docker to 1.12.x; Kubernetes doesn't support ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,360 points
1,103 views
0 votes
1 answer

Deepstream.io on Kubernetes cluster

Kompose doesn’t support host volume mounting. Instead ...READ MORE

answered Sep 3, 2018 in Kubernetes by Kalgi
• 52,360 points
1,185 views
0 votes
1 answer
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,360 points
933 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
14,587 views
0 votes
1 answer

automating cluster setup and app deplument on kubernetes

Go through Google Cloud Deployment Manager. it automates ...READ MORE

answered Jul 5, 2018 in Kubernetes by ajs3033
• 7,300 points
422 views
0 votes
1 answer

Using kubernetes API on GKE

When you create a cluster using GKE, ...READ MORE

answered Dec 6, 2018 in Kubernetes by ajs3033
• 7,300 points
1,008 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP