Skip to content

Instantly share code, notes, and snippets.

@seanknox
Last active May 9, 2017 21:29
Show Gist options
  • Save seanknox/fd69cb29077a0979384742b5109858ad to your computer and use it in GitHub Desktop.
Save seanknox/fd69cb29077a0979384742b5109858ad to your computer and use it in GitHub Desktop.
#!/bin/bash
set -ex
daz() {
docker run -v $GOPATH/src/github.com/Azure/acs-engine:/acs-engine -v $HOME/.azure:/root/.azure -it --rm azuresdk/azure-cli-python:latest az $*
}
export CLUSTER_NAME=$1
export CLUSTER_LOCATION=$2
export -f daz
make build
mkdir -p ${CLUSTER_NAME}
cp kubernetes-template.json ${CLUSTER_NAME}/kubernetes.json
sed -ie s/CLUSTER_NAME/${CLUSTER_NAME}/ ${CLUSTER_NAME}/kubernetes.json
./acs-engine -artifacts ${CLUSTER_NAME}/ ${CLUSTER_NAME}/kubernetes.json
daz group create --name="${CLUSTER_NAME}" --location="${CLUSTER_LOCATION}"
daz group deployment create --verbose --name="${CLUSTER_NAME}" --resource-group="${CLUSTER_NAME}" \
--template-file "/acs-engine/${CLUSTER_NAME}/azuredeploy.json" \
--parameters "@/acs-engine/${CLUSTER_NAME}/azuredeploy.parameters.json"
scp azureuser@${CLUSTER_NAME}.${LOCATION}.cloudapp.azure.com:~/.kube/config ~/.kube/$CLUSTER_NAME
set +x
echo "***********************************************************"
echo "Run the following to connect to your cluster's Kubernetes API:"
echo -n
echo -n
echo "export KUBECONFIG=~/.kube/$CLUSTER_NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment