mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
sample-apiserver: Add RBAC roles and ClusterRoleBindings for Admission Webhooks
This commit is contained in:
parent
b005f2fba3
commit
33d31e4a55
@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: sample-apiserver-clusterrolebinding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: aggregated-apiserver-clusterrole
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: apiserver
|
||||
namespace: wardle
|
@ -0,0 +1,11 @@
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: aggregated-apiserver-clusterrole
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["namespaces"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: ["admissionregistration.k8s.io"]
|
||||
resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"]
|
||||
verbs: ["get", "watch", "list"]
|
@ -78,6 +78,10 @@ kubectl create -f artifacts/example/sa.yaml -n wardle
|
||||
kubectl create -f artifacts/example/auth-delegator.yaml -n kube-system
|
||||
kubectl create -f artifacts/example/auth-reader.yaml -n kube-system
|
||||
|
||||
# create rbac roles and clusterrolebinding that allow the service account user to use admission webhooks
|
||||
kubectl create -f artifacts/example/rbac.yaml
|
||||
kubectl create -f artifacts/example/rbac-bind.yaml
|
||||
|
||||
# create the service and replication controller
|
||||
kubectl create -f artifacts/example/rc.yaml -n wardle
|
||||
kubectl create -f artifacts/example/service.yaml -n wardle
|
||||
|
Loading…
Reference in New Issue
Block a user