patternkubernetesMinor
kubectl asking for username (k8s cluster created via kops)
Viewed 0 times
createdkopsk8susernameviaforaskingkubectlcluster
Problem
I created a kubernetes cluster using
Then I export in my local machine the configuration like
Then running any kubectl command asks for a username, even
PS: If I
My local config created from export command into
And with the config above I cannot do any
Where can I find the username and password for
I have set authentication as RBAC for the cluster and no limitations.
I read all article here https://kubernetes.io/docs/reference/access-authn-authz/authentication/ and still do not understand what is the default username password why am I asked for such credentials I haven't created any role or user.
kops and deployed it in AWS (not EKS manual cluster using kops).Then I export in my local machine the configuration like
kops export kubecfg --state ${KOPS_STATE_STORE} --name ${NAME}Then running any kubectl command asks for a username, even
kubectl versionkubectl version
Please enter Username:PS: If I
ssh into bastion host then ssh into k8s master node, kubectl works fine and its configuration is referring to local user created.My local config created from export command into
~/.kube/config looks like:apiVersion: v1
clusters:
- cluster:
certificate-authority-data: fakedata=
server: https://api-test-intern-doesntmatter.eu-central-1.elb.amazonaws.com
name: test-internet.k8s.local
contexts:
- context:
cluster: test-internet.k8s.local
user: test-internet.k8s.local
name: test-internet.k8s.local
current-context: test-internet.k8s.local
kind: Config
preferences: {}
users:
- name: test-internet.k8s.local
user: {}And with the config above I cannot do any
kubectl command.Where can I find the username and password for
kubectl?I have set authentication as RBAC for the cluster and no limitations.
I read all article here https://kubernetes.io/docs/reference/access-authn-authz/authentication/ and still do not understand what is the default username password why am I asked for such credentials I haven't created any role or user.
Solution
I solved this temporarily with not the safest solution, but is working
When creating secret with kops named admin, can use that to generate user field in exported kops config by adding also
When creating secret with kops named admin, can use that to generate user field in exported kops config by adding also
--admin in the export commandContext
StackExchange DevOps Q#13632, answer score: 1
Revisions (0)
No revisions yet.