GithubHelp home page GithubHelp logo

doytsujin / terraform-azure-aks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edalferes/terraform-azure-aks

0.0 1.0 0.0 1.65 MB

Terraform module to deploy an aks cluster at azure

HCL 100.00%

terraform-azure-aks's Introduction

terraform-azure-aks

Terraform module to deploy an aks cluster at azure

Description

This module creates an aks cluster and a service pricipal dedicated to its resources, a virtual network and subnet needs to be previously created. There is also the option to create a storage account of the MC resource group, to be used as persistence.

Example usage

  • Creating a cluster containing usage nodepool
location = "eastus2"
resource_group = "rg-my-cluster"
aks_name = "my-cluster"
admin_username = "my-user"
node_count = 1
auto_scaling_default_node = false
node_min_count = null
node_max_count = null
default_node_vm_size = "Standard_DS2_v2"

additional_node_pools = {
  "pooltest" = {
		vm_size = "Standard_DS2_v2"
    os_disk_size_gb = 100
		enable_auto_scaling = false
    availability_zones  = []
    node_count          = 1
    min_count           = null
    max_count           = null
    max_pods            = 110
    node_labels         = null
    taints              = null
  }
}

Requirements

No requirements.

Providers

Name Version
azuread n/a
azurerm n/a
local n/a
null n/a
random n/a
tls n/a

Modules

No modules.

Resources

Name Type
azuread_application.sp resource
azuread_service_principal.sp resource
azuread_service_principal_password.sp resource
azurerm_kubernetes_cluster.k8s resource
azurerm_kubernetes_cluster_node_pool.aks resource
azurerm_role_assignment.role_assignment_aks resource
azurerm_role_assignment.role_assignment_network resource
azurerm_storage_account.st resource
local_file.kubeconfig_file resource
null_resource.delay_after_sp_created resource
random_string.unique resource
tls_private_key.pair resource
azurerm_subnet.subnet data source

Inputs

Name Description Type Default Required
additional_node_pools (Optional) List of additional node pools to the cluster
map(object({
vm_size = string
os_disk_size_gb = number
enable_auto_scaling = bool
availability_zones = list(string)
node_count = number
min_count = number
max_count = number
max_pods = number
node_labels = map(string)
taints = list(string)
}))
{} no
admin_username (Required) The Admin Username for the Cluster. Changing this forces a new resource to be created. string n/a yes
auto_scaling_default_node (Optional) Kubernetes Auto Scaler must be enabled for this main pool bool n/a yes
availability_zones (Optional) A list of Availability Zones across which the Node Pool should be spread. Changing this forces a new resource to be created. list(string) [] no
dns_service_ip (Optional) IP address within the Kubernetes service address range that will be used by cluster service discovery (kube-dns). string "10.0.0.10" no
docker_bridge_cidr (Optional) The Network Range used by the Kubernetes service. Changing this forces a new resource to be created. string "172.17.0.1/16" no
end_date The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). string "2030-01-01T00:00:00Z" no
k8s_version (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). string "1.23.5" no
location (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. string n/a yes
max_pods (Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created. number 110 no
netwok_resource_group (Required) Name of the resource group that contains the virtual network string n/a yes
network_subnet (Required) Network subnet name. string n/a yes
network_vnet (Required) Virtual network name. string n/a yes
node_count (Optional) The initial number of nodes which should exist in this Node Pool. If specified this must be between 1 and 100 and between min_count and max_count. string n/a yes
node_max_count (Required) The maximum number of nodes which should exist in this Node Pool. If specified this must be between 1 and 100. number n/a yes
node_min_count (Required) The minimum number of nodes which should exist in this Node Pool. If specified this must be between 1 and 100. number n/a yes
pod_cidr (Optional) The CIDR to use for pod IP addresses. Changing this forces a new resource to be created. string "10.244.0.0/16" no
prefix (Required) Base name used by resources (cluster name, main service and others). string n/a yes
rbac_enabled (Required) Is Role Based Access Control Enabled? Changing this forces a new resource to be created. bool false no
resource_group (Required) Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created. string n/a yes
service_cidr (Optional) The Network Range used by the Kubernetes service.Changing this forces a new resource to be created. string "10.0.0.0/16" no
sku_tier (Optional) Defines the SLA plan for the availability of system. Valid options are Free or Paid, paid option enables the Uptime SLA feature (see https://docs.microsoft.com/en-us/azure/aks/uptime-sla for more info) string "Free" no
storage_account_kind (Optional) Defines the Kind of account. Valid options are BlobStorage, BlockBlobStorage, FileStorage, Storage and StorageV2. Changing this forces a new resource to be created. Defaults to StorageV2. string "FileStorage" no
storage_account_name (Optional) Data storage name (use lower case, no spaces and special characters ex: mystorageaccount).null empty does not create resource. string n/a yes
storage_account_replication_type (Required) Defines the type of replication to use for this storage account. Valid options are LRS, GRS, RAGRS and ZRS. string "LRS" no
storage_account_tier (Required) Defines the Tier to use for this storage account. Valid options are Standard and Premium. For FileStorage accounts only Premium is valid. Changing this forces a new resource to be created. string "Premium" no
tags (Optional) A mapping of tags to assign to the resource. map(string) n/a yes
vm_size (Required) The size of the Virtual Machine, such as Standard_DS2_v2. string "Standard_DS2_v2" no

Outputs

Name Description
cluster_name Cluster name to be used in the context of kubectl
config Commands to configure kubectl local
kube_config_file Kubeconfig file
kube_config_raw Client configuration file for connecting to the cluster
service_principal_id Service Principal ID
service_principal_secret Service Principal Secrets

terraform-azure-aks's People

Contributors

edalferes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.