Skip to content

rafaelcezario/hybrid-cloud

 
 

Repository files navigation

Hybrid Cloud

badge badge

Tested with skupper 0.1.0

TL;DR

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.

Services

Backend

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

Frontend

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

Cloud Providers

The next profiles are provided: -Pazr, -Paws, -Pgcp and -Plocal, this just sets an environment variable to identify the cluster.

Setting up Skupper

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).

Install the Skupper CLI

Follow the instructions provided here.

Skupper setup

  1. In your public terminal session :

skupper init --id public
skupper connection-token private-to-public.yaml
  1. In your local terminal session :

skupper init --id private
skupper connect private-to-public.yaml

Annotate the services to join to the Virtual Application Network

  1. In the terminal for the local cluster, annotate the hybrid-cloud-backend service:

kubectl annotate service hybrid-cloud-backend skupper.io/proxy=http
  1. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 33.7%
  • JavaScript 32.3%
  • HTML 17.3%
  • CSS 16.7%