-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Azure: Split terraform into stages #5032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 1 commit into
openshift:master
from
jhixson74:master_terraform_split_azure
Jul 23, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| output "bootstrap_ip" { | ||
| value = var.azure_private ? azurerm_network_interface.bootstrap.private_ip_address : azurerm_public_ip.bootstrap_public_ip_v4[0].ip_address | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,103 +1,70 @@ | ||
| variable "vm_size" { | ||
| type = string | ||
| description = "The SKU ID for the bootstrap node." | ||
| } | ||
|
|
||
| variable "vm_image" { | ||
| type = string | ||
| description = "The resource id of the vm image used for bootstrap." | ||
| } | ||
|
|
||
| variable "region" { | ||
| type = string | ||
| description = "The region for the deployment." | ||
| } | ||
|
|
||
| variable "resource_group_name" { | ||
| type = string | ||
| description = "The resource group name for the deployment." | ||
| } | ||
|
|
||
| variable "cluster_id" { | ||
| type = string | ||
| description = "The identifier for the cluster." | ||
| } | ||
|
|
||
| variable "identity" { | ||
| type = string | ||
| description = "The user assigned identity id for the vm." | ||
| } | ||
|
|
||
| variable "ignition" { | ||
| type = string | ||
| description = "The content of the bootstrap ignition file." | ||
| } | ||
|
|
||
| variable "subnet_id" { | ||
| type = string | ||
| description = "The subnet ID for the bootstrap node." | ||
| } | ||
|
|
||
| variable "elb_backend_pool_v4_id" { | ||
| type = string | ||
| default = null | ||
| description = "The external load balancer bakend pool id. used to attach the bootstrap NIC" | ||
| } | ||
|
|
||
| variable "elb_backend_pool_v6_id" { | ||
| type = string | ||
| default = null | ||
| description = "The external load balancer bakend pool id for ipv6. used to attach the bootstrap NIC" | ||
| } | ||
|
|
||
| variable "ilb_backend_pool_v4_id" { | ||
| type = string | ||
| default = null | ||
| description = "The internal load balancer bakend pool id. used to attach the bootstrap NIC" | ||
| } | ||
|
|
||
| variable "ilb_backend_pool_v6_id" { | ||
| type = string | ||
| default = null | ||
| description = "The internal load balancer bakend pool id for ipv6. used to attach the bootstrap NIC" | ||
| } | ||
|
|
||
| variable "storage_account" { | ||
| type = any | ||
| description = "the storage account for the cluster. It can be used for boot diagnostics." | ||
| } | ||
|
|
||
| variable "tags" { | ||
| type = map(string) | ||
| default = {} | ||
| description = "tags to be applied to created resources." | ||
| variable "master_subnet_id" { | ||
| type = string | ||
| description = "The subnet ID for the bootstrap node." | ||
| } | ||
|
|
||
| variable "nsg_name" { | ||
| type = string | ||
| description = "The network security group for the subnet." | ||
| } | ||
|
|
||
| variable "private" { | ||
| type = bool | ||
| description = "This value determines if this is a private cluster or not." | ||
| variable "resource_group_name" { | ||
| type = string | ||
| description = "The resource group name for the deployment." | ||
| } | ||
|
|
||
| variable "storage_account" { | ||
| type = any | ||
| description = "the storage account for the cluster. It can be used for boot diagnostics." | ||
| } | ||
|
|
||
| variable "use_ipv4" { | ||
| type = bool | ||
| description = "This value determines if this is cluster should use IPv4 networking." | ||
| variable "vm_image" { | ||
| type = string | ||
| description = "The resource id of the vm image used for bootstrap." | ||
| } | ||
|
|
||
| variable "use_ipv6" { | ||
| type = bool | ||
| description = "This value determines if this is cluster should use IPv6 networking." | ||
| variable "identity" { | ||
| type = string | ||
| description = "The user assigned identity id for the vm." | ||
| } | ||
|
|
||
| variable "outbound_udr" { | ||
| type = bool | ||
| default = false | ||
|
|
||
| description = <<EOF | ||
| This determined whether User defined routing will be used for egress to Internet. | ||
| This determined whether User defined routing will be used for egress to | ||
| Internet. | ||
| When false, Standard LB will be used for egress to the Internet. | ||
|
|
||
| This is required because terraform cannot calculate counts during plan phase completely and therefore the `vnet/public-lb.tf` | ||
| conditional need to be recreated. See https://github.com/hashicorp/terraform/issues/12570 | ||
| This is required because terraform cannot calculate counts during plan phase | ||
| completely and therefore the `vnet/public-lb.tf` | ||
| conditional need to be recreated. See | ||
| https://github.com/hashicorp/terraform/issues/12570 | ||
| EOF | ||
| } | ||
|
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| locals { | ||
| tags = merge( | ||
| { | ||
| "kubernetes.io_cluster.${var.cluster_id}" = "owned" | ||
| }, | ||
| var.azure_extra_tags, | ||
| ) | ||
| description = "Created By OpenShift Installer" | ||
| # At this time min_tls_version is only supported in the Public Cloud and US Government Cloud. | ||
| environments_with_min_tls_version = ["public", "usgovernment"] | ||
|
|
||
| } | ||
|
|
||
| provider "azurerm" { | ||
| features {} | ||
| subscription_id = var.azure_subscription_id | ||
| client_id = var.azure_client_id | ||
| client_secret = var.azure_client_secret | ||
| tenant_id = var.azure_tenant_id | ||
| environment = var.azure_environment | ||
| } | ||
|
|
||
| provider "azureprivatedns" { | ||
| subscription_id = var.azure_subscription_id | ||
| client_id = var.azure_client_id | ||
| client_secret = var.azure_client_secret | ||
| tenant_id = var.azure_tenant_id | ||
| environment = var.azure_environment | ||
| } | ||
|
|
||
| module "master" { | ||
| source = "./master" | ||
| resource_group_name = var.resource_group_name | ||
| cluster_id = var.cluster_id | ||
| region = var.azure_region | ||
| availability_zones = var.azure_master_availability_zones | ||
| vm_size = var.azure_master_vm_type | ||
| vm_image = var.vm_image | ||
| identity = var.identity | ||
| ignition = var.ignition_master | ||
| elb_backend_pool_v4_id = var.elb_backend_pool_v4_id | ||
| elb_backend_pool_v6_id = var.elb_backend_pool_v6_id | ||
| ilb_backend_pool_v4_id = var.ilb_backend_pool_v4_id | ||
| ilb_backend_pool_v6_id = var.ilb_backend_pool_v6_id | ||
| subnet_id = var.master_subnet_id | ||
| instance_count = var.master_count | ||
| storage_account = var.storage_account | ||
| os_volume_type = var.azure_master_root_volume_type | ||
| os_volume_size = var.azure_master_root_volume_size | ||
| private = var.azure_private | ||
| outbound_udr = var.azure_outbound_user_defined_routing | ||
|
|
||
| use_ipv4 = var.use_ipv4 | ||
| use_ipv6 = var.use_ipv6 | ||
| } | ||
|
|
||
| module "dns" { | ||
| source = "./dns" | ||
| cluster_domain = var.cluster_domain | ||
| cluster_id = var.cluster_id | ||
| base_domain = var.base_domain | ||
| virtual_network_id = var.virtual_network_id | ||
| external_lb_fqdn_v4 = var.public_lb_pip_v4_fqdn | ||
| external_lb_fqdn_v6 = var.public_lb_pip_v6_fqdn | ||
| internal_lb_ipaddress_v4 = var.internal_lb_ip_v4_address | ||
| internal_lb_ipaddress_v6 = var.internal_lb_ip_v6_address | ||
| resource_group_name = var.resource_group_name | ||
| base_domain_resource_group_name = var.azure_base_domain_resource_group_name | ||
| private = var.azure_private | ||
|
|
||
| use_ipv4 = var.use_ipv4 | ||
| use_ipv6 = var.use_ipv6 | ||
| } | ||
jhixson74 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| output "ip_addresses" { | ||
| value = azurerm_network_interface.master.*.private_ip_addresses | ||
| } |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| output "control_plane_ips" { | ||
| value = module.master.ip_addresses | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.