{"id":20376695,"url":"https://github.com/andrebriggs/azure-tf-k8s","last_synced_at":"2026-03-05T21:12:58.125Z","repository":{"id":150973497,"uuid":"163446518","full_name":"andrebriggs/azure-tf-k8s","owner":"andrebriggs","description":"Quick POC of creating AKS via Terrafform","archived":false,"fork":false,"pushed_at":"2020-02-10T07:16:24.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T21:42:19.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrebriggs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-28T20:21:39.000Z","updated_at":"2020-02-10T07:16:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9c1b71c-a51b-441b-9919-c591a49c0583","html_url":"https://github.com/andrebriggs/azure-tf-k8s","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrebriggs/azure-tf-k8s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrebriggs%2Fazure-tf-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrebriggs%2Fazure-tf-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrebriggs%2Fazure-tf-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrebriggs%2Fazure-tf-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrebriggs","download_url":"https://codeload.github.com/andrebriggs/azure-tf-k8s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrebriggs%2Fazure-tf-k8s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30150058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T01:39:10.870Z","updated_at":"2026-03-05T21:12:58.081Z","avatar_url":"https://github.com/andrebriggs.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.12.0-blue.svg)\n\n# Setting up AKS (Azure k8s) via Terraform\n\nThe instructions assume you have Azure CLI and Terraform. In Azure CLI make sure your you have \"set\" a subscription.\n\n## Create an Azure service principal\n\n```bash\naz ad sp create-for-rbac --role=\"Contributor\" --scopes=\"/subscriptions/$AZURE_SUBSCRIPTION_ID\"\n```\n\nSave the output results somewhere.\n\n## Create an Azure resource group\n\n```bash\naz group create -l $RESOURCE_GROUP_LOCATION -n $RESOURCE_GROUP_NAME\n```\n\n## Create Storage account \n\nNavigate to the k8s directory ```cd k8s```\n\nRun the shell script [setup-az-storage.sh](k8s/setup-az-storage.sh). Replace variables with your own. This file defines an Azure Blob container to store the terraform state.\n\n## Getting started with what's inside the repo\n\n### [variables.tf](k8s/variables.tf)\n\nAdjust the values for each key in [variables.tf](k8s/variables.tf) to your liking. \n\nPlease make sure the value fo the ssh_public_key exists. If not please create it by navigating to your ```~/.ssh``` directory and running ```ssh-keygen -o```\n\n### [main.tf](k8s/main.tf)\n\nThis file defines the environment landscape you want to declaratively describe. The default file creates a resource group, log analytics, and an AKS cluster. Edit this file to your liking.\n\n### [output.tf](k8s/output.tf)\n\nThis file describes the output variables you will see when Terraform applies a [plan](https://www.terraform.io/docs/configuration/outputs.html).\n\n## Set service principal info for Terraform\n\nRun the shell script [set-sp-variables.sh](k8s/set-sp-variables.sh) and replace or set the environment variables with the output from creating the Azure Service Principal\n\n## How deploy with Terraform\n\nTypical Terraform commands are _init_, _plan_, then _apply_\n\nRun the `terraform_init_backend.sh` file to setup your backend.\n\nThen run:\n\n```bash\nterraform plan -out out.plan\n```\n\nIf no errors then run. This may take several minutes to run\n\n```bash\nterraform apply out.plan\n```\n\nFinally once a successful install has happened run kubbectl to verify the nodes are running. To configure kubctl first run\n\n```bash\necho \"$(terraform output kube_config)\" \u003e ./azurek8s\n```\n\nthen\n\n```bash\nexport KUBECONFIG=./azurek8s\n```\n\nThe above sets your kube config to this file. Consequently kubctl will only see this context when you run ```kubectl config get-contexts```\n\nAlternatively if using AKS you can set the context to your cluster using the Azure CLI\n\u003cpre\u003e\naz aks get-credentials --resource-group \u003cb\u003eRESOURCE_GROUP_NAME_HERE\u003c/b\u003e --name \u003cb\u003eCLUSTER_NAME_HERE\u003c/b\u003e \n\u003c/pre\u003e\n\nRun the following to verify\n\n```bash\nkubectl get nodes\n```\n\n\n# How to tear down \n\nRun ```az group delete --name $RESOURCE_GROUP_NAME```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrebriggs%2Fazure-tf-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrebriggs%2Fazure-tf-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrebriggs%2Fazure-tf-k8s/lists"}