Skip to content

Commit 18d0127

Browse files
committed
moving track to OpenShift 4-17
1 parent b758a29 commit 18d0127

File tree

6 files changed

+41
-32
lines changed

6 files changed

+41
-32
lines changed

instruqt-tracks/getting-started-with-openshift/01-explore-cli/assignment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tabs:
1515
- id: wfilzijgsri5
1616
title: Web Console
1717
type: website
18-
url: https://console-openshift-console.crc-lgph7-master-0.crc.${_SANDBOX_ID}.instruqt.io
18+
url: https://console-openshift-console.crc.${_SANDBOX_ID}.instruqt.io
1919
new_window: true
2020
difficulty: basic
2121
timelimit: 500
@@ -38,7 +38,7 @@ The `oc` command provides all of the functionality of the Kubernetes `kubectl` C
3838
Log into OpenShift from the command line on the left using the `oc login` command:
3939

4040
```
41-
oc login -u admin -p admin https://api.crc.testing:6443 --insecure-skip-tls-verify=true
41+
oc login -u admin -p admin
4242
```
4343

4444
✅ Login Confirmation

instruqt-tracks/getting-started-with-openshift/02-explore-console/assignment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tabs:
1515
- id: 8l2zmxlcgygg
1616
title: Web Console
1717
type: website
18-
url: https://console-openshift-console.crc-lgph7-master-0.crc.${_SANDBOX_ID}.instruqt.io
18+
url: https://console-openshift-console.crc.${_SANDBOX_ID}.instruqt.io
1919
new_window: true
2020
difficulty: basic
2121
timelimit: 500

instruqt-tracks/getting-started-with-openshift/03-routes/assignment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tabs:
1111
- id: gi8kgyikq4iw
1212
title: Web Console
1313
type: website
14-
url: https://console-openshift-console.crc-lgph7-master-0.crc.${_SANDBOX_ID}.instruqt.io
14+
url: https://console-openshift-console.crc.${_SANDBOX_ID}.instruqt.io
1515
new_window: true
1616
difficulty: basic
1717
timelimit: 500
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
version: "3"
22
virtualmachines:
33
- name: crc
4-
image: rhd-devx-instruqt/openshift-4-11-7-lgph7
4+
image: rhd-devx-instruqt/openshift-4-17-0
55
machine_type: n1-highmem-4
66
allow_external_ingress:
77
- http
88
- https
99
- high-ports
10+
provision_ssl_certificate: true

instruqt-tracks/getting-started-with-openshift/track.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ tags:
2727
owner: openshift
2828
developers:
2929
30-
sandbox_preset: openshift-411
30+
sandbox_preset: openshift-4-17
3131
lab_config:
3232
feedback_recap_enabled: true
3333
loadingMessages: true
3434
hideStopButton: false
3535
default_layout: AssignmentRight
3636
default_layout_sidebar_size: 33
37-
checksum: "11460986099944361592"
37+
checksum: "10162226549375334840"
3838
enhanced_loading: false

instruqt-tracks/getting-started-with-openshift/track_scripts/setup-crc

+33-25
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,36 @@ echo "export HOME=/root" > /tmp/.bashrc
1111
cat /root/.bashrc >> /tmp/.bashrc
1212
mv /tmp/.bashrc /root/.bashrc
1313

14-
ENS4IP=$(ip -4 -o addr show ens4 | awk '{print $4}' | cut -d "/" -f 1)
15-
1614
# set hostname
1715
#INSTRUQT_HOSTNAME=$(curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/attributes/hostname)
1816

19-
# Don't do this below causes issues later on, i believe.
20-
# hostnamectl set-hostname $HOSTNAME
21-
2217
eval $(curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/attributes/startup-script | grep INSTRUQT_PARTICIPANT_ID)
2318

24-
# dnsmasq config for crc-dnsmasq.service
25-
cat << EOF > /var/srv/dnsmasq.conf
26-
user=root
27-
port= 53
28-
bind-interfaces
19+
# start openshift
20+
systemctl start ovs-configuration.service
21+
BREXIP=$(ip -4 -o addr show br-ex | awk '{print $4}' | cut -d "/" -f 1)
22+
23+
cat << EOF > /etc/resolv.conf
24+
search c.rhd-devx-instruqt.internal google.internal
25+
nameserver $BREXIP
26+
nameserver 169.254.169.254
27+
EOF
28+
29+
systemctl reload NetworkManager
30+
31+
cat << EOF > /etc/dnsmasq.d/crc-dnsmasq.conf
32+
listen-address=$BREXIP
2933
expand-hosts
3034
log-queries
3135
local=/crc.testing/
3236
domain=crc.testing
33-
address=/apps-crc.testing/$ENS4IP
34-
address=/api.crc.testing/$ENS4IP
35-
address=/api-int.crc.testing/$ENS4IP
36-
address=/$HOSTNAME.crc.testing/192.168.126.11
37+
address=/apps-crc.testing/$BREXIP
38+
address=/api.crc.testing/$BREXIP
39+
address=/api-int.crc.testing/$BREXIP
40+
address=/crc.crc.testing/192.168.126.11
3741
EOF
3842

