From 40f0ab6b6662b117a553f55db41d42a2497af271 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Tue, 13 Feb 2024 14:32:09 -0500 Subject: [PATCH] Issue #3: Update README.md --- README.md | 21 ++++++++++++++++-- .../azure-kubernetes-cluster/variables.tf | 4 ++-- terraform/staging/main.tf | 8 +++---- terraform/staging/variables.tf | 22 ++++++++++++++++++- 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e4a1ac8c..cbb690d5 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,13 @@ In this repository, you can find the Kubernetes manifests that deploy each of the applications on the three different cloud providers: Google Cloud Platform (GCP), Amazon Web Services (AWS), and Azure. +## Dependencies + +- [Terraform](https://www.terraform.io/downloads.html) +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) +- [kubelogin](https://github.com/Azure/kubelogin) + ## Content - The Terraform configuration for the GCP cluster. @@ -30,9 +37,19 @@ and Cert Manager to meet our requirements. [ai-cfia github container registry](https://github.com/orgs/ai-cfia/packages) -## Local Development +## Terraform Deployment + +Current configuration is hosting a kubernetes cluster on Azure (AKS). We have an +Azure Devops pipeline `apply-terraform.yml` that applies terraform's resources +that are created on our Azure's subscription. The state is then saved to a blob +storage in Azure. + +## Kubectl configuration -To locally fetch the kube config, here are the steps ` +Assuming you have [Azure's +CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) and +[kubelogin](https://github.com/Azure/kubelogin) plugin installed, here is how +you can locally fetch the kube config : ```bash az login diff --git a/terraform/modules/azure-kubernetes-cluster/variables.tf b/terraform/modules/azure-kubernetes-cluster/variables.tf index e58811a9..3d107e90 100644 --- a/terraform/modules/azure-kubernetes-cluster/variables.tf +++ b/terraform/modules/azure-kubernetes-cluster/variables.tf @@ -68,7 +68,7 @@ variable "tags" { variable "k8s_version" { description = "(Optional) Version of Kubernetes specified when creating the AKS managed cluster. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade)." type = string - default = "1.23.5" + default = "1.28" } variable "managed" { @@ -80,7 +80,7 @@ variable "managed" { variable "rbac_enabled" { description = "(Required) Is Role Based Access Control Enabled? Changing this forces a new resource to be created." type = bool - default = false + default = true } variable "vm_size" { diff --git a/terraform/staging/main.tf b/terraform/staging/main.tf index 70991062..7e1067fe 100644 --- a/terraform/staging/main.tf +++ b/terraform/staging/main.tf @@ -1,10 +1,10 @@ terraform { backend "azurerm" { - resource_group_name = "rg-ai-cfia-terraform-state" - storage_account_name = "tfcfiastate" - container_name = "infra-terraform-state" - key = "tf/terraform.tfstate" + resource_group_name = var.terraform_state_resource_group_name + storage_account_name = var.terraform_state_storage_account_name + container_name = var.terraform_state_container_name + key = var.terraform_state_key } # backend "gcs" { diff --git a/terraform/staging/variables.tf b/terraform/staging/variables.tf index 88bd222b..16c93ad8 100644 --- a/terraform/staging/variables.tf +++ b/terraform/staging/variables.tf @@ -1,3 +1,23 @@ +variable "terraform_state_resource_group_name" { + description = "Name of the resource group for the Terraform state" + type = string +} + +variable "terraform_state_storage_account_name" { + description = "Name of the storage account for the Terraform state" + type = string +} + +variable "terraform_state_container_name" { + description = "Name of the container for the Terraform state" + type = string +} + +variable "terraform_state_key" { + description = "Key (filename) of the Terraform state file" + type = string +} + variable "location_1" { description = "Azure cloud first computing region" type = string @@ -40,7 +60,7 @@ variable "auto_scaling_default_node" { variable "zones" { description = "A list of Availability Zones across which the Node Pool should be spread. Changing this forces a new resource to be created." type = list(string) - default = ["1", "2"] + default = ["1"] } variable "node_count" {