Skip to content

Commit

Permalink
update: rbac things
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow committed Oct 31, 2024
1 parent f15a32d commit effe77a
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 21 deletions.
1 change: 1 addition & 0 deletions clusters/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resources:
# - ../../components/cluster-configs/etcd-backup/overlays/default
# - ../../components/cluster-configs/namespace-cleanup/overlays/sandbox

- ../../components/cluster-configs/login/overlays/htpasswd
- ../../components/cluster-configs/namespaces/overlays/default
- ../../components/cluster-configs/rbac/overlays/no-self-provisioner

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- cluster-admins-group.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- ../../base
- workshop-admins-group.yaml
- workshop-users-group.yaml

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../components/groups-basic

resources:
- ../../base

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../components/groups-basic

resources:
- ../../base

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$patch: delete
kind: Group
apiVersion: user.openshift.io/v1
metadata:
name: cluster-admins
name: rhods-admins
users:
- 'b64:kube:admin'
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ kind: Component

resources:
- rolebinding.yaml
# - group.yaml
10 changes: 10 additions & 0 deletions scripts/library/ocp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

# https://mirror.openshift.com/pub/openshift-v4

ocp_add_admin_user(){
HT_USERNAME=${1:-admin}
HT_PASSWORD=${2:-$(genpass)}

htpasswd_ocp_get_file
htpasswd_add_user "${HT_USERNAME}" "${HT_PASSWORD}"
htpasswd_ocp_set_file
htpasswd_validate_user "${HT_USERNAME}" "${HT_PASSWORD}"
}

ocp_check_login(){
oc whoami || return 1
oc cluster-info | head -n1
Expand Down

0 comments on commit effe77a

Please sign in to comment.