Skip to content

Commit

Permalink
airgapped: add step in script to expose the dashboard (#907)
Browse files Browse the repository at this point in the history
* airgapped: add step in script to expose the dashboard
* feat: add error catching
* comment: link to the source of gateway service name
  • Loading branch information
NohaIhab authored Jun 4, 2024
1 parent 12e1ba2 commit 62d5a02
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/airgapped/airgap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,32 @@ function setup_microk8s() {
airgap_wait_for_pods "$NAME"
}

function create_ingress_object_in_kubeflow_namespace() {
local NAME=$1
if ! lxc exec "$NAME" -- bash -c 'cat <<EOF | microk8s kubectl apply -n kubeflow -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: http-ingress
namespace: kubeflow
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
# Name must match the Service in [istio-gateway manifests](https://github.com/canonical/istio-operators/blob/track/1.17/charms/istio-gateway/src/manifest.yaml#L296)
name: istio-ingressgateway-workload
port:
number: 80
EOF'; then
echo "Error: Failed to create Ingress object in Kubeflow namespace"
return 1
fi
}

function post_airgap_tests() {
local AIRGAPPED_NAME=$2
lxc rm "$AIRGAPPED_NAME" --force
Expand Down Expand Up @@ -152,6 +178,9 @@ then
make_machine_airgapped "$AIRGAPPED_NAME"
echo "10/X -- Initialize Kubeflow model in JuJu"
init_juju_model "$AIRGAPPED_NAME" "$JUJU_CHANNEL"
echo "11/X -- Create Ingress in Kubeflow namespace"
create_ingress_object_in_kubeflow_namespace "$AIRGAPPED_NAME"

#echo "Cleaning up"

lxc exec "$AIRGAPPED_NAME" -- bash -c "bash"
Expand Down

0 comments on commit 62d5a02

Please sign in to comment.