ungleich-k8s/generic/role.yaml
Nico Schottelius 52bec8f0c5 ++role test
2021-12-20 10:24:47 +01:00

42 lines
775 B
YAML

apiVersion: v1
kind: ServiceAccount
metadata:
name: uncloud
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
namespace: '*'
name: service-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["services"]
verbs: ["get", "watch", "list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: uncloud-binding
subjects:
- kind: ServiceAccount
name: uncloud
namespace: default
roleRef:
kind: ClusterRole
name: service-reader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Pod
metadata:
name: kubectl-pod
spec:
serviceAccountName: uncloud
containers:
- name: kubectl
image: bitnami/kubectl:latest
args:
- sh
- -c
- sleep
- "1000000"