From fab6d315efc1958c8dbe2a3c034a8df9eebead97 Mon Sep 17 00:00:00 2001 From: crhuff-ibm <67115462+crhuff-ibm@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:19:50 -0400 Subject: [PATCH] Revert "Update satellite-ibm example (#89)" This reverts commit 8747e594c0316776cf489065da1f4d65d9363eba. --- .pre-commit-config.yaml | 6 +-- .secrets.baseline | 4 +- examples/satellite-aws/versions.tf | 4 +- examples/satellite-azure/versions.tf | 2 +- examples/satellite-gcp/versions.tf | 2 +- examples/satellite-ibm/README.md | 61 +--------------------------- examples/satellite-ibm/cluster.tf | 1 - examples/satellite-ibm/main.tf | 4 +- examples/satellite-ibm/variables.tf | 20 +-------- examples/satellite-ibm/versions.tf | 4 +- modules/cluster/main.tf | 19 ++++----- modules/cluster/variables.tf | 8 +--- modules/location/main.tf | 2 - modules/location/variables.tf | 14 +------ 14 files changed, 25 insertions(+), 126 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb41efb..a784c7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,11 +6,11 @@ default_stages: [commit] # Terraform Validate : Validates the configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.89.1 + rev: v1.80.0 hooks: - id: terraform_fmt - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v4.4.0 hooks: - id: check-merge-conflict - id: trailing-whitespace @@ -20,7 +20,7 @@ repos: # You are encouraged to use static refs such as tags, instead of branch name # # Running "pre-commit autoupdate" would automatically updates rev to latest tag - rev: 0.13.1+ibm.62.dss + rev: 0.13.1+ibm.61.dss hooks: - id: detect-secrets # pragma: whitelist secret # Add options for detect-secrets-hook binary. You can run `detect-secrets-hook --help` to list out all possible options. diff --git a/.secrets.baseline b/.secrets.baseline index a827d92..8d2b209 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "^.secrets.baseline$", "lines": null }, - "generated_at": "2024-05-10T07:45:38Z", + "generated_at": "2023-06-02T01:54:56Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -77,7 +77,7 @@ } ], "results": {}, - "version": "0.13.1+ibm.62.dss", + "version": "0.13.1+ibm.61.dss", "word_list": { "file": null, "hash": null diff --git a/examples/satellite-aws/versions.tf b/examples/satellite-aws/versions.tf index 354a58b..447b19e 100644 --- a/examples/satellite-aws/versions.tf +++ b/examples/satellite-aws/versions.tf @@ -1,6 +1,6 @@ ##################################################### # IBM Cloud Satellite AWS example -# Copyright 2021, 2024 IBM +# Copyright 2021, 2023 IBM ##################################################### /*************************************************** @@ -30,7 +30,7 @@ terraform { } ibm = { source = "IBM-Cloud/ibm" - version = "~> 1.64.0" + version = "~> 1.49.0" } } } diff --git a/examples/satellite-azure/versions.tf b/examples/satellite-azure/versions.tf index 23fc75f..78c5fb6 100644 --- a/examples/satellite-azure/versions.tf +++ b/examples/satellite-azure/versions.tf @@ -7,7 +7,7 @@ terraform { } ibm = { source = "IBM-Cloud/ibm" - version = "~> 1.64.0" + version = "~> 1.49.0" } tls = { source = "hashicorp/tls" diff --git a/examples/satellite-gcp/versions.tf b/examples/satellite-gcp/versions.tf index 32bec02..8f7198e 100644 --- a/examples/satellite-gcp/versions.tf +++ b/examples/satellite-gcp/versions.tf @@ -7,7 +7,7 @@ terraform { } ibm = { source = "IBM-Cloud/ibm" - version = "~> 1.64.0" + version = "~> 1.49.0" } tls = { source = "hashicorp/tls" diff --git a/examples/satellite-ibm/README.md b/examples/satellite-ibm/README.md index d2869c4..ae378e5 100644 --- a/examples/satellite-ibm/README.md +++ b/examples/satellite-ibm/README.md @@ -72,7 +72,6 @@ module "satellite-cluster" { create_timeout = var.create_timeout update_timeout = var.update_timeout delete_timeout = var.delete_timeout - calico_ip_autodetection = var.calico_ip_autodetection } module "satellite-cluster-worker-pool" { @@ -94,61 +93,6 @@ module "satellite-cluster-worker-pool" { } ``` -### Example `terraform.tfvars` file - -```hcl -# IBMCLOUD Authentication - -ibm_region = "us-south" -resource_group = "Default" - -# Satellite Location and Host Variables - -location = "middle-earth" -is_location_exist = false - -managed_from = "dal10" -location_zones = ["gondor", "rohan", "shire"] -coreos_enabled_location = true -coreos_host = true - -pod_subnet = "10.29.0.0/16" -service_subnet = "192.168.42.0/24" - -# VPC VSI Variables - -cp_hosts = [ { - instance_type = "mx2-8x64" - count = 3 -} ] - -# A list of IBM host objects used for provisioning services on your location after setup, including instance_type and count. -addl_hosts = [ { - instance_type = "mx2-8x64" - count = 6 -} ] - -# Prefix to the Names of the VPC Infrastructure resources -is_prefix = "middle-earth" - -ssh_key_id = "xxxx-xxxx-xxxx" - -worker_image = "rhcos-image" # default: "ibm-redhat-8-6-minimal-amd64-1" - -# ROKS Cluster Variables - -create_cluster = true -cluster = "terraform-2-cluster" -# Operating system must be one of: REDHAT_7_64, REDHAT_8_64, RHCOS. -operating_system = "RHCOS" -kube_version = "4.14_openshift" -worker_count = 6 # "Worker Count for default pool" - -calico_ip_autodetection = { - "can-reach" = "www.ibm.com", -} -``` - ## Note * `satellite-location` module creates new location or use existing location ID/name. If user pass the location which is already exist, satellite-location module will error out and exit the module. In such cases user has to set `is_location_exist` value to true. So that module will use existing location for processing. @@ -183,7 +127,7 @@ calico_ip_autodetection = { | create_cluster | Create cluster Disable this, not to provision cluster | bool | true | no | | cluster | Name of the ROKS Cluster that has to be created | string | satellite-ibm-cluster | no | | cluster_zones | Allocate your hosts across these three zones | set | n/a | no | -| kube_version | Kuber version | string | 4.14_openshift | no | +| kube_version | Kuber version | string | 4.7_openshift | no | | default_wp_labels | Labels on the default worker pool | map | n/a | no | | workerpool_labels | Labels on the worker pool | map | n/a | no | | cluster_tags | List of tags for the cluster resource | list | n/a | no | @@ -193,9 +137,6 @@ calico_ip_autodetection = { | create_timeout | Timeout duration for creation | string | n/a | no | | update_timeout | Timeout duration for updation | string | n/a | no | | delete_timeout | Timeout duration for deletion | string | n/a | no | -| pod_subnet | Custom subnet CIDR to provide private IP addresses for pods | string | null | no | -| service_subnet | Custom subnet CIDR to provide private IP addresses for services | string | null | no | -| calico_ip_autodetection | Set IP autodetection to use correct interface for Calico (needs RHCOS) | map(string) | null | no | diff --git a/examples/satellite-ibm/cluster.tf b/examples/satellite-ibm/cluster.tf index 1ac8276..a8d829d 100644 --- a/examples/satellite-ibm/cluster.tf +++ b/examples/satellite-ibm/cluster.tf @@ -27,7 +27,6 @@ module "satellite-cluster" { update_timeout = var.update_timeout delete_timeout = var.delete_timeout operating_system = var.operating_system - calico_ip_autodetection = var.calico_ip_autodetection } ################################################################### diff --git a/examples/satellite-ibm/main.tf b/examples/satellite-ibm/main.tf index 50298cb..19e8c7c 100644 --- a/examples/satellite-ibm/main.tf +++ b/examples/satellite-ibm/main.tf @@ -1,6 +1,6 @@ ##################################################### # IBM Cloud Satellite - IBM Example -# Copyright 2021, 2024 IBM +# Copyright 2021, 2023 IBM ##################################################### provider "ibm" { @@ -26,6 +26,4 @@ module "satellite-location" { resource_group = var.resource_group host_provider = "ibm" coreos_host = var.coreos_host - pod_subnet = var.pod_subnet - service_subnet = var.service_subnet } \ No newline at end of file diff --git a/examples/satellite-ibm/variables.tf b/examples/satellite-ibm/variables.tf index fa47f5e..58b9155 100644 --- a/examples/satellite-ibm/variables.tf +++ b/examples/satellite-ibm/variables.tf @@ -70,18 +70,6 @@ variable "coreos_host" { default = false } -variable "pod_subnet" { - description = "Custom subnet CIDR to provide private IP addresses for pods" - type = string - default = null -} - -variable "service_subnet" { - description = "Custom subnet CIDR to provide private IP addresses for services" - type = string - default = null -} - ################################################## # IBMCLOUD VPC VSI Variables ################################################## @@ -226,7 +214,7 @@ variable "operating_system" { variable "kube_version" { description = "Satellite Kube Version" - default = "4.14_openshift" + default = "4.10_openshift" } variable "worker_count" { @@ -271,12 +259,6 @@ variable "delete_timeout" { default = null } -variable "calico_ip_autodetection" { - description = "Set IP autodetection to use correct interface for Calico" - type = map(string) - default = null -} - ################################################## # IBMCLOUD ROKS Cluster Worker Pool Variables ################################################## diff --git a/examples/satellite-ibm/versions.tf b/examples/satellite-ibm/versions.tf index 735f987..51c3633 100644 --- a/examples/satellite-ibm/versions.tf +++ b/examples/satellite-ibm/versions.tf @@ -1,6 +1,6 @@ ##################################################### # IBM Cloud Satellite Module -# Copyright 2021, 2024 IBM +# Copyright 2021 IBM ##################################################### /*************************************************** @@ -22,7 +22,7 @@ terraform { required_providers { ibm = { source = "IBM-Cloud/ibm" - version = "~> 1.64.0" + version = "~> 1.49.0" } tls = { source = "hashicorp/tls" diff --git a/modules/cluster/main.tf b/modules/cluster/main.tf index b23d76d..c3e4519 100644 --- a/modules/cluster/main.tf +++ b/modules/cluster/main.tf @@ -13,16 +13,15 @@ data "ibm_resource_group" "rg_cluster" { resource "ibm_satellite_cluster" "create_cluster" { count = var.create_cluster ? 1 : 0 - name = var.cluster - location = var.location - resource_group_id = data.ibm_resource_group.rg_cluster.id - enable_config_admin = true - kube_version = var.kube_version - wait_for_worker_update = (var.wait_for_worker_update ? var.wait_for_worker_update : true) - worker_count = (var.worker_count != null ? var.worker_count : null) - host_labels = (var.host_labels != null ? var.host_labels : null) - operating_system = var.operating_system - calico_ip_autodetection = (var.calico_ip_autodetection != null ? var.calico_ip_autodetection : null) + name = var.cluster + location = var.location + resource_group_id = data.ibm_resource_group.rg_cluster.id + enable_config_admin = true + kube_version = var.kube_version + wait_for_worker_update = (var.wait_for_worker_update ? var.wait_for_worker_update : true) + worker_count = (var.worker_count != null ? var.worker_count : null) + host_labels = (var.host_labels != null ? var.host_labels : null) + operating_system = var.operating_system dynamic "zones" { for_each = (var.zones != null ? var.zones : null) diff --git a/modules/cluster/variables.tf b/modules/cluster/variables.tf index d16544a..8483300 100644 --- a/modules/cluster/variables.tf +++ b/modules/cluster/variables.tf @@ -95,10 +95,4 @@ variable "operating_system" { error_message = "Operating system must be one of: REDHAT_7_64, REDHAT_8_64, RHCOS." condition = var.operating_system == null || contains(["REDHAT_7_64", "REDHAT_8_64", "RHCOS"], coalesce(var.operating_system, "allownull")) } -} - -variable "calico_ip_autodetection" { - description = "Set IP autodetection to use correct interface for Calico" - type = map(string) - default = null -} +} \ No newline at end of file diff --git a/modules/location/main.tf b/modules/location/main.tf index 5655703..71855cd 100644 --- a/modules/location/main.tf +++ b/modules/location/main.tf @@ -10,8 +10,6 @@ resource "ibm_satellite_location" "create_location" { zones = (var.location_zones != null ? var.location_zones : null) resource_group_id = data.ibm_resource_group.res_group.id coreos_enabled = var.coreos_enabled - pod_subnet = var.pod_subnet - service_subnet = var.service_subnet cos_config { bucket = (var.location_bucket != null ? var.location_bucket : null) diff --git a/modules/location/variables.tf b/modules/location/variables.tf index 31a1a7b..8592381 100644 --- a/modules/location/variables.tf +++ b/modules/location/variables.tf @@ -75,16 +75,4 @@ variable "custom_script" { description = "Custom script to insert into host attach script. Can be used for OS configuration/preparation. This will override whatever the provider inserts based on host_provider." type = string default = null -} - -variable "pod_subnet" { - description = "Custom subnet CIDR to provide private IP addresses for services" - type = string - default = null -} - -variable "service_subnet" { - description = "Custom subnet CIDR to provide private IP addresses for pods" - type = string - default = null -} +} \ No newline at end of file