Skip to content

Commit

Permalink
completed Camel K operator provisioning with 4.14
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoNetId committed Apr 30, 2024
1 parent e543ec8 commit e3f80eb
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tabs:
- title: Terminal 1
type: terminal
hostname: crc
cmd: /bin/bash
- title: Web Console
type: website
url: https://console-openshift-console.crc-97g8f-master-0.crc.${_SANDBOX_ID}.instruqt.io
Expand Down
14 changes: 7 additions & 7 deletions instruqt-tracks/serverless-camel-k-basic/01-step1/setup-crc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

# workaround for OpenShift 4.11 log accessibility issue:
sudo cp /etc/machine-config-daemon/orig/var/lib/kubelet/config.json.mcdorig /var/lib/kubelet/config.json
# # workaround for OpenShift 4.11 log accessibility issue:
# sudo cp /etc/machine-config-daemon/orig/var/lib/kubelet/config.json.mcdorig /var/lib/kubelet/config.json

curl -sL https://raw.githubusercontent.com/openshift-instruqt/instruqt/v0.0.4/serverless/camel-k-basic/scripts/operator-install.yaml -o /opt/operator-install.yaml
# curl -sL https://raw.githubusercontent.com/openshift-instruqt/instruqt/v0.0.4/serverless/camel-k-basic/scripts/operator-install.yaml -o /opt/operator-install.yaml

CAMELK_VERSION=1.6.7
# CAMELK_VERSION=1.6.7

curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/camel-k/$CAMELK_VERSION/camel-k-client-$CAMELK_VERSION-linux-64bit.tar.gz | tar -xz -C /usr/local/bin
chmod +x /usr/local/bin/kamel
# curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/camel-k/$CAMELK_VERSION/camel-k-client-$CAMELK_VERSION-linux-64bit.tar.gz | tar -xz -C /usr/local/bin
# chmod +x /usr/local/bin/kamel

mkdir -p /root/camel-basic
# mkdir -p /root/camel-basic
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tabs:
- title: Terminal 1
type: terminal
hostname: crc
cmd: /bin/bash
- title: Visual Editor
type: code
hostname: crc
Expand Down
5 changes: 4 additions & 1 deletion instruqt-tracks/serverless-camel-k-basic/02-step2/setup-crc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

# workaround for OpenShift 4.11 log accessibility issue:
sudo cp /etc/machine-config-daemon/orig/var/lib/kubelet/config.json.mcdorig /var/lib/kubelet/config.json
# sudo cp /etc/machine-config-daemon/orig/var/lib/kubelet/config.json.mcdorig /var/lib/kubelet/config.json

# export KUBECONFIG=/root/camel-basic/.kube/config
# cd /root/camel-basic
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tabs:
- title: Terminal 1
type: terminal
hostname: crc
cmd: /bin/bash
- title: Visual Editor
type: code
hostname: crc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tabs:
- title: Terminal 1
type: terminal
hostname: crc
cmd: /bin/bash
- title: Visual Editor
type: code
hostname: crc
Expand Down
2 changes: 1 addition & 1 deletion instruqt-tracks/serverless-camel-k-basic/track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ lab_config:
position: right
feedback_recap_enabled: true
loadingMessages: true
checksum: "16167226945418464627"
checksum: "14329129069691988093"
49 changes: 49 additions & 0 deletions instruqt-tracks/serverless-camel-k-basic/track_scripts/setup-crc
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,57 @@ CAMELK_VERSION=1.10.6
curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/camel-k/$CAMELK_VERSION/camel-k-client-$CAMELK_VERSION-linux-64bit.tar.gz | tar -xz -C /usr/local/bin
chmod +x /usr/local/bin/kamel

oc new-project camel-basic

mkdir -p /root/camel-basic

# cp -r /var/roothome/.kube /var/roothome/camel-basic
cd /var/roothome/camel-basic



oc apply -f /opt/operator-install.yaml -n camel-basic

until [[ `oc get csv -n camel-basic -oname` != '' ]]; do
echo "waiting for Camel K subscription";
sleep 5;
done

CSV=`oc get csv -n camel-basic -oname`
echo "CSV is: $CSV"

echo "Wait for installation to finish."
until [[ `oc get $CSV -n camel-basic -o jsonpath='{.status.phase}'` == 'Succeeded' ]]; do
echo "waiting for Camel K operator installation...";
sleep 5;
done

kamel init hello.java
kamel run hello.java -n camel-basic

until [[ `oc get it -n camel-basic -oname` != '' ]]; do
echo "waiting for Camel K integration creation";
sleep 5;
done

echo "Integration created."
echo "Wait for integration to run."
until [[ `oc get it hello -n camel-basic -o jsonpath="{.status.phase}"` == 'Running' ]]; do
echo "waiting for Camel K instegration to run...";
sleep 5;
done

echo "Integration now running."
echo "Deleting integration."

oc delete it hello -n camel-basic
rm hello.java


echo "Installation of Camel K operator completed."



###

until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
Expand Down

0 comments on commit e3f80eb

Please sign in to comment.