0

How can I retrieve the root token from a KubeApps deployment?

2
  • What details or clarity is needed here, it's a self answered question? Commented Jun 16, 2022 at 15:29
  • Note this is self-answered. Commented Jun 20, 2022 at 3:43

1 Answer 1

0

When you set up a KubeApps deployment you must install a Kubernetes secret, currently the installation instructions detail it like this,

 kubectl create clusterrolebinding kubeapps-operator --clusterrole=cluster-admin --serviceaccount=default:kubeapps-operator cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Secret metadata: name: kubeapps-operator-token namespace: default annotations: kubernetes.io/service-account.name: kubeapps-operator type: kubernetes.io/service-account-token EOF kubectl get --namespace default secret kubeapps-operator-token -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' && echo 

So basically it's a service-account-token installed in the default namespace. You can list these like this,

 kubectl get --namespace default secrets 

You specifically want the kubeapps-operator-token and you can get it with the last line,

kubectl get --namespace default secret kubeapps-operator-token -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' 

The -o go-template='{{.data.token | base64decode}}' is basically just piping it to base64 -d in Go (like this).

kubectl get --namespace default secret kubeapps-operator-token -o jsonpath='{.data.token}' | base64 -d 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.