Skip to content

Commit f343e82

Browse files
committed
Added additional support for addon options. Tested with version 1.0.18 of the provider. Updated documentation to reflect these updates.
1 parent e031e86 commit f343e82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+755
-1371
lines changed

README.md

Lines changed: 133 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ This module creates all of the resources required for IKS. Those resources are
2626

2727
Reusing prebuilt policies is supported. Each object block has a variable for doing this.
2828
Set
29-
```
29+
```hcl
3030
use_existing = true
3131
```
3232
If existing objects are not available this module will create those objects for you where required.
3333
Set
34-
```
34+
```hcl
3535
use_existing = false
3636
```
3737
For the runtime_policies and the Trusted registry, if you DO NOT want to use this policy in your cluster build you need to set the following variable combination in EACH object block.
38-
```
38+
```hcl
3939
use_existing = false
4040
create_new = false
4141
```
@@ -51,166 +51,183 @@ See the above Examples folder for more information.
5151

5252

5353
Sample main.tf file.
54-
```
54+
```hcl
5555
provider "intersight" {
5656
apikey = var.apikey
5757
secretkey = var.secretkey
5858
endpoint = var.endpoint
5959
}
6060
6161
module "terraform-intersight-iks" {
62-
source = "terraform-cisco-modules/iks/intersight//"
63-
62+
63+
source = "terraform-cisco-modules/iks/intersight//"
64+
version = "2.1.0"
65+
66+
# Kubernetes Cluster Profile Adjust the values as needed.
67+
cluster = {
68+
name = "new_cluster"
69+
action = "Unassign"
70+
wait_for_completion = false
71+
worker_nodes = 5
72+
load_balancers = 5
73+
worker_max = 20
74+
control_nodes = 1
75+
ssh_user = var.ssh_user
76+
ssh_public_key = var.ssh_key
77+
}
78+
79+
80+
# IP Pool Information (To create new change "use_existing" to 'false' uncomment variables and modify them to meet your needs.)
6481
ip_pool = {
65-
use_existing = true
66-
name = "ippool"
67-
ip_starting_address = "10.139.120.220"
68-
ip_pool_size = "20"
69-
ip_netmask = "255.255.255.0"
70-
ip_gateway = "10.139.120.1"
71-
dns_servers = ["10.101.128.15"]
82+
use_existing = true
83+
name = "10-239-21-0"
84+
# ip_starting_address = "10.239.21.220"
85+
# ip_pool_size = "20"
86+
# ip_netmask = "255.255.255.0"
87+
# ip_gateway = "10.239.21.1"
88+
# dns_servers = ["10.101.128.15","10.101.128.16"]
7289
}
73-
90+
91+
# Sysconfig Policy (UI Reference NODE OS Configuration) (To create new change "use_existing" to 'false' uncomment variables and modify them to meet your needs.)
7492
sysconfig = {
7593
use_existing = true
76-
name = "New"
77-
domain_name = "rich.ciscolabs.com"
78-
timezone = "America/New_York"
79-
ntp_servers = ["10.101.128.15"]
80-
dns_servers = ["10.101.128.15"]
94+
name = "richfield"
95+
# domain_name = "rich.ciscolabs.com"
96+
# timezone = "America/New_York"
97+
# ntp_servers = ["10.101.128.15"]
98+
# dns_servers = ["10.101.128.15"]
8199
}
82-
100+
101+
# Kubernetes Network CIDR (To create new change "use_existing" to 'false' uncomment variables and modify them to meet your needs.)
83102
k8s_network = {
84103
use_existing = true
85-
name = "default"
104+
name = "default"
86105
87-
######### Below are the default settings. Change if needed. #########
88-
pod_cidr = "100.65.0.0/16"
89-
service_cidr = "100.64.0.0/24"
90-
cni = "Calico"
106+
######### Below are the default settings. Change if needed. #########
107+
# pod_cidr = "100.65.0.0/16"
108+
# service_cidr = "100.64.0.0/24"
109+
# cni = "Calico"
91110
}
92-
# Version policy
93-
version_policy = {
94-
use_existing = true
95-
name = "1.19.5"
96-
version = "1.19.5"
97-
}
98-
99-
# tr_policy_name = "test"
100-
tr_policy = {
111+
# Version policy (To create new change "use_existing" to 'false' uncomment variables and modify them to meet your needs.)
112+
version_policy = {
101113
use_existing = true
102-
name = "triggermesh-trusted-registry"
114+
name = "1.19.15"
115+
# version = "1.19.15"
116+
}
117+
# Trusted Registry Policy (To create new change "use_existing" to 'false' and set "create_new' to 'true' uncomment variables and modify them to meet your needs.)
118+
# Set both variables to 'false' if this policy is not needed.
119+
tr_policy = {
120+
use_existing = false
121+
create_new = false
122+
name = "trusted-registry"
103123
}
124+
# Runtime Policy (To create new change "use_existing" to 'false' and set "create_new' to 'true' uncomment variables and modify them to meet your needs.)
125+
# Set both variables to 'false' if this policy is not needed.
104126
runtime_policy = {
105-
use_existing = true
106-
name = "runtime"
107-
http_proxy_hostname = "proxy.com"
108-
http_proxy_port = 80
109-
http_proxy_protocol = "http"
110-
http_proxy_username = null
111-
http_proxy_password = null
112-
https_proxy_hostname = "proxy.com"
113-
https_proxy_port = 8080
114-
https_proxy_protocol = "https"
115-
https_proxy_username = null
116-
https_proxy_password = null
127+
use_existing = false
128+
create_new = false
129+
# name = "runtime"
130+
# http_proxy_hostname = "t"
131+
# http_proxy_port = 80
132+
# http_proxy_protocol = "http"
133+
# http_proxy_username = null
134+
# http_proxy_password = null
135+
# https_proxy_hostname = "t"
136+
# https_proxy_port = 8080
137+
# https_proxy_protocol = "https"
138+
# https_proxy_username = null
139+
# https_proxy_password = null
117140
}
118-
119-
# Infra Config Policy Information
120-
infra_config_policy = {
141+
142+
# Infrastructure Configuration Policy (To create new change "use_existing" to 'false' and uncomment variables and modify them to meet your needs.)
143+
infraConfigPolicy = {
121144
use_existing = true
122-
name = "vcenter"
123-
vc_target_name = "marvel-vcsa.rich.ciscolabs.com"
124-
vc_portgroups = ["panther|iks|tme"]
125-
vc_datastore = "iks"
126-
vc_cluster = "tchalla"
127-
vc_resource_pool = ""
128-
vc_password = var.vc_password
145+
# platformType = "iwe"
146+
# targetName = "falcon"
147+
policyName = "dev"
148+
# description = "Test Policy"
149+
# interfaces = ["iwe-guests"]
150+
# vcTargetName = optional(string)
151+
# vcClusterName = optional(string)
152+
# vcDatastoreName = optional(string)
153+
# vcResourcePoolName = optional(string)
154+
# vcPassword = optional(string)
129155
}
130156
131-
addons_list = [{
132-
addon_policy_name = "dashboard"
133-
addon = "kubernetes-dashboard"
134-
description = "K8s Dashboard Policy"
135-
upgrade_strategy = "AlwaysReinstall"
136-
install_strategy = "InstallOnly"
137-
},
157+
# Addon Profile and Policies (To create new change "createNew" to 'true' and uncomment variables and modify them to meet your needs.)
158+
# This is an Optional item. Comment or remove to not use. Multiple addons can be configured.
159+
addons = [
138160
{
139-
addon_policy_name = "monitor"
140-
addon = "ccp-monitor"
141-
description = "Grafana Policy"
142-
upgrade_strategy = "AlwaysReinstall"
143-
install_strategy = "InstallOnly"
144-
}
145-
{
146-
addon_policy_name = "smm"
147-
addon = "smm"
148-
description = "Service Mesh Manager Policy"
149-
upgrade_strategy = "AlwaysReinstall"
150-
install_strategy = "InstallOnly"
151-
152-
}
161+
createNew = true
162+
addonPolicyName = "smm-tf"
163+
addonName = "smm"
164+
description = "SMM Policy"
165+
upgradeStrategy = "AlwaysReinstall"
166+
installStrategy = "InstallOnly"
167+
releaseVersion = "1.7.4-cisco4-helm3"
168+
overrides = yamlencode({"demoApplication":{"enabled":true}})
169+
},
170+
# {
171+
# createNew = true
172+
# addonName = "ccp-monitor"
173+
# description = "monitor Policy"
174+
# # upgradeStrategy = "AlwaysReinstall"
175+
# # installStrategy = "InstallOnly"
176+
# releaseVersion = "0.2.61-helm3"
177+
# # overrides = yamlencode({"demoApplication":{"enabled":true}})
178+
# }
153179
]
154-
instance_type = {
155-
use_existing = true
156-
name = "small"
157-
cpu = 4
158-
memory = 16386
159-
disk_size = 40
160-
}
161-
# Cluster information
162-
cluster = {
163-
name = "new_cluster"
164-
action = "Unassign"
165-
wait_for_completion = true
166-
worker_nodes = 5
167-
load_balancers = 5
168-
worker_max = 20
169-
control_nodes = 1
170-
ssh_user = "iksadmin"
171-
ssh_public_key = var.ssh_key
180+
181+
# Worker Node Instance Type (To create new change "use_existing" to 'false' and uncomment variables and modify them to meet your needs.)
182+
instance_type = {
183+
use_existing = true
184+
name = "small"
185+
# cpu = 4
186+
# memory = 16386
187+
# disk_size = 40
172188
}
173-
# Organization and Tag
189+
190+
# Organization and Tag Information
174191
organization = var.organization
175192
tags = var.tags
176193
}
194+
177195
```
178196
Sample terraform.tfvars file.
179-
```
180-
# Required Varilables
197+
```hcl
181198
apikey = ""
182-
vc_password = ""
183-
ssh_user = "iksadmin"
184-
ssh_key = ""
185-
# Optional Variables
199+
secretkey = "../../.secret"
200+
organization = "default"
201+
ssh_user = "iksadmin"
202+
ssh_key = ""
186203
tags = [
187204
{
188-
"key" : "key-1"
189-
"value" : "value-1"
205+
"key" : "managed_by"
206+
"value" : "Terraform"
190207
},
191208
{
192-
"key" : "key-2"
193-
"value" : "value-2"
209+
"key" : "owner"
210+
"value" : "jb"
194211
}
195212
]
196213
organization = "default" # Change this if a different org is required. Default org is set to "default"
197214
```
198215

199216
Sample versions.tf file
200-
```
217+
```hcl
201218
terraform {
202219
required_version = ">=0.14.5"
203220
204221
required_providers {
205222
intersight = {
206223
source = "CiscoDevNet/intersight"
207-
version = "=1.0.13"
224+
version = ">=1.0.18"
208225
}
209226
}
210227
}
211228
```
212229
Sample variables.tf file.
213-
```
230+
```hcl
214231
variable "apikey" {
215232
type = string
216233
description = "API Key"
@@ -237,11 +254,6 @@ variable "ssh_key" {
237254
type = string
238255
description = "SSH Public Key to be used to node login."
239256
}
240-
variable "vc_password" {
241-
sensitive = true
242-
type = string
243-
description = "Password of the account to be used with vCenter. This should be the password for the account used to register vCenter with Intersight."
244-
}
245257
variable "tags" {
246258
type = list(map(string))
247259
default = []
@@ -257,20 +269,20 @@ variable "tags" {
257269
| Name | Version |
258270
|------|---------|
259271
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=0.14.5 |
260-
| <a name="requirement_intersight"></a> [intersight](#requirement\_intersight) | >=1.0.17 |
272+
| <a name="requirement_intersight"></a> [intersight](#requirement\_intersight) | >=1.0.18 |
261273

262274
## Providers
263275

264276
| Name | Version |
265277
|------|---------|
266-
| <a name="provider_intersight"></a> [intersight](#provider\_intersight) | >=1.0.17 |
278+
| <a name="provider_intersight"></a> [intersight](#provider\_intersight) | >=1.0.18 |
267279

268280
## Modules
269281

270282
| Name | Source | Version |
271283
|------|--------|---------|
272284
| <a name="module_addons"></a> [addons](#module\_addons) | terraform-cisco-modules/iks/intersight//modules/addon_policy | n/a |
273-
| <a name="module_cluster_addon_profile"></a> [cluster\_addon\_profile](#module\_cluster\_addon\_profile) | terraform-cisco-modules/iks/intersight//modules/cluster_addon_profile | n/a |
285+
| <a name="module_cluster_addon_profile"></a> [cluster\_addon\_profile](#module\_cluster\_addon\_profile) | ./modules/cluster_addon_profile | n/a |
274286
| <a name="module_cluster_profile"></a> [cluster\_profile](#module\_cluster\_profile) | terraform-cisco-modules/iks/intersight//modules/cluster | n/a |
275287
| <a name="module_control_profile"></a> [control\_profile](#module\_control\_profile) | terraform-cisco-modules/iks/intersight//modules/node_profile | n/a |
276288
| <a name="module_control_provider"></a> [control\_provider](#module\_control\_provider) | terraform-cisco-modules/iks/intersight//modules/infra_provider | n/a |
@@ -302,7 +314,7 @@ variable "tags" {
302314

303315
| Name | Description | Type | Default | Required |
304316
|------|-------------|------|---------|:--------:|
305-
| <a name="input_addons_list"></a> [addons\_list](#input\_addons\_list) | List of objects for each addon to be added. | <pre>list(object({<br> addon_policy_name = string<br> addon = string<br> description = string<br> upgrade_strategy = string<br> install_strategy = string<br> }))</pre> | `[]` | no |
317+
| <a name="input_addons"></a> [addons](#input\_addons) | n/a | <pre>list(object({<br> createNew = bool<br> addonPolicyName = optional(string)<br> addonName = optional(string)<br> description = optional(string)<br> upgradeStrategy = optional(string)<br> installStrategy = optional(string)<br> overrideSets = optional(list(map(string)))<br> overrides = optional(string)<br> releaseName = optional(string)<br> releaseNamespace = optional(string)<br> releaseVersion = optional(string)<br> }))</pre> | `[]` | no |
306318
| <a name="input_cluster"></a> [cluster](#input\_cluster) | n/a | <pre>object({<br> name = string<br> action = string<br> wait_for_completion = bool<br> worker_nodes = number<br> load_balancers = number<br> worker_max = number<br> control_nodes = number<br> ssh_user = string<br> ssh_public_key = string<br> })</pre> | n/a | yes |
307319
| <a name="input_infraConfigPolicy"></a> [infraConfigPolicy](#input\_infraConfigPolicy) | n/a | <pre>object({<br> use_existing = bool<br> platformType = optional(string)<br> targetName = optional(string)<br> policyName = string<br> description = optional(string)<br> interfaces = optional(list(string))<br> diskMode = optional(string)<br> vcTargetName = optional(string)<br> vcClusterName = optional(string)<br> vcDatastoreName = optional(string)<br> vcResourcePoolName = optional(string)<br> vcPassword = optional(string)<br> })</pre> | n/a | yes |
308320
| <a name="input_infra_config_policy_name"></a> [infra\_config\_policy\_name](#input\_infra\_config\_policy\_name) | Name of existing infra config policy (if it exists) to be used. | `string` | `""` | no |
@@ -321,5 +333,6 @@ variable "tags" {
321333

322334
| Name | Description |
323335
|------|-------------|
324-
| <a name="output_cluster_profile_moid"></a> [cluster\_profile\_moid](#output\_cluster\_profile\_moid) | n/a |
336+
| <a name="output_k8s_cluster_moid"></a> [k8s\_cluster\_moid](#output\_k8s\_cluster\_moid) | n/a |
337+
| <a name="output_k8s_cluster_profile_moid"></a> [k8s\_cluster\_profile\_moid](#output\_k8s\_cluster\_profile\_moid) | n/a |
325338
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0 commit comments

Comments
 (0)