Skip to content

Instantly share code, notes, and snippets.

@henryeleonu
Created December 20, 2022 14:48
Show Gist options
  • Save henryeleonu/46e8a2505e82ab03d7aef98d50088baa to your computer and use it in GitHub Desktop.
Save henryeleonu/46e8a2505e82ab03d7aef98d50088baa to your computer and use it in GitHub Desktop.
# NOTE: The service account `default:default` already exists in k8s cluster.
# You can create a new account following like this:
#---
#apiVersion: v1
#kind: ServiceAccount
#metadata:
# name: <new-account-name>
# namespace: <namespace>
apiVersion: v1
kind: ServiceAccount
metadata:
name: spark-sa
namespace: default
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: default
name: spark-role
rules:
- apiGroups: [""]
resources: ["pods", "services", "configmaps", "secrets", "namespaces", "deployments", "jobs", "apiservices"]
#resources: [""]
verbs: ["create", "get", "watch", "list", "post", "delete", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: spark-role-binding
namespace: default
subjects:
- kind: ServiceAccount
name: spark-sa
namespace: default
#apiGroup: ""
roleRef:
kind: ClusterRole
name: spark-role
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment