Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a "user1" account #117

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 01-logging-in-via-the-web-console
id: vvndcjg6jy2x
id: eow4omjjrxub
type: challenge
title: Topic 1 - Logging in Via the Web Console
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 02-logging-in-via-the-command-line
id: jhfhyx567dbp
id: 897yiqcgfb5j
type: challenge
title: Topic 2 - Logging in via the Command Line
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 03-collaborating-with-other-users
id: pw2tvtuhguco
id: 9ev1ansjytjy
type: challenge
title: Topic 3 - Collaborating with Other Users
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 04-switching-between-accounts
id: lvk1hzl0nvz3
id: lwj7kidt0q8c
type: challenge
title: Topic 4 - Switching Users Between Accounts
notes:
Expand Down
5 changes: 3 additions & 2 deletions using-the-cluster/cluster-access/track.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
slug: using-the-cluster-cluster-access
id: ivjwdhbf3xhl
id: tyrhthzthmld
type: track
title: Logging in to an OpenShift Cluster
description: |
Expand Down Expand Up @@ -30,6 +30,7 @@ developers:
- bob@cogarttech.com
- dschenck@redhat.com
- nvinto@redhat.com
- ryanj@redhat.com
private: true
published: false
checksum: "15913648057833144714"
checksum: "1367357203657365830"
34 changes: 32 additions & 2 deletions using-the-cluster/cluster-access/track_scripts/setup-crc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,38 @@ sed -i '/^search.*/a nameserver 10.88.0.8' /etc/resolv.conf
systemctl start crc-dnsmasq.service
systemctl start kubelet


# User Accounts

cat << EOF > /tmp/pass.htpasswd
admin:\$2y\$05\$Sokv3so/TbycwilNeV6L6.lMIYT0ClbaW/RsPssFIBY.BWanJyMwe
developer:\$apr1\$PFGWfRKw\$DbBab3TIlvsZGmHjVbehv0
user1:\$apr1\$AWRDy/5p\$FgzPPvIIqhe3ZbWCgk4Cc1
EOF

cat << EOF > /tmp/oauth-admin.yaml
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
name: cluster
spec:
identityProviders:
- name: admin_htpasswd_provider
mappingMethod: claim
type: HTPasswd
htpasswd:
fileData:
name: htpass-secret-admin
EOF

until oc create secret generic htpass-secret-admin --from-file=htpasswd=/tmp/pass.htpasswd -n openshift-config -o yaml --dry-run=client 2>/dev/null | oc create -f - ; do echo "Add admin secret. This fails when the apiserver is not ready."; sleep 5; done
until oc apply -f /tmp/oauth-admin.yaml 2>/dev/null 1>&2; do echo "Adding admin user. This fails when the apiserver is not ready."; sleep 5; done
until oc create clusterrolebinding adminclusteradmin --clusterrole=cluster-admin --user=admin 2>/dev/null 1>&2; do echo "Config admin policy. This fails when the apiserver is not ready."; sleep 5; done
until oc create clusterrolebinding devsudoer --clusterrole=sudoer --user=developer 2>/dev/null 1>&2; do echo "adding sudoer role to the developer account"; sleep 5; done

rm /tmp/oauth-admin.yaml /tmp/pass.htpasswd


# INGRESS

# Check for cert expiration
Expand Down Expand Up @@ -107,8 +139,6 @@ do
echo "AVAILABLE"
done



# INGRESS

# check if ingresses.config.openshift.io cluster is present
Expand Down