-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example of deploying "hello world" with Shipyard
This exemplifies how the deployment on top of shipyard would work. This would probably be best put in the example repo itself, but I drafted it to make it clear how using Shipyard looks like. Signed-off-by: Mike Kolesnik <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
nodes: control-plane worker | ||
clusters: | ||
west: | ||
east: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -em | ||
|
||
source "${SCRIPTS_DIR}/lib/utils" | ||
source "${SCRIPTS_DIR}/lib/debug_functions" | ||
|
||
print_env SETTINGS | ||
declare_kubeconfig | ||
|
||
on_ctx() { | ||
"$2" --context "$1" "${@:3}" | ||
} | ||
|
||
# Create namespaces | ||
on_ctx west kubectl create namespace west | ||
kubectl config set-context west --namespace west | ||
on_ctx east kubectl create namespace east | ||
kubectl config set-context east --namespace east | ||
|
||
# Initialize and link | ||
on_ctx west ./skupper init --enable-console --enable-flow-collector | ||
on_ctx east ./skupper init | ||
on_ctx west ./skupper token create ${DAPPER_OUTPUT}/secret.token | ||
on_ctx east ./skupper link create ${DAPPER_OUTPUT}/secret.token | ||
|
||
# Deploy and expose services | ||
on_ctx west kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend | ||
on_ctx west kubectl expose deployment/frontend --port 8080 --type LoadBalancer | ||
on_ctx east kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3 | ||
on_ctx east ./skupper expose deployment/backend --port 8080 | ||
|
||
# Wait for service to become healthy | ||
svc_ip=$(on_ctx west kubectl get service/frontend -o jsonpath={.status.loadBalancer.ingress[0].ip}) | ||
with_retries 30 sleep_on_fail 5s curl "http://${svc_ip}:8080/api/health" | ||
|
||
echo "Success! You can access the web UI at http://${svc_ip}:8080" |