Skip to content

Commit

Permalink
Merge pull request #231 from aishwaryabk/network-rel-4.7
Browse files Browse the repository at this point in the history
[release-4.7] network_custom
  • Loading branch information
Power Cloud Robot authored Jan 5, 2022
2 parents 3f0cc5f + 9fd04e8 commit 2b60d10
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 22 deletions.
3 changes: 3 additions & 0 deletions docs/var.tfvars-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@ This variable is used to set the default Container Network Interface (CNI) netwo

```
cni_network_provider = "OpenshiftSDN"
cluster_network_cidr = "10.128.0.0/14"
cluster_network_hostprefix = "23"
service_network = "172.30.0.0/16"
```
47 changes: 26 additions & 21 deletions modules/5_install/install.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,32 @@ locals {
local_registry_ocp_image = "registry.${var.cluster_id}.${local.cluster_domain}:5000/${local.ocp_release_repo}:${var.ocp_release_tag}"

install_vars = {
cluster_id = var.cluster_id
cluster_domain = local.cluster_domain
pull_secret = var.pull_secret
public_ssh_key = var.public_key
storage_type = var.storage_type
log_level = var.log_level
release_image_override = var.enable_local_registry ? local.local_registry_ocp_image : var.release_image_override
enable_local_registry = var.enable_local_registry
node_connection_timeout = 60 * var.connection_timeout
rhcos_kernel_options = var.rhcos_kernel_options
sysctl_tuned_options = var.sysctl_tuned_options
sysctl_options = var.sysctl_options
match_array = indent(2,var.match_array)
setup_squid_proxy = var.setup_squid_proxy
squid_source_range = var.cidr
proxy_url = local.proxy.server == "" ? "" : "http://${local.proxy.user_pass}${local.proxy.server}:${local.proxy.port}"
no_proxy = var.cidr
chrony_config = var.chrony_config
chrony_config_servers = var.chrony_config_servers
chrony_allow_range = var.cidr
cni_network_provider = var.cni_network_provider
bastion_vip = var.bastion_vip
cluster_id = var.cluster_id
cluster_domain = local.cluster_domain
pull_secret = var.pull_secret
public_ssh_key = var.public_key
storage_type = var.storage_type
log_level = var.log_level
release_image_override = var.enable_local_registry ? local.local_registry_ocp_image : var.release_image_override
enable_local_registry = var.enable_local_registry
node_connection_timeout = 60 * var.connection_timeout
rhcos_pre_kernel_options = var.rhcos_pre_kernel_options
rhcos_kernel_options = var.rhcos_kernel_options
sysctl_tuned_options = var.sysctl_tuned_options
sysctl_options = var.sysctl_options
match_array = indent(2,var.match_array)
setup_squid_proxy = var.setup_squid_proxy
squid_source_range = var.cidr
proxy_url = local.proxy.server == "" ? "" : "http://${local.proxy.user_pass}${local.proxy.server}:${local.proxy.port}"
no_proxy = var.cidr
chrony_config = var.chrony_config
chrony_config_servers = var.chrony_config_servers
chrony_allow_range = var.cidr
cni_network_provider = var.cni_network_provider
cluster_network_cidr = var.cluster_network_cidr
cluster_network_hostprefix = var.cluster_network_hostprefix
service_network = var.service_network
}

upgrade_vars = {
Expand Down
4 changes: 4 additions & 0 deletions modules/5_install/templates/install_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ no_proxy: "${no_proxy}"
dhcp_shared_network: true

cni_network_provider: "${cni_network_provider}"

cluster_network_cidr: "${cluster_network_cidr}"
cluster_network_hostprefix: "${cluster_network_hostprefix}"
service_network: "${service_network}"
3 changes: 3 additions & 0 deletions modules/5_install/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ variable "upgrade_pause_time" {}
variable "upgrade_delay_time" {}

variable "cni_network_provider" {}
variable "cluster_network_cidr" {}
variable "cluster_network_hostprefix" {}
variable "service_network" {}
3 changes: 3 additions & 0 deletions ocp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,7 @@ module "install" {
chrony_config = var.chrony_config
chrony_config_servers = var.chrony_config_servers
cni_network_provider = var.cni_network_provider
cluster_network_cidr = var.cluster_network_cidr
cluster_network_hostprefix = var.cluster_network_hostprefix
service_network = var.service_network
}
3 changes: 3 additions & 0 deletions var.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ cluster_id = "" # It will use random generated id with
#upgrade_delay_time = "600"

#cni_network_provider = "OpenshiftSDN"
#cluster_network_cidr = "10.128.0.0/14"
#cluster_network_hostprefix = "23"
#service_network = "172.30.0.0/16"
17 changes: 16 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ variable "install_playbook_repo" {
variable "install_playbook_tag" {
description = "Set the branch/tag name or commit# for using ocp4-playbooks repo"
# Checkout level for https://github.com/ocp-power-automation/ocp4-playbooks which is used for running ocp4 installations steps
default = "9e2b6c66c28a864c6815a3c9e1f0488c0c43ef0c"
default = "e78e16b10f1b05b3dccdb027865ae20972ee95f0"
}

variable "ansible_extra_options" {
Expand Down Expand Up @@ -372,6 +372,21 @@ variable "cni_network_provider" {
default = "OpenshiftSDN"
}

variable "cluster_network_cidr" {
description = "blocks of IP addresses from which pod IP addresses are allocated."
default = "10.128.0.0/14"
}

variable "cluster_network_hostprefix" {
description = "The subnet prefix length to assign to each individual node."
default = "23"
}

variable "service_network" {
description = "blocks of IP addresses from which service addresses are allocated."
default = "172.30.0.0/16"
}

################################################################
# Local registry variables ( used only in disconnected install )
################################################################
Expand Down

0 comments on commit 2b60d10

Please sign in to comment.