Skip to content

Commit

Permalink
RBAC for console backend to request openshift-config-managed configmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
jhadvig committed Jan 8, 2020
1 parent 9ff5192 commit 40ffc70
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
13 changes: 13 additions & 0 deletions manifests/03-rbac-role-ns-openshift-config-managed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,16 @@ rules:
- console-public
verbs:
- get
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: console-configmap-reader
namespace: openshift-config-managed
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
15 changes: 14 additions & 1 deletion manifests/04-rbac-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,17 @@ subjects:
- kind: ServiceAccount
name: console-operator
namespace: openshift-console-operator

---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: console-configmap-reader
namespace: openshift-config-managed
roleRef:
kind: Role
name: console-configmap-reader
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: console
namespace: openshift-console
6 changes: 6 additions & 0 deletions manifests/06-sa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ kind: ServiceAccount
metadata:
name: console-operator
namespace: openshift-console-operator
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: console
namespace: openshift-console
1 change: 1 addition & 0 deletions pkg/console/subresource/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func DefaultDeployment(operatorConfig *operatorv1.Console, cm *corev1.ConfigMap,
Annotations: annotations,
},
Spec: corev1.PodSpec{
ServiceAccountName: "console",
// we want to deploy on master nodes
NodeSelector: map[string]string{
// empty string is correct
Expand Down

0 comments on commit 40ffc70

Please sign in to comment.