39-
sed -i '/^search.*/a nameserver 10.88.0.8' /etc/resolv.conf
40-
41-
# start openshift
42-
systemctl start crc-dnsmasq.service
43+
systemctl start dnsmasq.service
4344
systemctl start kubelet
4445

4546
# INGRESS
@@ -113,12 +114,17 @@ do
113114
echo "AVAILABLE"
114115
done
115116

116-
117+
# SSL Setup
118+
curl -s -o /etc/ssl/certs/sandbox.crt -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/ssl-certificate"
119+
curl -s -o /etc/ssl/certs/sandbox.key -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/ssl-certificate-key"
120+
oc --namespace openshift-ingress create secret tls custom-certs-default --cert=/etc/ssl/certs/sandbox.crt --key=/etc/ssl/certs/sandbox.key
121+
rm /etc/ssl/certs/sandbox.key
122+
#oc patch --type=merge --namespace openshift-ingress-operator ingresscontrollers/default --patch '{"spec":{"defaultCertificate":{"name":"custom-certs-default"}}}'
117123

118124
# INGRESS
119125

120126
# check if ingresses.config.openshift.io cluster is present
121-
oc patch -p '{"spec": {"domain": "'$HOSTNAME'.crc.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' ingresses.config.openshift.io cluster --type=merge
127+
oc patch -p '{"spec": {"domain": "'$HOSTNAME'.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' ingresses.config.openshift.io cluster --type=merge
122128

123129
# Wait 30 seconds for the old pod to be terminated
124130
sleep 30
@@ -133,7 +139,9 @@ metadata:
133139
namespace: openshift-ingress-operator
134140
spec:
135141
replicas: 1
136-
domain: $HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io
142+
domain: $HOSTNAME.$INSTRUQT_PARTICIPANT_ID.instruqt.io
143+
defaultCertificate:
144+
name: custom-certs-default
137145
EOF
138146

139147
oc rollout status deploy/oauth-openshift -n openshift-authentication
@@ -144,11 +152,11 @@ oc rollout status deploy/apiserver -n openshift-apiserver
144152
until oc get routes -A 2>/dev/null 1>&2; do echo "Changing routes, waiting for cluster operators..."; sleep 5; done
145153

146154

147-
oc patch -p '{"spec": {"host": "console-openshift-console.'$HOSTNAME'.crc.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' route console -n openshift-console --type=merge
155+
oc patch -p '{"spec": {"host": "console-openshift-console.'$HOSTNAME'.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' route console -n openshift-console --type=merge
148156

149-
oc patch -p '{"spec": {"host": "downloads-openshift-console.'$HOSTNAME'.crc.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' route downloads -n openshift-console --type=merge
157+
oc patch -p '{"spec": {"host": "downloads-openshift-console.'$HOSTNAME'.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' route downloads -n openshift-console --type=merge
150158

151-
oc patch -p '{"spec": {"host": "default-route-openshift-image-registry.'$HOSTNAME'.crc.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' route default-route -n openshift-image-registry --type=merge
159+
oc patch -p '{"spec": {"host": "default-route-openshift-image-registry.'$HOSTNAME'.'$INSTRUQT_PARTICIPANT_ID'.instruqt.io"}}' route default-route -n openshift-image-registry --type=merge
152160

153161

154162
#wait until cluster operators are "available"
@@ -232,7 +240,7 @@ do
232240
sleep 5
233241
done
234242

235-
while [ "$(curl -k -I https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io -o /dev/null -w '%{http_code}\n' -s 2>/dev/null)" != "200" ]
243+
while [ "$(curl -k -I https://console-openshift-console.$HOSTNAME.$INSTRUQT_PARTICIPANT_ID.instruqt.io -o /dev/null -w '%{http_code}\n' -s 2>/dev/null)" != "200" ]
236244
do
237245
echo "Waiting for web console - unavailable via curl"
238246
sleep 5

0 commit comments

Comments
 (0)