Skip to content

Instantly share code, notes, and snippets.

@janakiramm
Created August 26, 2017 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janakiramm/b9f4dc15cc68e3fb2ce4a7aea3527424 to your computer and use it in GitHub Desktop.
Save janakiramm/b9f4dc15cc68e3fb2ce4a7aea3527424 to your computer and use it in GitHub Desktop.
Script to deploy an app in Azure Container Instances through the Kubernetes cluster running in Google Container Engine
# 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