setup

eksctl create cluster \
    --name=consul-mesh-gateway-cluster-2 \
    --nodes=3 \
    --node-ami=auto \
    --region=ap-northeast-1 \
    --version=1.16
gcloud container clusters create consul-mesh-gateway-cluster-1 --num-nodes=3
gcloud container clusters create consul-mesh-gateway-cluster-3 --num-nodes=3
gcloud container clusters get-credentials consul-mesh-gateway-cluster-1 --zone us-central1-c --project se-kabu
kc apply -f ns.yaml
helm install -f helm/consul-values-gke-1.yaml consul hashicorp/consul  --wait -n multicluster-servicemesh
kc get secret consul-federation -o yaml -n multicluster-servicemesh > consul-federation-secret.yaml
gcloud container clusters get-credentials consul-mesh-gateway-cluster-3 --zone asia-northeast1-a --project se-kabu
kc apply -f ns.yaml
kc apply -f consul-federation-secret.yaml
helm install -f helm/consul-values-gke-2.yaml consul hashicorp/consul  --wait -n multicluster-servicemesh
aws eks --region ap-northeast-1 update-kubeconfig --name consul-mesh-gateway-cluster-2
kc apply -f ns.yaml
kc apply -f consul-federation-secret.yaml
helm install -f helm/consul-values-eks.yaml consul hashicorp/consul  --wait -n multicluster-servicemesh
./deploy.sh 0

setup Procy config

export CONSUL_HTTP_ADDR=xxx # GKE
consul config write proxy-config/hcx-svc-router.hcl
consul config write ingress-gateway/ingress-gateway.hcl
consul config write ingress-gateway/teminating-gateway.hcl
consul config write proxy-config/japan-svc-defaults.hcl
consul config write proxy-config/france-svc-defaults.hcl
consul config write proxy-config/corpx-svc-defaults.hcl
consul config write proxy-config/country-svc-defaults.hcl
consul config write proxy-config/country-svc-router.hcl
consul config write proxy-config/corpx-svc-resolver.hcl

Ingress Gateway

Deploy UI App on Heroku

git clone -b heroku https://github.com/tkaburagi/mesh-ui
rm -rf .git
heroku login
git init
git add .
git commit -m "first commit"
heroku create

Temrinating Gateway

Deploy UI App on Google Compute Engine

This Instance is public, you can use with the same parameters in regist-hashi.json

curl --request PUT --data @terminating-gateway/regist-hashi.json -k $CONSUL_HTTP_ADDR/v1/catalog/register
consul config write proxy-config/hashi-svc-defaults.hcl
consul config write terminating-gateway/terminating-gateway.hcl

Consul UI

Access to App

  • https://<random-route>.herokuapp.com/japan
  • https://<random-route>.herokuapp.com/france

Trying faileover

gcloud container clusters get-credentials consul-mesh-gateway-cluster-1 --zone us-central1-c --project se-kabu
kc delete -f corp-gke-1.yaml -n=multicluster-servicemesh

access again!