From 078697fdfeabbc59de9fc1b942e61bfcc97810d0 Mon Sep 17 00:00:00 2001 From: scotttyso Date: Mon, 26 Jul 2021 21:39:26 -0400 Subject: [PATCH] pre-commit format update --- modules/iks/README.md | 56 +++++++++++++++++++--------------------- modules/iks/main.tf | 34 ++++++++++++------------ modules/iks/variables.tf | 20 +++++++------- modules/tfe/README.md | 23 +++++++---------- modules/tfe/ws_kube.tf | 6 ++--- 5 files changed, 67 insertions(+), 72 deletions(-) diff --git a/modules/iks/README.md b/modules/iks/README.md index c6c6eac..6ab8ce1 100644 --- a/modules/iks/README.md +++ b/modules/iks/README.md @@ -21,19 +21,20 @@ Run the plan from the Terraform cloud workspace. | Name | Source | Version | |------|--------|---------| -| [control\_plane\_instance\_type](#module\_control\_plane\_instance\_type) | terraform-cisco-modules/iks/intersight//modules/infra_provider | n/a | -| [control\_plane\_profile](#module\_control\_plane\_profile) | terraform-cisco-modules/imm/intersight//modules/k8s_node_profile | n/a | +| [control\_plane\_node\_group](#module\_control\_plane\_node\_group) | terraform-cisco-modules/imm/intersight//modules/k8s_node_group_profile | n/a | +| [control\_plane\_vm\_infra\_provider](#module\_control\_plane\_vm\_infra\_provider) | terraform-cisco-modules/imm/intersight//modules/k8s_vm_infra_provider | n/a | | [iks\_cluster](#module\_iks\_cluster) | terraform-cisco-modules/imm/intersight//modules/k8s_cluster | n/a | | [ip\_pools](#module\_ip\_pools) | terraform-cisco-modules/imm/intersight//modules/pools_ip | n/a | -| [k8s\_addons](#module\_k8s\_addons) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_addons | n/a | -| [k8s\_runtime\_policies](#module\_k8s\_runtime\_policies) | terraform-cisco-modules/iks/intersight//modules/runtime_policy | n/a | -| [k8s\_trusted\_registries](#module\_k8s\_trusted\_registries) | terraform-cisco-modules/iks/intersight//modules/trusted_registry | n/a | -| [k8s\_version\_policies](#module\_k8s\_version\_policies) | terraform-cisco-modules/iks/intersight//modules/version | n/a | -| [k8s\_vm\_infra\_policies](#module\_k8s\_vm\_infra\_policies) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_vm_infra | n/a | -| [k8s\_vm\_instance](#module\_k8s\_vm\_instance) | terraform-cisco-modules/iks/intersight//modules/worker_profile | n/a | -| [k8s\_vm\_network\_policy](#module\_k8s\_vm\_network\_policy) | terraform-cisco-modules/iks/intersight//modules/k8s_network | n/a | -| [worker\_instance\_type](#module\_worker\_instance\_type) | terraform-cisco-modules/iks/intersight//modules/infra_provider | n/a | -| [worker\_profile](#module\_worker\_profile) | terraform-cisco-modules/imm/intersight//modules/k8s_node_profile | n/a | +| [k8s\_addon\_policies](#module\_k8s\_addon\_policies) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_addons | n/a | +| [k8s\_network\_cidr](#module\_k8s\_network\_cidr) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_network_cidr | n/a | +| [k8s\_nodeos\_config](#module\_k8s\_nodeos\_config) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_nodeos_config | n/a | +| [k8s\_runtime\_policies](#module\_k8s\_runtime\_policies) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_runtime | n/a | +| [k8s\_trusted\_registries](#module\_k8s\_trusted\_registries) | terraform-cisco-modules/imm/intersight//modules/k8s_trusted_registries | n/a | +| [k8s\_version\_policies](#module\_k8s\_version\_policies) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_version | n/a | +| [k8s\_vm\_infra\_config](#module\_k8s\_vm\_infra\_config) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_vm_infra | n/a | +| [k8s\_vm\_instance\_type](#module\_k8s\_vm\_instance\_type) | terraform-cisco-modules/imm/intersight//modules/policies_k8s_vm_instance_type | n/a | +| [worker\_node\_group](#module\_worker\_node\_group) | terraform-cisco-modules/imm/intersight//modules/k8s_node_group_profile | n/a | +| [worker\_vm\_infra\_provider](#module\_worker\_vm\_infra\_provider) | terraform-cisco-modules/imm/intersight//modules/k8s_vm_infra_provider | n/a | ## Resources @@ -47,24 +48,22 @@ Run the plan from the Terraform cloud workspace. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [apikey](#input\_apikey) | Intersight API Key. | `string` | n/a | yes | -| [dns\_servers\_v4](#input\_dns\_servers\_v4) | DNS Servers for Kubernetes Sysconfig Policy. | `list(string)` |
[
"198.18.0.100",
"198.18.0.101"
]
| no | -| [domain\_name](#input\_domain\_name) | Domain Name for Kubernetes Sysconfig Policy. | `string` | `"example.com"` | no | | [endpoint](#input\_endpoint) | Intersight URL. | `string` | `"https://intersight.com"` | no | -| [iks\_cluster](#input\_iks\_cluster) | Action to perform on the Intersight Kubernetes Cluster. Options are {Delete\|Deploy\|Ready\|No-op\|Unassign}. |
map(object(
{
action_cluster = optional(string)
action_control_plane = optional(string)
action_worker = optional(string)
action = optional(string)
addons = optional(set(string))
control_plane_desired_size = optional(number)
control_plane_intance_moid = string
control_plane_max_size = optional(number)
ip_pool_moid = string
k8s_vm_infra_moid = string
load_balancers = optional(number)
ssh_key = string
ssh_user = string
registry_moid = optional(string)
runtime_moid = optional(list(map(string)))
tags = optional(list(map(string)))
version_moid = string
vm_network_moid = string
wait_for_complete = optional(bool)
worker_desired_size = optional(number)
worker_intance_moid = string
worker_max_size = optional(number)
}
))
|
{
"default": {
"action_cluster": "Deploy",
"action_control_plane": "No-op",
"action_worker": "No-op",
"addons": [],
"control_plane_desired_size": 1,
"control_plane_intance_moid": "**REQUIRED**",
"control_plane_max_size": 3,
"ip_pool_moid": "**REQUIRED**",
"k8s_vm_infra_moid": "**REQUIRED**",
"load_balancers": 3,
"registry_moid": "",
"runtime_moid": [],
"ssh_key": "ssh_key_1",
"ssh_user": "iksadmin",
"tags": [],
"version_moid": "**REQUIRED**",
"vm_network_moid": "**REQUIRED**",
"wait_for_complete": false,
"worker_desired_size": 0,
"worker_intance_moid": "**REQUIRED**",
"worker_max_size": 4
}
}
| no | -| [ip\_pools](#input\_ip\_pools) | * from - host address of the pool starting address. Default is 20
* gateway - ip/prefix of the gateway. Default is 198.18.0.1/24
* name - Name of the IP Pool. Default is {tenant}\_{cluster\_name}\_ip\_pool.
* size - Number of host addresses to assign to the pool. Default is 30. |
map(object(
{
from = optional(number)
gateway = optional(string)
name = optional(string)
size = optional(number)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"from": 20,
"gateway": "198.18.0.1/24",
"name": "{tenant_name}_ip_pool",
"size": 30,
"tags": []
}
}
| no | -| [k8s\_addons](#input\_k8s\_addons) | Map of Add-ons for Intersight Kubernetes Service. Add-ons Options are {ccp-monitor\|kubernetes-dashboard}. |
map(object(
{
install_strategy = optional(string)
name = optional(string)
release_name = optional(string)
tags = optional(list(map(string)))
upgrade_strategy = optional(string)
}
))
|
{
"default": {
"install_strategy": "Always",
"name": "{tenant_name}_{addon_key}",
"release_name": "",
"tags": [],
"upgrade_strategy": "UpgradeOnly"
}
}
| no | -| [k8s\_runtime](#input\_k8s\_runtime) | n/a |
map(object(
{
docker_bridge_cidr = optional(string)
docker_no_proxy = optional(list(string))
http_hostname = optional(string)
http_port = optional(number)
http_protocol = optional(string)
http_username = optional(string)
https_hostname = optional(string)
https_port = optional(number)
https_protocol = optional(string)
https_username = optional(string)
name = optional(string)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"docker_bridge_cidr": "",
"docker_no_proxy": [],
"http_hostname": "",
"http_port": 8080,
"http_protocol": "http",
"http_username": "",
"https_hostname": "",
"https_port": 8443,
"https_protocol": "https",
"https_username": "",
"name": "",
"tags": []
}
}
| no | +| [iks\_cluster](#input\_iks\_cluster) | Please Refer to the k8s\_version variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | +| [ip\_pools](#input\_ip\_pools) | Please Refer to the ip\_pools variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | +| [k8s\_addon\_policies](#input\_k8s\_addon\_policies) | Please Refer to the k8s\_addons variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | +| [k8s\_network\_cidr](#input\_k8s\_network\_cidr) | Please Refer to the k8s\_network\_cidr variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | +| [k8s\_nodeos\_config](#input\_k8s\_nodeos\_config) | Please Refer to the k8s\_nodeos\_config variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | | [k8s\_runtime\_create](#input\_k8s\_runtime\_create) | Flag to specify if the Kubernetes Runtime Policy should be created or not. | `bool` | `false` | no | | [k8s\_runtime\_http\_password](#input\_k8s\_runtime\_http\_password) | Password for the HTTP Proxy Server, If required. | `string` | `""` | no | | [k8s\_runtime\_https\_password](#input\_k8s\_runtime\_https\_password) | Password for the HTTPS Proxy Server, If required. | `string` | `""` | no | +| [k8s\_runtime\_policies](#input\_k8s\_runtime\_policies) | Please Refer to the k8s\_runtime\_policies variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | | [k8s\_trusted\_create](#input\_k8s\_trusted\_create) | Flag to specify if the Kubernetes Runtime Policy should be created or not. | `bool` | `false` | no | -| [k8s\_trusted\_registry](#input\_k8s\_trusted\_registry) | n/a |
map(object(
{
name = optional(string)
root_ca = optional(list(string))
tags = optional(list(map(string)))
unsigned = optional(list(string))
}
))
|
{
"default": {
"name": "",
"root_ca": [],
"tags": [],
"unsigned": []
}
}
| no | -| [k8s\_version](#input\_k8s\_version) | Kubernetes Version to Deploy. |
map(object(
{
name = optional(string)
tags = optional(list(map(string)))
version = optional(string)
}
))
|
{
"default": {
"name": "",
"tags": [],
"version": "1.19.5"
}
}
| no | -| [k8s\_vm\_infra](#input\_k8s\_vm\_infra) | Kubernetes Virtual Machine Infrastructure Configuration Policy. Default name is {tenant\_name}\_vm\_infra. |
map(object(
{
name = optional(string)
tags = optional(list(map(string)))
vsphere_cluster = string
vsphere_datastore = string
vsphere_portgroup = list(string)
vsphere_resource_pool = optional(string)
vsphere_target = string
}
))
|
{
"default": {
"name": "",
"tags": [],
"vsphere_cluster": "default",
"vsphere_datastore": "datastore1",
"vsphere_portgroup": [
"VM Network"
],
"vsphere_resource_pool": "",
"vsphere_target": ""
}
}
| no | +| [k8s\_trusted\_registries](#input\_k8s\_trusted\_registries) | Please Refer to the k8s\_trusted\_registries variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | +| [k8s\_version\_policies](#input\_k8s\_version\_policies) | Please Refer to the k8s\_version\_policies variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | +| [k8s\_vm\_infra\_config](#input\_k8s\_vm\_infra\_config) | Please Refer to the k8s\_vm\_infra\_config variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | | [k8s\_vm\_infra\_password](#input\_k8s\_vm\_infra\_password) | vSphere Password. Note: this is the password of the Credentials used to register the vSphere Target. | `string` | n/a | yes | -| [k8s\_vm\_instance](#input\_k8s\_vm\_instance) | Kubernetes Virtual Machine Instance Policy Variables. Default name is {tenant\_name}\_vm\_network. |
map(object(
{
cpu = optional(number)
disk = optional(number)
memory = optional(number)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"cpu": 4,
"disk": 40,
"memory": 16384,
"tags": []
}
}
| no | -| [k8s\_vm\_network](#input\_k8s\_vm\_network) | Kubernetes Virtual Machine Network Configuration Policy. Default name is {tenant\_name}\_vm\_network. |
map(object(
{
cidr_pod = optional(string)
cidr_service = optional(string)
cni = optional(string)
name = optional(string)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"cidr_pod": "100.64.0.0/16",
"cidr_service": "100.65.0.0/16",
"cni": "Calico",
"name": "",
"tags": []
}
}
| no | -| [ntp\_servers](#input\_ntp\_servers) | NTP Servers for Kubernetes Sysconfig Policy. | `list(string)` | `[]` | no | +| [k8s\_vm\_instance\_type](#input\_k8s\_vm\_instance\_type) | Please Refer to the k8s\_vm\_instance\_type variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | | [organization](#input\_organization) | Intersight Organization. | `string` | `"default"` | no | | [secretkey](#input\_secretkey) | Intersight Secret Key. | `string` | n/a | yes | | [ssh\_key\_1](#input\_ssh\_key\_1) | Intersight Kubernetes Service Cluster SSH Public Key 1. | `string` | `""` | no | @@ -72,9 +71,8 @@ Run the plan from the Terraform cloud workspace. | [ssh\_key\_3](#input\_ssh\_key\_3) | Intersight Kubernetes Service Cluster SSH Public Key 3. These are place holders for Tenants that use different keys for different clusters. | `string` | `""` | no | | [ssh\_key\_4](#input\_ssh\_key\_4) | Intersight Kubernetes Service Cluster SSH Public Key 4. These are place holders for Tenants that use different keys for different clusters. | `string` | `""` | no | | [ssh\_key\_5](#input\_ssh\_key\_5) | Intersight Kubernetes Service Cluster SSH Public Key 5. These are place holders for Tenants that use different keys for different clusters. | `string` | `""` | no | -| [tags](#input\_tags) | Tags to be Associated with Objects Created in Intersight. | `list(map(string))` | `[]` | no | +| [tags](#input\_tags) | Please Refer to the tags variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `string` | n/a | yes | | [tenant\_name](#input\_tenant\_name) | Name of the Tenant. | `string` | `"default"` | no | -| [timezone](#input\_timezone) | Timezone for Kubernetes Sysconfig Policy. | `string` | `"Etc/GMT"` | no | ## Outputs @@ -83,14 +81,14 @@ Run the plan from the Terraform cloud workspace. | [endpoint](#output\_endpoint) | Intersight URL. | | [iks\_cluster](#output\_iks\_cluster) | moid of the IKS Cluster. | | [ip\_pools](#output\_ip\_pools) | moid of the IP Pool | -| [k8s\_addons](#output\_k8s\_addons) | moid of the Kubernetes CIDR Policies. | +| [k8s\_addon\_policies](#output\_k8s\_addon\_policies) | moid of the Kubernetes CIDR Policies. | | [k8s\_network\_cidr](#output\_k8s\_network\_cidr) | moid of the Kubernetes CIDR Policies. | | [k8s\_nodeos\_config](#output\_k8s\_nodeos\_config) | moid of the Kubernetes Node OS Config Policies. | -| [k8s\_runtime\_policies](#output\_k8s\_runtime\_policies) | moid of the Kubernetes Runtime Policy. | +| [k8s\_runtime\_policies](#output\_k8s\_runtime\_policies) | moid of the Kubernetes Runtime Policies. | | [k8s\_trusted\_registries](#output\_k8s\_trusted\_registries) | moid of the Kubernetes Trusted Registry Policy. | | [k8s\_version\_policies](#output\_k8s\_version\_policies) | moid of the Kubernetes Version Policies. | -| [k8s\_vm\_infra\_policies](#output\_k8s\_vm\_infra\_policies) | moid of the Kubernetes VM Infrastructure Policies. | -| [k8s\_vm\_instance](#output\_k8s\_vm\_instance) | moid of the Large Kubernetes Instance Type Policies. | +| [k8s\_vm\_infra\_config](#output\_k8s\_vm\_infra\_config) | moid of the Kubernetes VM Infrastructure Configuration Policies. | +| [k8s\_vm\_instance\_type](#output\_k8s\_vm\_instance\_type) | moid of the Large Kubernetes Instance Type Policies. | | [org\_moid](#output\_org\_moid) | moid of the Intersight Organization. | | [organization](#output\_organization) | Intersight Organization Name. | | [tags](#output\_tags) | Tags to be Associated with Objects Created in Intersight. | diff --git a/modules/iks/main.tf b/modules/iks/main.tf index 8a077df..ab15e2c 100644 --- a/modules/iks/main.tf +++ b/modules/iks/main.tf @@ -139,16 +139,16 @@ module "k8s_network_cidr" { #______________________________________________ module "k8s_nodeos_config" { - source = "terraform-cisco-modules/imm/intersight//modules/policies_k8s_nodeos_config" - for_each = local.k8s_nodeos_config - description = each.value.description != "" ? each.value.description : "${var.tenant_name} Kubernetes Network CIDR Policy." - dns_servers_v4 = each.value.dns_servers_v4 - domain_name = each.value.domain_name - name = each.value.name != "" ? each.value.name : "${var.tenant_name}_nodeos_config" - ntp_servers = each.value.ntp_servers != [] ? each.value.ntp_servers : each.value.dns_servers_v4 - org_name = var.organization - tags = each.value.tags != null ? each.value.tags : local.tags - timezone = each.value.timezone + source = "terraform-cisco-modules/imm/intersight//modules/policies_k8s_nodeos_config" + for_each = local.k8s_nodeos_config + description = each.value.description != "" ? each.value.description : "${var.tenant_name} Kubernetes Network CIDR Policy." + dns_servers_v4 = each.value.dns_servers_v4 + domain_name = each.value.domain_name + name = each.value.name != "" ? each.value.name : "${var.tenant_name}_nodeos_config" + ntp_servers = each.value.ntp_servers != [] ? each.value.ntp_servers : each.value.dns_servers_v4 + org_name = var.organization + tags = each.value.tags != null ? each.value.tags : local.tags + timezone = each.value.timezone } @@ -202,13 +202,13 @@ module "k8s_trusted_registries" { #______________________________________________ module "k8s_version_policies" { - source = "terraform-cisco-modules/imm/intersight//modules/policies_k8s_version" - for_each = local.k8s_version - description = each.value.description != "" ? each.value.description : "${var.tenant_name} Version ${each.value.version} Policy." - name = each.value.name != "" ? "${each.value.name}_v${each.value.version}" : "${var.tenant_name}_v${each.value.version}" - org_name = var.organization - k8s_version = each.value.version - tags = each.value.tags != [] ? each.value.tags : local.tags + source = "terraform-cisco-modules/imm/intersight//modules/policies_k8s_version" + for_each = local.k8s_version + description = each.value.description != "" ? each.value.description : "${var.tenant_name} Version ${each.value.version} Policy." + name = each.value.name != "" ? "${each.value.name}_v${each.value.version}" : "${var.tenant_name}_v${each.value.version}" + org_name = var.organization + k8s_version = each.value.version + tags = each.value.tags != [] ? each.value.tags : local.tags } diff --git a/modules/iks/variables.tf b/modules/iks/variables.tf index 08152b5..1e8e124 100644 --- a/modules/iks/variables.tf +++ b/modules/iks/variables.tf @@ -62,7 +62,7 @@ variable "tags" { variable "ip_pools" { description = "Please Refer to the ip_pools variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } #__________________________________________________________ @@ -77,7 +77,7 @@ variable "ip_pools" { variable "k8s_addon_policies" { description = "Please Refer to the k8s_addons variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } #______________________________________________ @@ -87,7 +87,7 @@ variable "k8s_addon_policies" { variable "k8s_network_cidr" { description = "Please Refer to the k8s_network_cidr variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } @@ -98,7 +98,7 @@ variable "k8s_network_cidr" { variable "k8s_nodeos_config" { description = "Please Refer to the k8s_nodeos_config variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } @@ -109,7 +109,7 @@ variable "k8s_nodeos_config" { variable "k8s_runtime_policies" { description = "Please Refer to the k8s_runtime_policies variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } variable "k8s_runtime_create" { @@ -146,7 +146,7 @@ variable "k8s_trusted_create" { variable "k8s_trusted_registries" { description = "Please Refer to the k8s_trusted_registries variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } #______________________________________________ @@ -156,7 +156,7 @@ variable "k8s_trusted_registries" { variable "k8s_version_policies" { description = "Please Refer to the k8s_version_policies variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } #______________________________________________ @@ -166,7 +166,7 @@ variable "k8s_version_policies" { variable "k8s_vm_infra_config" { description = "Please Refer to the k8s_vm_infra_config variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } @@ -185,7 +185,7 @@ variable "k8s_vm_infra_password" { variable "k8s_vm_instance_type" { description = "Please Refer to the k8s_vm_instance_type variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } @@ -202,7 +202,7 @@ variable "k8s_vm_instance_type" { variable "iks_cluster" { description = "Please Refer to the k8s_version variable information in the tfe module. In the IKS module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals." - type = string + type = string } variable "ssh_key_1" { diff --git a/modules/tfe/README.md b/modules/tfe/README.md index 9916dd5..0515b4f 100644 --- a/modules/tfe/README.md +++ b/modules/tfe/README.md @@ -235,24 +235,22 @@ No resources. |------|-------------|------|---------|:--------:| | [agent\_pool](#input\_agent\_pool) | Terraform Cloud Agent Pool. | `string` | n/a | yes | | [apikey](#input\_apikey) | Intersight API Key. | `string` | n/a | yes | -| [dns\_servers\_v4](#input\_dns\_servers\_v4) | DNS Servers for Kubernetes Sysconfig Policy. | `list(string)` |
[
"198.18.0.100",
"198.18.0.101"
]
| no | -| [domain\_name](#input\_domain\_name) | Domain Name for Kubernetes Sysconfig Policy. | `string` | `"example.com"` | no | | [endpoint](#input\_endpoint) | Intersight URL. | `string` | `"https://intersight.com"` | no | -| [iks\_cluster](#input\_iks\_cluster) | Action to perform on the Intersight Kubernetes Cluster. Options are {Delete\|Deploy\|Ready\|No-op\|Unassign}. |
map(object(
{
action_cluster = optional(string)
action_control_plane = optional(string)
action_worker = optional(string)
action = optional(string)
addons = optional(set(string))
control_plane_desired_size = optional(number)
control_plane_intance_moid = string
control_plane_max_size = optional(number)
ip_pool_moid = string
k8s_vm_infra_moid = string
load_balancers = optional(number)
ssh_key = string
ssh_user = string
registry_moid = optional(string)
runtime_moid = optional(list(map(string)))
tags = optional(list(map(string)))
version_moid = string
vm_network_moid = string
wait_for_complete = optional(bool)
worker_desired_size = optional(number)
worker_intance_moid = string
worker_max_size = optional(number)
}
))
|
{
"default": {
"action_cluster": "Deploy",
"action_control_plane": "No-op",
"action_worker": "No-op",
"addons": [],
"control_plane_desired_size": 1,
"control_plane_intance_moid": "**REQUIRED**",
"control_plane_max_size": 3,
"ip_pool_moid": "**REQUIRED**",
"k8s_vm_infra_moid": "**REQUIRED**",
"load_balancers": 3,
"registry_moid": "",
"runtime_moid": [],
"ssh_key": "ssh_key_1",
"ssh_user": "iksadmin",
"tags": [],
"version_moid": "**REQUIRED**",
"vm_network_moid": "**REQUIRED**",
"wait_for_complete": false,
"worker_desired_size": 0,
"worker_intance_moid": "**REQUIRED**",
"worker_max_size": 4
}
}
| no | -| [ip\_pools](#input\_ip\_pools) | * from - host address of the pool starting address. Default is 20
* gateway - ip/prefix of the gateway. Default is 198.18.0.1/24
* name - Name of the IP Pool. Default is {tenant}\_{cluster\_name}\_ip\_pool.
* size - Number of host addresses to assign to the pool. Default is 30. |
map(object(
{
from = optional(number)
gateway = optional(string)
name = optional(string)
size = optional(number)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"from": 20,
"gateway": "198.18.0.1/24",
"name": "{tenant_name}_ip_pool",
"size": 30,
"tags": []
}
}
| no | -| [k8s\_addons](#input\_k8s\_addons) | Map of Add-ons for Intersight Kubernetes Service. Add-ons Options are {ccp-monitor\|kubernetes-dashboard}. |
map(object(
{
install_strategy = optional(string)
name = optional(string)
release_name = optional(string)
tags = optional(list(map(string)))
upgrade_strategy = optional(string)
}
))
|
{
"default": {
"install_strategy": "Always",
"name": "{tenant_name}_{addon_key}",
"release_name": "",
"tags": [],
"upgrade_strategy": "UpgradeOnly"
}
}
| no | -| [k8s\_runtime](#input\_k8s\_runtime) | n/a |
map(object(
{
docker_bridge_cidr = optional(string)
docker_no_proxy = optional(list(string))
http_hostname = optional(string)
http_port = optional(number)
http_protocol = optional(string)
http_username = optional(string)
https_hostname = optional(string)
https_port = optional(number)
https_protocol = optional(string)
https_username = optional(string)
name = optional(string)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"docker_bridge_cidr": "",
"docker_no_proxy": [],
"http_hostname": "",
"http_port": 8080,
"http_protocol": "http",
"http_username": "",
"https_hostname": "",
"https_port": 8443,
"https_protocol": "https",
"https_username": "",
"name": "",
"tags": []
}
}
| no | +| [iks\_cluster](#input\_iks\_cluster) | Intersight Kubernetes Service Cluster Profile Variable Map.
1. action\_cluster - Action to perform on the Kubernetes Cluster. Options are {Delete\|Deploy\|Ready\|No-op\|Unassign}.
2. action\_control\_plane - Action to perform on the Kubernetes Control Plane Nodes. Options are {Delete\|Deploy\|Ready\|No-op\|Unassign}.
3. action\_worker - Action to perform on the Kubernetes Worker Nodes. Options are {Delete\|Deploy\|Ready\|No-op\|Unassign}.
4. control\_plane\_desired\_size - Desired number of control plane nodes in this node group, same as minsize initially and is updated by the auto-scaler. Options are {1\|3}.
5. control\_plane\_k8s\_labels - List of key/value Attributes to Assign to the control plane node configuration.
6. control\_plane\_max\_size - Maximum number of control plane nodes desired in this node group. Range is 1-128.
7. description - A description for the policy.
8. ip\_pool\_moid - Name of the IP Pool to assign to Cluster and Node Profiles.
9. k8s\_addon\_policy\_moid - Names of the Kubernetes Add-ons to add to the cluster. Options are {ccp-monitor\|kubernetes-dashboard} or [].
10. k8s\_network\_cidr\_moid - Name of the Kubneretes Network CIDR Policy to assign to Cluster.
11. k8s\_nodeos\_config\_moid - Name of the Kubneretes Node OS Config Policy to assign to Cluster and Node Profiles.
12. k8s\_registry\_moid - Name of the Kubernetes Trusted Registry Policy to assign to Cluster and Node Profiles
.13. k8s\_runtime\_moid - Name of the Kubernetes Runtime Policy to assign to Cluster and Node Profiles
.14. k8s\_version\_moid - Name of the Kubernetes Version Policy to assign to the Node Profiles.
15. k8s\_vm\_infra\_moid - Name of the Kubernetes Virtual Machine Infra Config Policy to assign to the Node Profiles.
16. k8s\_vm\_instance\_type\_ctrl\_plane - Name of the Kubernetes Virtual Machine Instance Type Policy to assign to control plane nodes.
17. k8s\_vm\_instance\_type\_worker - Name of the Kubernetes Virtual Machine Instance Type Policy to assign to worker nodes.
18. load\_balancers - Number of load balancer addresses to deploy. Range is 1-999.
19. ssh\_key - The SSH Key Name should be ssh\_key\_{1\|2\|3\|4\|5}. This will point to the ssh\_key variable that will be used.
20. ssh\_user - SSH Username for node login.
21. tags - tags - List of key/value Attributes to Assign to the Profile.
22. wait\_for\_complete - This model object can trigger workflows. Use this option to wait for all running workflows to reach a complete state.
23. worker\_desired\_size - Desired number of nodes in this worker node group, same as minsize initially and is updated by the auto-scaler. Range is 1-128.
24. worker\_k8s\_labels - List of key/value Attributes to Assign to the worker node configuration.
25. worker\_max\_size - Maximum number of worker nodes desired in this node group. Range is 1-128. |
map(object(
{
action_cluster = optional(string)
action_control_plane = optional(string)
action_worker = optional(string)
control_plane_desired_size = optional(number)
control_plane_k8s_labels = optional(list(map(string)))
control_plane_max_size = optional(number)
description = optional(string)
ip_pool_moid = string
k8s_addon_policy_moid = optional(set(string))
k8s_network_cidr_moid = string
k8s_nodeos_config_moid = string
k8s_registry_moid = optional(string)
k8s_runtime_moid = optional(string)
k8s_version_moid = string
k8s_vm_infra_moid = string
k8s_vm_instance_type_ctrl_plane = string
k8s_vm_instance_type_worker = string
load_balancers = optional(number)
ssh_key = string
ssh_user = string
tags = optional(list(map(string)))
wait_for_complete = optional(bool)
worker_desired_size = optional(number)
worker_k8s_labels = optional(list(map(string)))
worker_max_size = optional(number)
}
))
|
{
"default": {
"action_cluster": "Deploy",
"action_control_plane": "No-op",
"action_worker": "No-op",
"control_plane_desired_size": 1,
"control_plane_k8s_labels": [],
"control_plane_max_size": 3,
"description": "",
"ip_pool_moid": "**REQUIRED**",
"k8s_addon_policy_moid": [],
"k8s_network_cidr_moid": "**REQUIRED**",
"k8s_nodeos_config_moid": "**REQUIRED**",
"k8s_registry_moid": "",
"k8s_runtime_moid": "",
"k8s_version_moid": "**REQUIRED**",
"k8s_vm_infra_moid": "**REQUIRED**",
"k8s_vm_instance_type_ctrl_plane": "**REQUIRED**",
"k8s_vm_instance_type_worker": "**REQUIRED**",
"load_balancers": 3,
"ssh_key": "ssh_key_1",
"ssh_user": "iksadmin",
"tags": [],
"wait_for_complete": false,
"worker_desired_size": 0,
"worker_k8s_labels": [],
"worker_max_size": 4
}
}
| no | +| [ip\_pools](#input\_ip\_pools) | Intersight IP Pool Variable Map.
1. description - A description for the policy.
2. from - host address of the pool starting address.
3. gateway - ip/prefix of the gateway.
4. name - Name of the IP Pool.
5. size - Number of host addresses to assign to the pool.
6. tags - List of key/value Attributes to Assign to the Policy. |
map(object(
{
description = optional(string)
from = optional(number)
gateway = optional(string)
name = optional(string)
size = optional(number)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"description": "",
"from": 20,
"gateway": "198.18.0.1/24",
"name": "{tenant_name}_ip_pool",
"size": 30,
"tags": []
}
}
| no | +| [k8s\_addon\_policies](#input\_k8s\_addon\_policies) | Intersight Kubernetes Service Add-ons Variable Map. Add-ons Options are {ccp-monitor\|kubernetes-dashboard} currently.
1. description - A description for the policy.
2. install\_strategy - Addon install strategy to determine whether an addon is installed if not present.
* None - Unspecified install strategy.
* NoAction - No install action performed.
* InstallOnly - Only install in green field. No action in case of failure or removal.
* Always - Attempt install if chart is not already installed.
3. name - Name of the concrete policy.
4. release\_name - Name for the helm release.
5. release\_namespace - Namespace for the helm release.
6. tags - List of key/value Attributes to Assign to the Policy.
7. upgrade\_strategy - Addon upgrade strategy to determine whether an addon configuration is overwritten on upgrade.
* None - Unspecified upgrade strategy.
* NoAction - This choice enables No upgrades to be performed.
* UpgradeOnly - Attempt upgrade if chart or overrides options change, no action on upgrade failure.
* ReinstallOnFailure - Attempt upgrade first. Remove and install on upgrade failure.
* AlwaysReinstall - Always remove older release and reinstall. |
map(object(
{
description = optional(string)
install_strategy = optional(string)
name = optional(string)
release_name = optional(string)
release_namespace = optional(string)
tags = optional(list(map(string)))
upgrade_strategy = optional(string)
}
))
|
{
"default": {
"description": "",
"install_strategy": "Always",
"name": "{tenant_name}_{each.key}",
"release_name": "",
"release_namespace": "",
"tags": [],
"upgrade_strategy": "UpgradeOnly"
}
}
| no | +| [k8s\_network\_cidr](#input\_k8s\_network\_cidr) | Intersight Kubernetes Network CIDR Policy Variable Map.
1. cidr\_pod - CIDR block to allocate pod network IP addresses from.
2. cidr\_service - Pod CIDR Block to be used to assign Pod IP Addresses.
3. cni\_type - Supported CNI type. Currently we only support Calico.
* Calico - Calico CNI plugin as described in https://github.com/projectcalico/cni-plugin.
* Aci - Cisco ACI Container Network Interface plugin.
4. description - A description for the policy.
5. name - Name of the concrete policy.
6. tags - tags - List of key/value Attributes to Assign to the Policy. |
map(object(
{
cidr_pod = optional(string)
cidr_service = optional(string)
cni_type = optional(string)
description = optional(string)
name = optional(string)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"cidr_pod": "100.64.0.0/16",
"cidr_service": "100.65.0.0/16",
"cni_type": "Calico",
"description": "",
"name": "{tenant_name}_network_cidr",
"tags": []
}
}
| no | +| [k8s\_nodeos\_config](#input\_k8s\_nodeos\_config) | Intersight Kubernetes Node OS Configuration Policy Variable Map.
1. description - A description for the policy.
2. dns\_servers\_v4 - DNS Servers for the Kubernetes Node OS Configuration Policy.
3. domain\_name - Domain Name for the Kubernetes Node OS Configuration Policy.
4. ntp\_servers - NTP Servers for the Kubernetes Node OS Configuration Policy.
5. name - Name of the concrete policy.
6. tags - tags - List of key/value Attributes to Assign to the Policy.
7. timezone - The timezone of the node's system clock. For a List of supported timezones see the following URL.
https://github.com/terraform-cisco-modules/terraform-intersight-imm/blob/master/modules/policies_ntp/README.md. |
map(object(
{
description = optional(string)
dns_servers_v4 = optional(list(string))
domain_name = optional(string)
ntp_servers = optional(list(string))
name = optional(string)
tags = optional(list(map(string)))
timezone = optional(string)
}
))
|
{
"default": {
"description": "",
"dns_servers_v4": [
"208.67.220.220",
"208.67.222.222"
],
"domain_name": "example.com",
"name": "{tenant_name}_nodeos_config",
"ntp_servers": [],
"tags": [],
"timezone": "Etc/GMT"
}
}
| no | | [k8s\_runtime\_create](#input\_k8s\_runtime\_create) | Flag to specify if the Kubernetes Runtime Policy should be created or not. | `bool` | `false` | no | | [k8s\_runtime\_http\_password](#input\_k8s\_runtime\_http\_password) | Password for the HTTP Proxy Server, If required. | `string` | `""` | no | | [k8s\_runtime\_https\_password](#input\_k8s\_runtime\_https\_password) | Password for the HTTPS Proxy Server, If required. | `string` | `""` | no | +| [k8s\_runtime\_policies](#input\_k8s\_runtime\_policies) | Intersight Kubernetes Runtime Policy Variable Map.
1. description - A description for the policy.
2. docker\_bridge\_cidr - The CIDR for docker bridge network. This address space must not collide with other CIDRs on your networks, including the cluster's service CIDR, pod CIDR and IP Pools.
3. docker\_no\_proxy - Docker no proxy list, when using internet proxy.
4. http\_hostname - Hostname of the HTTP Proxy Server.
5. http\_port - HTTP Proxy Port. Range is 1-65535.
6. http\_protocol - HTTP Proxy Protocol. Options are {http\|https}.
7. http\_username - Username for the HTTP Proxy Server.
8. https\_hostname - Hostname of the HTTPS Proxy Server.
9. https\_port - HTTPS Proxy Port. Range is 1-65535
10. https\_protocol - HTTPS Proxy Protocol. Options are {http\|https}.
11. https\_username - Username for the HTTPS Proxy Server.
12. name - Name of the concrete policy.
13. tags - List of key/value Attributes to Assign to the Policy. |
map(object(
{
description = optional(string)
docker_bridge_cidr = optional(string)
docker_no_proxy = optional(list(string))
http_hostname = optional(string)
http_port = optional(number)
http_protocol = optional(string)
http_username = optional(string)
https_hostname = optional(string)
https_port = optional(number)
https_protocol = optional(string)
https_username = optional(string)
name = optional(string)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"description": "",
"docker_bridge_cidr": "",
"docker_no_proxy": [],
"http_hostname": "",
"http_port": 8080,
"http_protocol": "http",
"http_username": "",
"https_hostname": "",
"https_port": 8443,
"https_protocol": "https",
"https_username": "",
"name": "{tenant_name}_runtime",
"tags": []
}
}
| no | | [k8s\_trusted\_create](#input\_k8s\_trusted\_create) | Flag to specify if the Kubernetes Runtime Policy should be created or not. | `bool` | `false` | no | -| [k8s\_trusted\_registry](#input\_k8s\_trusted\_registry) | n/a |
map(object(
{
name = optional(string)
root_ca = optional(list(string))
tags = optional(list(map(string)))
unsigned = optional(list(string))
}
))
|
{
"default": {
"name": "",
"root_ca": [],
"tags": [],
"unsigned": []
}
}
| no | -| [k8s\_version](#input\_k8s\_version) | Kubernetes Version to Deploy. |
map(object(
{
name = optional(string)
tags = optional(list(map(string)))
version = optional(string)
}
))
|
{
"default": {
"name": "",
"tags": [],
"version": "1.19.5"
}
}
| no | -| [k8s\_vm\_infra](#input\_k8s\_vm\_infra) | Kubernetes Virtual Machine Infrastructure Configuration Policy. Default name is {tenant\_name}\_vm\_infra. |
map(object(
{
name = optional(string)
tags = optional(list(map(string)))
vsphere_cluster = string
vsphere_datastore = string
vsphere_portgroup = list(string)
vsphere_resource_pool = optional(string)
vsphere_target = string
}
))
|
{
"default": {
"name": "",
"tags": [],
"vsphere_cluster": "default",
"vsphere_datastore": "datastore1",
"vsphere_portgroup": [
"VM Network"
],
"vsphere_resource_pool": "",
"vsphere_target": ""
}
}
| no | +| [k8s\_trusted\_registries](#input\_k8s\_trusted\_registries) | Intersight Kubernetes Trusted Registry Policy Variable Map.
1. description - A description for the policy.
2. name - Name of the concrete policy.
3. root\_ca - List of root CA Signed Registries.
4. tags - List of key/value Attributes to Assign to the Policy.
5. unsigned - List of unsigned registries to be supported. |
map(object(
{
description = optional(string)
name = optional(string)
root_ca = optional(list(string))
tags = optional(list(map(string)))
unsigned = optional(list(string))
}
))
|
{
"default": {
"description": "",
"name": "{tenant_name}_registry",
"root_ca": [],
"tags": [],
"unsigned": []
}
}
| no | +| [k8s\_version\_policies](#input\_k8s\_version\_policies) | Intersight Kubernetes Version Policy Variable Map.
1. description - A description for the policy.
2. name - Name of the concrete policy.
3. tags - List of key/value Attributes to Assign to the Policy.
4. version - Desired Kubernetes version. Options are {1.19.5} |
map(object(
{
description = optional(string)
name = optional(string)
tags = optional(list(map(string)))
version = optional(string)
}
))
|
{
"default": {
"description": "",
"name": "{tenant_name}_v{each.value.version}",
"tags": [],
"version": "1.19.5"
}
}
| no | +| [k8s\_vm\_infra\_config](#input\_k8s\_vm\_infra\_config) | Intersight Kubernetes Virtual Machine Infra Config Policy Variable Map.

1. description - A description for the policy.
2. name - Name of the concrete policy.
3. tags - List of key/value Attributes to Assign to the Policy.
4. vsphere\_cluster - vSphere Cluster to assign the K8S Cluster Deployment.
5. vsphere\_datastore - vSphere Datastore to assign the K8S Cluster Deployment.r
6. vsphere\_portgroup - vSphere Port Group to assign the K8S Cluster Deployment.r
7. vsphere\_resource\_pool - vSphere Resource Pool to assign the K8S Cluster Deployment.r
8. vsphere\_target - Name of the vSphere Target discovered in Intersight, to provision the cluster on. |
map(object(
{
description = optional(string)
name = optional(string)
tags = optional(list(map(string)))
vsphere_cluster = string
vsphere_datastore = string
vsphere_portgroup = list(string)
vsphere_resource_pool = optional(string)
vsphere_target = string
}
))
|
{
"default": {
"description": "",
"name": "{tenant_name}_vm_infra",
"tags": [],
"vsphere_cluster": "default",
"vsphere_datastore": "datastore1",
"vsphere_portgroup": [
"VM Network"
],
"vsphere_resource_pool": "",
"vsphere_target": ""
}
}
| no | | [k8s\_vm\_infra\_password](#input\_k8s\_vm\_infra\_password) | vSphere Password. Note: this is the password of the Credentials used to register the vSphere Target. | `string` | n/a | yes | -| [k8s\_vm\_instance](#input\_k8s\_vm\_instance) | Kubernetes Virtual Machine Instance Policy Variables. Default name is {tenant\_name}\_vm\_network. |
map(object(
{
cpu = optional(number)
disk = optional(number)
memory = optional(number)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"cpu": 4,
"disk": 40,
"memory": 16384,
"tags": []
}
}
| no | -| [k8s\_vm\_network](#input\_k8s\_vm\_network) | Kubernetes Virtual Machine Network Configuration Policy. Default name is {tenant\_name}\_vm\_network. |
map(object(
{
cidr_pod = optional(string)
cidr_service = optional(string)
cni = optional(string)
name = optional(string)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"cidr_pod": "100.64.0.0/16",
"cidr_service": "100.65.0.0/16",
"cni": "Calico",
"name": "",
"tags": []
}
}
| no | -| [ntp\_servers](#input\_ntp\_servers) | NTP Servers for Kubernetes Sysconfig Policy. | `list(string)` | `[]` | no | +| [k8s\_vm\_instance\_type](#input\_k8s\_vm\_instance\_type) | Intersight Kubernetes Node OS Configuration Policy Variable Map. Name of the policy will be {tenant\_name}\_{each.key}.
1. cpu - Number of CPUs allocated to virtual machine. Range is 1-40.
2. description - A description for the policy.
3. disk - Ephemeral disk capacity to be provided with units example - 10 for 10 Gigabytes.
4. memory - Virtual machine memory defined in mebibytes (MiB). Range is 1-4177920.
5. tags - List of key/value Attributes to Assign to the Policy. |
map(object(
{
cpu = optional(number)
description = optional(string)
disk = optional(number)
memory = optional(number)
tags = optional(list(map(string)))
}
))
|
{
"default": {
"cpu": 4,
"description": "",
"disk": 40,
"memory": 16384,
"tags": []
}
}
| no | | [organization](#input\_organization) | Intersight Organization Name. | `string` | `"default"` | no | | [secretkey](#input\_secretkey) | Intersight Secret Key. | `string` | n/a | yes | | [ssh\_key\_1](#input\_ssh\_key\_1) | Intersight Kubernetes Service Cluster SSH Public Key 1. | `string` | `""` | no | @@ -266,7 +264,6 @@ No resources. | [terraform\_version](#input\_terraform\_version) | Terraform Target Version. | `string` | `"1.0.0"` | no | | [tfc\_oath\_token](#input\_tfc\_oath\_token) | Terraform Cloud OAuth Token for VCS\_Repo Integration. | `string` | n/a | yes | | [tfc\_organization](#input\_tfc\_organization) | Terraform Cloud Organization Name. | `string` | n/a | yes | -| [timezone](#input\_timezone) | Timezone for Deployment. For a List of supported timezones see the following URL.
https://github.com/terraform-cisco-modules/terraform-intersight-imm/blob/master/modules/policies_ntp/README.md. | `string` | `"Etc/GMT"` | no | | [vcs\_repo](#input\_vcs\_repo) | Version Control System Repository. | `string` | n/a | yes | ## Outputs diff --git a/modules/tfe/ws_kube.tf b/modules/tfe/ws_kube.tf index 073e10e..c2adc3b 100644 --- a/modules/tfe/ws_kube.tf +++ b/modules/tfe/ws_kube.tf @@ -56,9 +56,9 @@ module "kube_variables" { sensitive = true value = var.secretkey }, - #--------------------------- - # Cluster Variables - #--------------------------- + #--------------------------- + # Cluster Variables + #--------------------------- cluster_name = { description = "${var.tenant_name}_${each.key} Cluster Name." key = "cluster_name"