Skip to content

Service Account Token Login #361

@elieassi

Description

@elieassi

If your cluster is Kubernetes 1.24 or a more recent release, even tho the clusterrolebinding role is executed correctly, a secret/token will not be automatically generated anymore for the serviceaccount.

You need to create a secret for the service account, the supplied commands plus creating the secret can be all achieved for example by the following file

apiVersion: v1
kind: ServiceAccount
metadata:
  name: skooner-sa
  namespace: skooner-dashboard #whichever namespace you deployed skooner dashboard to
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: skooner-sa
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: skooner-sa
  namespace: skooner-dashboard #whichever namespace you deployed skooner dashboard to
---
apiVersion: v1
kind: Secret
metadata:
  name: skooner-sa-token
  namespace: skooner-dashboard #whichever namespace you deployed skooner dashboard to
  annotations:
   kubernetes.io/service-account.name: skooner-sa
type: kubernetes.io/service-account-token
---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions