Important
|
If you are using minikube as one cluster, run minikube tunnel in a new terminal:
|
Deploy the backend to all your clusters:
kubectl apply -f backend-{azr|aws|gcp|minikube}.yml
kubectl annotate service hybrid-cloud-backend skupper.io/proxy=http
Deploy the frontend to your main cluster:
kubectl apply -f frontend.yml
If frontend is not deployed in minikube
you need to expose the created ingress endpoint.
In case of OpenShift run: oc expose service hybrid-cloud-frontend
.
In your main cluster, init skupper
and create the connection-token
:
skupper init
skupper status
See the status of the skupper pods. It takes a bit of time until thepods are running:
kubectl get pods -w
Finally create a token:
skupper connection-token token.yaml
In all the other clusters, use the connection token created in the previous step:
skupper init
skupper connect token.yaml
Everything is connected and ready to be used. This has been the short-version to get started, continue reading if you want to learn how to build the Docker images, deply them , etc.
If you want to build, push and deploy the service:
cd backend
./mvnw clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Pazure
Service is already pushed in quay.io, so you can skip the push part:
cd backend
./mvnw clean package -DskipTests -Pazure -Dquarkus.kubernetes.deploy=true -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false
If you want to build, push and deploy the service:
cd backend
./mvnw clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Pazure
Service is already pushed in quay.io, so you can skip the push part:
cd backend
./mvnw clean package -DskipTests -Pazr -Dquarkus.kubernetes.deploy=true -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false
The next profiles are provided: -Pazr
, -Paws
, -Pgcp
and -Plocal
, this just sets an environment variable to identify the cluster.
Make sure you have a least the backend
project deployed on 2 different clusters. The frontend
project can be deployed to just one cluster.
Here, we will make the assumption that we have it deployed in a local cluster local and a public cluster public.
Make sure to have 2 terminals with separate sessions logged into each of your cluster with the correct namespace context (but within the same folder).
Follow the instructions provided here.
-
In your public terminal session :
skupper init --id public
skupper connection-token private-to-public.yaml
-
In your local terminal session :
skupper init --id private
skupper connect private-to-public.yaml
-
In the terminal for the local cluster, annotate the hybrid-cloud-backend service:
kubectl annotate service hybrid-cloud-backend skupper.io/proxy=http
-
In the terminal for the public cluster, annotate the hybrid-cloud-backend service:
kubectl annotate service hybrid-cloud-backend skupper.io/proxy=http
Both services are now connected, if you scale one to 0 or it gets overloaded it will transparently load-balance to the other cluster.