docker-android/aks-terraform
2018-10-12 18:17:12 -05:00
..
kompose Kompose/volumes.yaml deleted 2018-10-12 18:17:12 -05:00
kompose.yml Running in AKS using Terraform, Azure CLI, Kompose & Kubectl 2018-10-10 18:27:18 -05:00
main.tf Running in AKS using Terraform, Azure CLI, Kompose & Kubectl 2018-10-10 18:27:18 -05:00
provider.tf Running in AKS using Terraform, Azure CLI, Kompose & Kubectl 2018-10-10 18:27:18 -05:00
README.md Custom chart for running in AKS (recommended) 2018-10-12 18:14:26 -05:00
services_deployments.yaml Custom chart for running in AKS (recommended) 2018-10-12 18:15:21 -05:00
terraform.tfvars Running in AKS using Terraform, Azure CLI, Kompose & Kubectl 2018-10-10 18:27:18 -05:00
variables.tf Running in AKS using Terraform, Azure CLI, Kompose & Kubectl 2018-10-10 18:27:18 -05:00
volumes.yaml Custom chart for running in AKS (recommended) 2018-10-12 18:15:21 -05:00

Kubernetes & Azure (AKS, Terraform, Kompose, Kubectl, Azure CLI)

  • Azure CLI configuration
  • Infrastructure as code for Azure
  • Generating Kubernetes configuration files with Kompose (Services, Deployments, Pods & Persistent volumes)
  • Terraform with Azure Provider
  • Kubectl configuration

Setting up Azure CLI

Create infrastucture in Azure (AKS Service with node master)

Terraform version >= v0.11.7

$ terraform init
$ terraform plan
$ terraform apply

Setting up Kubectl with Azure account

  • For apply Kubernetes files:

First configurate azure-cli with Azure account and install kubernetes tools with az:

$ az aks install-cli 

Then log in in to the Azure Container Registry (if you're using it, but dockerhub or other):

$ az acr login

After that, connect to cluster with Kubectl:

$  az aks get-credentials --resource-group docker-android --name k8s-docker-android
  • You can use this approach or Kompose (Next 2 steps)
$ kubectl create -f volumes.yaml
$ kubectl create -f services_deployments.yaml

Generate Kube files with Kompose

Kompose version: >= 1.1.0

  • For convert to Kompose:
$ cd kompose
$ kompose convert -f ../kompose.yml

Execute Kube files (Kompose)

  • First create Persistent Volume Claims, then Services; finally Deployments files. For example:
$ cd kompose
$ kubectl create -f nexus-7.1.1-claim0-persistentvolumeclaim.yaml 
$ kubectl create -f nexus-7.1.1-claim1-persistentvolumeclaim.yaml 
$ kubectl create -f nexus-7.1.1-service.yaml 
$ kubectl create -f nexus-7.1.1-deployment.yaml