1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 01:06:27 +00:00
prometheus-operator/scripts/kind-rbac.yaml
Simon Pasquier e785105f35 *: remove Kube API versions dropped in v1.22
Kubernetes v1.22 will stop serving API versions that were deprecated a
while ago. This change cleans up any reference to these API versions in
the operator's code and documentation.

[1] https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2021-07-16 15:10:22 +02:00

78 lines
1.6 KiB
YAML

# Wide open access to the cluster (mostly for kubelet)
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-writer
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
- nonResourceURLs: ["*"]
verbs: ["*"]
---
# Full read access to the api and resources
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-reader
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "list", "watch"]
- nonResourceURLs: ["*"]
verbs: ["*"]
---
# Give admin, kubelet, kube-system, kube-proxy god access
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-write
subjects:
- kind: User
name: admin
- kind: User
name: kubelet
- kind: ServiceAccount
name: default
namespace: kube-system
- kind: User
name: kube-proxy
roleRef:
kind: ClusterRole
name: cluster-writer
apiGroup: rbac.authorization.k8s.io
---
# Setup sd-build as a reader. This has to be a
# ClusterRoleBinding to get access to non-resource URLs
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-read
subjects:
- kind: ServiceAccount
name: sd-build
namespace: default
roleRef:
kind: ClusterRole
name: cluster-reader
apiGroup: rbac.authorization.k8s.io
---
# Setup sd-build as a writer in its namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: sd-build-write
subjects:
- kind: ServiceAccount
name: sd-build
namespace: default
roleRef:
kind: ClusterRole
name: cluster-writer
apiGroup: rbac.authorization.k8s.io