Skip to content

Commit

Permalink
adding IWE support
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttyso committed Apr 12, 2022
1 parent 7fa5f67 commit e118481
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/kubernetes_policies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ No modules.
| <a name="input_organization"></a> [organization](#input\_organization) | Intersight Organization Names to Apply Policy to. https://intersight.com/an/settings/organizations/. | `string` | `"default"` | no |
| <a name="input_secretkey"></a> [secretkey](#input\_secretkey) | Intersight Secret Key. | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Please Refer to the tags variable information in the tfe module. In the k8s\_policies module the variable is accepted as a string from terraform cloud in the terraform.auto.tfvars and extracted using locals. | `list(map(string))` | `[]` | no |
| <a name="input_target_password"></a> [target\_password](#input\_target\_password) | Target Password. Note: this is the password of the Credentials used to register the Virtualization Target. | `string` | n/a | yes |
| <a name="input_trusted_certificate_authorities"></a> [trusted\_certificate\_authorities](#input\_trusted\_certificate\_authorities) | Intersight Kubernetes Trusted Registry Policy Variable Map.<br>Key - Name of the Trusted Certificate Authorities Policy<br>* description - A description for the policy.<br>* organization - Name of the Intersight Organization to assign this pool to.<br> - https://intersight.com/an/settings/organizations/<br>* root\_ca\_registries - The list of root CA certificates to trust.<br>* tags - List of key/value Attributes to Assign to the Policy.<br>* unsigned\_registries - The list of unsigned registries to allow docker trust.. | <pre>map(object(<br> {<br> description = optional(string)<br> organization = optional(string)<br> root_ca_registries = optional(list(string))<br> tags = optional(list(map(string)))<br> unsigned_registries = optional(list(string))<br> }<br> ))</pre> | <pre>{<br> "default": {<br> "description": "",<br> "root_ca_registries": [],<br> "tags": [],<br> "unsigned_registries": []<br> }<br>}</pre> | no |
| <a name="input_virtual_machine_infra_config"></a> [virtual\_machine\_infra\_config](#input\_virtual\_machine\_infra\_config) | Intersight Kubernetes Virtual Machine Infra Config Policy Variable Map.<br>Key - Name of the Virtual Machine Infra Config Policy<br>* description - A description for the policy.<br>* tags - List of key/value Attributes to Assign to the Policy.<br>* target - Name of the IWE or vSphere Target discovered in Intersight, to provision the cluster to.<br>* vsphere\_cluster - vSphere Cluster to assign the K8S Cluster Deployment.<br>* vsphere\_datastore - vSphere Datastore to assign the K8S Cluster Deployment.r\n<br>* vsphere\_portgroup - vSphere Port Group to assign the K8S Cluster Deployment.r\n<br>* vsphere\_resource\_pool - vSphere Resource Pool to assign the K8S Cluster Deployment.r\n | <pre>map(object(<br> {<br> description = optional(string)<br> tags = optional(list(map(string)))<br> target = string<br> virtual_infrastructure = list(object(<br> {<br> cluster = string<br> datastore = string<br> portgroup = list(string)<br> resource_pool = optional(string)<br> type = optional(string)<br> }<br> ))<br> }<br> ))</pre> | <pre>{<br> "default": {<br> "description": "",<br> "tags": [],<br> "target": "",<br> "virtual_infrastructure": [<br> {<br> "cluster": "default",<br> "datastore": "datastore1",<br> "portgroup": [<br> "VM Network"<br> ],<br> "resource_pool": "",<br> "type": "vmware"<br> }<br> ]<br> }<br>}</pre> | no |
| <a name="input_virtual_machine_infra_config"></a> [virtual\_machine\_infra\_config](#input\_virtual\_machine\_infra\_config) | Intersight Kubernetes Virtual Machine Infra Config Policy Variable Map.<br>Key - Name of the Virtual Machine Infra Config Policy<br>* description - A description for the policy.<br>* tags - List of key/value Attributes to Assign to the Policy.<br>* target - Name of the IWE or vSphere Target discovered in Intersight, to provision the cluster to.<br>* virtual\_infrastructure - List of Virtual Infrastructure Configuration Parameters<br> - cluster: (VMware) - vSphere Cluster to assign the K8S Cluster Deployment.<br> - datastore: (VMware) - vSphere Datastore to assign the K8S Cluster Deployment.<br> - interfaces: (Both) - vSphere Port Group to assign the K8S Cluster Deployment.<br> - mtu: (IWE) - MTU to assign to the Interface<br> - provider\_name: (IWE) - In other words, to which named network from the Instructure Provider will the port be connected.<br> - resource\_pool: (VMware) - vSphere Resource Pool to assign the K8S Cluster Deployment. | <pre>map(object(<br> {<br> description = optional(string)<br> tags = optional(list(map(string)))<br> target = string<br> virtual_infrastructure = list(object(<br> {<br> cluster = optional(string)<br> datastore = optional(string)<br> disk_mode = optional(string)<br> interfaces = list(string)<br> ip_pool = optional(string)<br> mtu = optional(number)<br> name = optional(string)<br> provider_name = optional(string)<br> resource_pool = optional(string)<br> type = string<br> vrf = optional(string)<br> }<br> ))<br> }<br> ))</pre> | <pre>{<br> "default": {<br> "description": "",<br> "tags": [],<br> "target": "",<br> "virtual_infrastructure": [<br> {<br> "cluster": "default",<br> "datastore": "datastore1",<br> "disk_mode": "Block",<br> "interfaces": [<br> "VM Network"<br> ],<br> "ip_pool": "",<br> "mtu": 0,<br> "name": "",<br> "provider_name": "",<br> "resource_pool": "",<br> "type": "vmware",<br> "vrf": ""<br> }<br> ]<br> }<br>}</pre> | no |
| <a name="input_virtual_machine_instance_type"></a> [virtual\_machine\_instance\_type](#input\_virtual\_machine\_instance\_type) | Intersight Kubernetes Virtual Machine Instance Type Policy Variable Map.<br>Key - Name of the Virtual Machine Instance Type Policy<br>* cpu - Number of CPUs allocated to virtual machine. Range is 1-40.<br>* description - A description for the policy.<br>* memory - Virtual machine memory defined in mebibytes (MiB). Range is 1-4177920.<br>* system\_disk\_size - Ephemeral disk capacity to be provided with units example - 10 for 10 Gigabytes.<br>* tags - List of key/value Attributes to Assign to the Policy. | <pre>map(object(<br> {<br> cpu = optional(number)<br> description = optional(string)<br> memory = optional(number)<br> system_disk_size = optional(number)<br> tags = optional(list(map(string)))<br> }<br> ))</pre> | <pre>{<br> "default": {<br> "cpu": 4,<br> "description": "",<br> "memory": 16384,<br> "system_disk_size": 40,<br> "tags": []<br> }<br>}</pre> | no |
| <a name="input_vsphere_password"></a> [vsphere\_password](#input\_vsphere\_password) | vSphere Password. Note: this is the password of the Credentials used to register the vSphere Target. | `string` | n/a | yes |

## Outputs

Expand Down
8 changes: 3 additions & 5 deletions modules/kubernetes_policies/virtual_machine_infra_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ resource "intersight_kubernetes_virtual_machine_infra_config_policy" "virtual_ma
additional_properties = jsonencode({
Datastore = vm_config.value.datastore
Cluster = vm_config.value.cluster
Passphrase = var.vsphere_password
Passphrase = var.target_password
ResourcePool = vm_config.value.resource_pool
})
interfaces = vm_config.value.interfaces
Expand All @@ -116,10 +116,8 @@ resource "intersight_kubernetes_virtual_machine_infra_config_policy" "virtual_ma
for_each = { for k, v in each.value.virtual_infrastructure : k => v if v.type == "iwe" }
content {
additional_properties = jsonencode({
Mtu = vm_config.value.datastore
DiskMode = vm_config.value.disk_mode
Passphrase = var.vsphere_password
ResourcePool = vm_config.value.resource_pool
DiskMode = vm_config.value.disk_mode
Passphrase = var.target_password
})
interfaces = vm_config.value.interfaces
network_interfaces {
Expand Down

0 comments on commit e118481

Please sign in to comment.