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
• 14,070 points
151 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
• 40,420 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
• 40,420 points
56 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
• 14,070 points
224 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
108 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
• 40,420 points
198 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17 in Others by anonymous
2,067 views
+3 votes
1 answer
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
• 14,070 points
242 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
• 6,880 points
261 views