ungleich-k8s/generic/role.yaml

43 lines
775 B
YAML
Raw Normal View History

2021-12-20 09:24:47 +00:00
apiVersion: v1
kind: ServiceAccount
metadata:
name: uncloud
---
2021-12-11 10:21:54 +00:00
apiVersion: rbac.authorization.k8s.io/v1
2021-12-20 09:24:47 +00:00
kind: ClusterRole
2021-12-11 10:21:54 +00:00
metadata:
2021-12-20 09:24:47 +00:00
namespace: '*'
2021-12-11 10:21:54 +00:00
name: service-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["services"]
verbs: ["get", "watch", "list"]
---
2021-12-20 09:24:47 +00:00
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"