Kubernetes example: Add RBAC resources and serviceAccount to YAML manifest, remove some references to deprecated TPR approach
This commit is contained in:
		| @@ -11,6 +11,7 @@ spec: | ||||
|       labels: | ||||
|         app: dex | ||||
|     spec: | ||||
|       serviceAccountName: dex # This is created below | ||||
|       containers: | ||||
|       - image: quay.io/dexidp/dex:v2.10.0 | ||||
|         name: dex | ||||
| @@ -104,3 +105,35 @@ spec: | ||||
|     nodePort: 32000 | ||||
|   selector: | ||||
|     app: dex | ||||
| --- | ||||
| apiVersion: v1 | ||||
| kind: ServiceAccount | ||||
| metadata: | ||||
|   labels: | ||||
|     app: dex | ||||
|   name: dex | ||||
| --- | ||||
| apiVersion: rbac.authorization.k8s.io/v1beta1 | ||||
| kind: ClusterRole | ||||
| metadata: | ||||
|   name: dex | ||||
| rules: | ||||
| - apiGroups: ["dex.coreos.com"] # API group created by dex | ||||
|   resources: ["*"] | ||||
|   verbs: ["*"] | ||||
| - apiGroups: ["apiextensions.k8s.io"] | ||||
|   resources: ["customresourcedefinitions"] | ||||
|   verbs: ["create"] # To manage its own resources, dex must be able to create customresourcedefinitions | ||||
| --- | ||||
| apiVersion: rbac.authorization.k8s.io/v1beta1 | ||||
| kind: ClusterRoleBinding | ||||
| metadata: | ||||
|   name: dex | ||||
| roleRef: | ||||
|   apiGroup: rbac.authorization.k8s.io | ||||
|   kind: ClusterRole | ||||
|   name: dex | ||||
| subjects: | ||||
| - kind: ServiceAccount | ||||
|   name: dex           # Service account assigned to the dex pod, created above | ||||
|   namespace: default  # The namespace dex is running in | ||||
|   | ||||
		Reference in New Issue
	
	Block a user