Demo Multicluster
This commit is contained in:
@@ -73,7 +73,7 @@ helm install admiralty oci://public.ecr.aws/admiralty/admiralty \
|
||||
--wait
|
||||
|
||||
echo "🌐 Configuring /etc/hosts..."
|
||||
CLUSTER_IP=$(kubectl get svc kubernetes -o jsonpath='{.spec.clusterIP}')
|
||||
CLUSTER_IP=$(ip -4 addr show $(ip route | awk '/default/ {print $5}') | awk '/inet / {print $2}' | cut -d/ -f1)
|
||||
|
||||
if grep -q "kubernetes.default.svc.cluster.local" /etc/hosts; then
|
||||
sudo sed -i "s/^.*kubernetes.default.svc.cluster.local/$CLUSTER_IP kubernetes.default.svc.cluster.local/" /etc/hosts
|
||||
@@ -85,6 +85,9 @@ ca=$(kubectl config view --raw --minify -o jsonpath='{.clusters[0].cluster.certi
|
||||
cert=$(kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-certificate-data}')
|
||||
key=$(kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-key-data}')
|
||||
|
||||
docker network create \
|
||||
--subnet=172.40.0.0/24 \
|
||||
discovery || true
|
||||
|
||||
REPOS=(
|
||||
"mongo"
|
||||
@@ -120,7 +123,7 @@ do
|
||||
docker rm $i || true
|
||||
done
|
||||
|
||||
REGISTRY= KUBE_CA=$ca KUBE_CERT=$cert KUBE_DATA=$key docker compose -f ./docker-compose.dev.yml up -d || true
|
||||
KUBE_CA=$ca KUBE_CERT=$cert KUBE_DATA=$key docker compose -f ./docker-compose.dev.yml up -d || true
|
||||
cd ./db-1 && ./add.sh && cd ..
|
||||
|
||||
# MISSING ADD DATAS
|
||||
@@ -156,7 +159,7 @@ do
|
||||
docker rm "$i" || true
|
||||
done
|
||||
|
||||
REGISTRY= KUBE_CA=$ca KUBE_CERT=$cert KUBE_DATA=$key docker compose -f ./docker-compose.dev2.yml up -d || true
|
||||
KUBE_CA=$ca KUBE_CERT=$cert KUBE_DATA=$key docker compose -f ./docker-compose.dev2.yml up -d || true
|
||||
# MISSING ADD DATAS
|
||||
cd ./db-2 && ./add.sh && cd ..
|
||||
|
||||
|
||||
Reference in New Issue
Block a user