Created
December 27, 2023 20:23
-
-
Save jalilbengoufa/cc5c0801453970de8ff0da6b3990fc03 to your computer and use it in GitHub Desktop.
Kubernetes dashboard read only config file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: readonly-user | |
| namespace: default | |
| automountServiceAccountToken: false | |
| --- | |
| apiVersion: v1 | |
| kind: Secret | |
| metadata: | |
| name: secret-readonly-user | |
| annotations: | |
| kubernetes.io/service-account.name: "readonly-user" | |
| type: kubernetes.io/service-account-token | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: Role | |
| metadata: | |
| namespace: default | |
| name: readonly-role | |
| rules: | |
| - apiGroups: ["", "apps", "extensions", "batch"] | |
| resources: | |
| [ | |
| "pods", | |
| "deployments", | |
| "replicasets", | |
| "pods/log", | |
| "configmaps", | |
| "services", | |
| "events", | |
| "namespaces", | |
| "nodes", | |
| "limitranges", | |
| "persistentvolumes", | |
| "persistenttvolumeclaims", | |
| "resourcequotas", | |
| "statefulsets", | |
| "replicationcontrollers", | |
| "jobs", | |
| "daemonsets", | |
| "cronjobs", | |
| ] | |
| verbs: ["get", "list", "watch"] | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: RoleBinding | |
| metadata: | |
| name: readonly-rolebinding | |
| namespace: default | |
| subjects: | |
| - kind: ServiceAccount | |
| name: readonly-user | |
| namespace: default | |
| roleRef: | |
| kind: Role | |
| name: readonly-role | |
| apiGroup: rbac.authorization.k8s.io | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: Role | |
| metadata: | |
| namespace: kubernetes-dashboard | |
| name: readonly-role | |
| rules: | |
| - apiGroups: | |
| [ | |
| "", | |
| "apps", | |
| "extensions", | |
| "rbac.authorization.k8s.io", | |
| "networking.k8s.io", | |
| ] | |
| resources: | |
| [ | |
| "pods", | |
| "deployments", | |
| "replicasets", | |
| "pods/log", | |
| "configmaps", | |
| "services", | |
| "events", | |
| "namespaces", | |
| "nodes", | |
| "limitranges", | |
| "persistentvolumes", | |
| "persistentvolumeclaims", | |
| "resourcequotas", | |
| "services/proxy", | |
| "serviceaccounts", | |
| "roles", | |
| "nodes", | |
| "rolebindings", | |
| "networkpolicies", | |
| "clusterroles", | |
| "clusterrolebindings", | |
| "persistentvolumes", | |
| "storageclasses", | |
| "secrets", | |
| "ingressclasses", | |
| "ingresses", | |
| ] | |
| verbs: ["get", "list", "watch"] | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: RoleBinding | |
| metadata: | |
| name: readonly-rolebinding-kube-dashboard | |
| namespace: kubernetes-dashboard | |
| subjects: | |
| - kind: ServiceAccount | |
| name: readonly-user | |
| namespace: default | |
| roleRef: | |
| kind: Role | |
| name: readonly-role | |
| apiGroup: rbac.authorization.k8s.io | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRole | |
| metadata: | |
| name: readonly-clusterrole | |
| rules: | |
| - apiGroups: [""] | |
| resources: ["namespaces"] | |
| verbs: ["get", "list", "watch"] | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: readonly-clusterrolebinding | |
| subjects: | |
| - kind: ServiceAccount | |
| name: readonly-user | |
| namespace: default | |
| roleRef: | |
| kind: ClusterRole | |
| name: readonly-clusterrole | |
| apiGroup: rbac.authorization.k8s.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment