Managed Kubernetes
Latest
Frequently Asked Questions
Solutions
How Tos
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
How-to Grant Read-Only Access to the Kubernetes Dashboard
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
A read-only access role needs to be created for access to the Kubernetes Web UI (Dashboard).
Environment
- Platform9 Managed Kubernetes - All Versions
- Kubernetes Web UI (Dashboard)
Procedure
- Create a service account in the default or any other namespace of your choice.
xxxxxxxxxx# kubectl create sa [name of serviceaccount] -n [namespace]- Create a cluster role with get, list, and watch verbs.
# cat [<EOF | kubectl apply -f -] ---> apiVersion: rbac.authorization.k8s.io/v1> kind: ClusterRole> metadata:> name: [clusterrole name]> rules:> - apiGroups: ["*"]> resources: ["*"]> verbs: ["get", "list", "watch"]> EOFThe above gives permission to all the resources; it can be modified accordingly.
- Create a clusterrolebinding for the above clusterrole and serviceaccount.
# kubectl create clusterrolebinding [name] --serviceaccount=[namespace:serviceaccount name] --clusterrole=[clusterrole name]- Describe the serviceaccount resource (created above).
xxxxxxxxxx# kubectl describe serviceaccount [service account name] -n [namespace]- Extract the token value from the secret specified for the serviceaccount resource (above output).
xxxxxxxxxx# kubectl get secret [secret-name] -o jsonpath="{.data.token}" | base64 --decode && echo ''The token value may then be used to login to the Kubernetes Dashboard with read-only privileges.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message