Skip to content

Commit

Permalink
Merge pull request OCP-on-NERC#16 from larsks/feature/github-idp
Browse files Browse the repository at this point in the history
Configure GitHub IDP and cluster-admin access
  • Loading branch information
larsks authored Jun 22, 2022
2 parents 969611b + 3a63cab commit 023c830
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- oauth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
release.openshift.io/create-only: "true"
name: cluster
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-admins-nerc-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-reader
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: cluster-admins
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-admins-nerc-sudoer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: sudoer
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: cluster-admins
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "false"
name: self-provisioners
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: self-provisioner
subjects: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: user.openshift.io/v1
kind: Group
metadata:
name: cluster-admins
users: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- group.yaml
6 changes: 6 additions & 0 deletions cluster-scope/bundles/cluster-admin-rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base/rbac.authorization.k8s.io/clusterrolebindings/cluster-admins-nerc-sudoer
- ../../base/rbac.authorization.k8s.io/clusterrolebindings/cluster-admins-nerc-reader
- ../../base/user.openshift.io/groups/cluster-admins
3 changes: 3 additions & 0 deletions cluster-scope/overlays/common/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ resources:
- machineconfigs/99-worker-ssh.yaml
- ../../base/operators.coreos.com/subscriptions/cert-manager
- ../../base/operators.coreos.com/subscriptions/external-secrets-operator
- ../../base/config.openshift.io/oauths/cluster
- ../../base/rbac.authorization.k8s.io/clusterrolebindings/self-provisioners
- ../../bundles/cluster-admin-rbac/
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: user.openshift.io/v1
kind: Group
metadata:
name: cluster-admins
annotations:
kustomize.config.k8s.io/behavior: replace
users:
- jtriley
- larsks
- tzumainn
- chrisstafford
- knikolla
- aabaris
- naved001
- joachimweyl
- mikthoma
4 changes: 4 additions & 0 deletions cluster-scope/overlays/nerc-ocp-infra/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ resources:
- ../../bundles/acm
- ../../bundles/odf
- clusterversion.yaml

patches:
- path: oauths/cluster_patch.yaml
- path: groups/cluster-admins_patch.yaml
15 changes: 15 additions & 0 deletions cluster-scope/overlays/nerc-ocp-infra/oauths/cluster_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
name: cluster
spec:
identityProviders:
- name: github
mappingMethod: claim
type: GitHub
github:
clientID: 77915cd4cdb5c4df7723
clientSecret:
name: github-client-secret
teams:
- ocp-on-nerc/nerc-ops

0 comments on commit 023c830

Please sign in to comment.