Kubernetes API authentication

0 votes

I’m able to create a service using the command kubectl create, I’m also able to access is on the API in my browser.

It then prompts for authentication and credentials.

I got the credentials using the following command

kubectl config view --minify

The API then shows:

{
  "paths": [
    "/apis",
    "/apis/",
    "/apis/apiextensions.k8s.io",
    "/apis/apiextensions.k8s.io/v1beta1",
    "/healthz",
    "/healthz/etcd",
    "/healthz/ping",
    "/healthz/poststarthook/generic-apiserver-start-informers",
    "/healthz/poststarthook/start-apiextensions-controllers",
    "/healthz/poststarthook/start-apiextensions-informers",
    "/metrics",
    "/swagger-2.0.0.json",
    "/swagger-2.0.0.pb-v1",
    "/swagger-2.0.0.pb-v1.gz",
    "/swagger.json",
    "/swaggerapi",
    "/version"
  ]
}

However, when I try to do anything on the kubernetes cluster (Install Helm Tiller for example), it gives me: Kubernetes error: Unauthorized

Sep 3, 2018 in Kubernetes by Hannah
• 18,520 points
920 views

1 answer to this question.

0 votes

Best way to retrieve the token is:

kubectl get secrets

To list the secrets

Then

kubectl describe secret SECRET_NAME

To retrieve the token

answered Sep 3, 2018 by Kalgi
• 52,350 points

Related Questions In Kubernetes

0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 52,350 points
1,015 views
0 votes
3 answers

Request Kubernetes API server

Create a api wrapper. This way you ...READ MORE

answered Aug 31, 2018 in Kubernetes by Hannah
• 18,520 points
1,427 views
+1 vote
4 answers

Kubernetes- HTTPS API return `Unauthorized`

One way to do this is by ...READ MORE

answered Sep 5, 2018 in Kubernetes by u_told_me_to
2,771 views
0 votes
1 answer

Kubernetes - Job scheduling API

You will find the CronJobresource in the batch/v1beta1 API group. ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 52,350 points
1,657 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
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
0 votes
2 answers

Access Kubernetes API using minKube

Try these commands: kubectl proxy --port=8080 You can then ...READ MORE

answered Aug 28, 2018 in Kubernetes by Hannah
• 18,520 points
1,889 views
0 votes
2 answers

Access Kubernetes api from within a pod container

wget version: KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) wget -vO- ...READ MORE

answered Aug 29, 2018 in Kubernetes by Nilesh
• 7,060 points
2,755 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