Skip to content

Instantly share code, notes, and snippets.

@jcorioland
Created October 16, 2017 15:29
Show Gist options
  • Save jcorioland/ece37e967fedab436c63c59260a62bcb to your computer and use it in GitHub Desktop.
Save jcorioland/ece37e967fedab436c63c59260a62bcb to your computer and use it in GitHub Desktop.

Revisions

  1. jcorioland created this gist Oct 16, 2017.
    71 changes: 71 additions & 0 deletions create-acs-kubernetes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    # Create an Azure Container Service Kubernetes Cluster with Azure CLI

    ## Login (interactive) to your Azure subscription using Azure CLI

    ```
    az login
    ```

    ## Create a resource group

    ```
    az group create --name acs-k8s-rg --location westeurope
    ```

    ## Optional - Create a new SSH key with keygen (interactive)

    ```
    ssh-keygen
    ```

    ## Create a Kubernetes cluster using Azure Container Service

    ```
    az acs create --name acs-k8s --location westeurope --resource-group acs-k8s-rg --ssh-key-value ~/roaming/ssh/acs_k8s_rsa.pub --agent-count 2 --orchestrator-type kuberne
    tes
    ```

    ## Download kubectl

    ```
    az acs kubernetes install-cli --install-location ~/bin/kubectl
    ```

    ## Download the Kubernetes cluster configuration

    ```
    az acs kubernetes get-credentials --name acs-k8s --resource-group acs-k8s-rg --ssh-key-file ~/roaming/ssh/acs_k8s_rsa
    ```

    ## Download and install Helm

    ```
    wget https://storage.googleapis.com/kubernetes-helm/helm-v2.5.1-linux-amd64.tar.gz
    tar -xvf helm-v2.5.1-linux-amd64.tar.gz
    mv linux-amd64/helm ~/bin/helm
    rm -rf linux-amd64 helm-v2.5.1-linux-amd64.tar.gz
    ```

    ## Initialize Helm

    ```
    helm init
    ```

    ## Install kube-lego

    ```
    helm install stable/kube-lego --set config.LEGO_EMAIL=<valid-email>,config.LEGO_URL=https://acme-v01.api.letsencrypt.org/directory
    ```

    ## Install nginx-ingress

    ```
    helm install stable/nginx-ingress
    ```

    ## Configure DNS provider

    ```
    *.acs-k8s.your-domain.com
    ```