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,570 points
677 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,360 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,360 points
804 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,570 points
1,156 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,374 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,360 points
1,460 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,523 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 5,977 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,570 points
1,606 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,050 points
2,380 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