GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docker-android/aks-terraform at master · darshan-org/docker-android

Expand file tree

/

aks-terraform

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

aks-terraform

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
kompose
kompose
 
 
README.md
README.md
 
 
kompose.yml
kompose.yml
 
 
main.tf
main.tf
 
 
provider.tf
provider.tf
 
 
services_deployments.yaml
services_deployments.yaml
 
 
terraform.tfvars
terraform.tfvars
 
 
variables.tf
variables.tf
 
 
volumes.yaml
volumes.yaml
 
 

README.md

Outline

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

  • Install Azure CLI -> https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
  • Execute sh $ az login and authenticate with your Azure account
  • Execute sh $ az account show --query "{subscriptionId:id, tenantId:tenantId" . Then copy subscriptionId and tenantId
  • Execute sh $ az account set --subscription="${SUBSCRIPTION_ID}" . Replace ${SUBSCRIPTION_ID} for your subscriptionId copied

Create infrastucture in Azure (AKS Service with node master)

Terraform version >= v0.11.7

  • Install Terraform -> https://www.terraform.io/downloads.html
  • Edit vars with Azure Account values in sh terraform.tfvars
  • After that:
$ 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

Running with custom K8s files (Recommended)

  • 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

  • Install Kompose -> https://github.com/kubernetes/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 
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.