Script to deploy an app in Azure Container Instances through the Kubernetes cluster running in Google Container Engine
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
# Configure GKE | |
gcloud container clusters create gke-aci --zone us-west1-a | |
gcloud container clusters get-credentials gke-aci --zone us-west1-a | |
kubectl get nodes | |
# Create an Azure Resource Group & Service Principal | |
az group create --name gke-aci --location westus | |
az account list -o table | |
az ad sp create-for-rbac --role=Contributor --scopes /subscriptions/<subscriptionId>/resourceGroups/gke-aci | |
az provider register -n Microsoft.ContainerInstance | |
# Configure Azure Cosmos DB | |
export DB=tododb$RANDOM | |
az cosmosdb create --name $DB --kind MongoDB -g gke-aci | |
az cosmosdb list-connection-strings -g gke-aci --name $DB | |
export CONNSTR=<Connection_String> # Replace with actual value | |
# Deploy the ACI Connector | |
git clone https://github.com/Azure/aci-connector-k8s.git | |
cd aci-connector-k8s | |
kubectl create -f examples/aci-connector.yaml | |
kubectl get pods | |
kubectl get nodes | |
# Deploy the web application | |
kubectl create -f web.yaml | |
# Verify the creation | |
kubectl get pod web -o wide | awk {'print $1" " $6" " $7'} | column -t | |
az container list --query [*].name | |
az container show --name web -g gke-aci --query ipAddress.ip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment