Skip to content

Commit 3208f2d

Browse files
authored
fix: removed support for deprecated OCP version 4.10 (#298)
1 parent d1f05dd commit 3208f2d

Some content is hidden

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

56 files changed

+542
-1084
lines changed

.secrets.baseline

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2023-07-09T10:32:00Z",
6+
"generated_at": "2023-11-23T15:12:20Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -76,7 +76,18 @@
7676
"name": "TwilioKeyDetector"
7777
}
7878
],
79-
"results": {},
79+
"results": {
80+
"README.md": [
81+
{
82+
"hashed_secret": "dce1f02ca7cc4b63ac43008b7a3ce96e702a0c24",
83+
"is_secret": false,
84+
"is_verified": false,
85+
"line_number": 37,
86+
"type": "Secret Keyword",
87+
"verified_result": null
88+
}
89+
]
90+
},
8091
"version": "0.13.1+ibm.61.dss",
8192
"word_list": {
8293
"file": null,

README.md

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,48 @@
1-
<!-- BEGIN MODULE HOOK -->
2-
3-
<!-- Update the title to match the module name and add a description -->
4-
5-
# terraform-ibm-base-ocp-vpc module
6-
7-
<!-- UPDATE BADGE: Update the link for the badge below-->
1+
# Red Hat OpenShift VPC cluster on IBM Cloud module
82

93
[![Graduated (Supported)](https://img.shields.io/badge/Status-Graduated%20(Supported)-brightgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
104
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-base-ocp-vpc?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/releases/latest)
115
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
126
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
137
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
148

15-
A module for provisioning an IBM Cloud Red Hat OpenShift cluster on VPC Gen2. The module either creates the required Cloud Object Storage instance or uses an existing instance. The module also supports optionally passing a key management configuration for secret encryption and boot volume encryption
9+
A module for provisioning an IBM Cloud Red Hat OpenShift cluster on VPC Gen2. The module either creates the required Cloud Object Storage instance or uses an existing instance. The module also supports optionally passing a key management configuration for secret encryption and boot volume encryption.
1610

17-
## Before you begin
11+
### Before you begin
1812

1913
- Make sure that you have a recent version of the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started)
2014
- Make sure that you have a recent version of the [IBM Cloud Kubernetes service CLI](https://cloud.ibm.com/docs/containers?topic=containers-kubernetes-service-cli)
2115

22-
## Usage
16+
<!-- Below content is automatically populated via pre-commit hook -->
17+
<!-- BEGIN OVERVIEW HOOK -->
18+
## Overview
19+
* [terraform-ibm-base-ocp-vpc](#terraform-ibm-base-ocp-vpc)
20+
* [Submodules](./modules)
21+
* [fscloud](./modules/fscloud)
22+
* [Examples](./examples)
23+
* [2 MZR clusters in same VPC example](./examples/multiple_mzr_clusters)
24+
* [Advanced example (mzr, auto-scale, kms, taints)](./examples/advanced)
25+
* [Basic single zone example](./examples/basic)
26+
* [Cluster security group rules example](./examples/add_rules_to_sg)
27+
* [Financial Services compliant example](./examples/fscloud)
28+
* [Contributing](#contributing)
29+
<!-- END OVERVIEW HOOK -->
30+
31+
<!-- This heading should always match the name of the root level module (aka the repo name) -->
32+
## terraform-ibm-base-ocp-vpc
33+
34+
### Usage
2335
```hcl
24-
# Replace "master" with a GIT release version to lock into a specific release
2536
module "ocp_base" {
26-
# update this value to the value of your IBM Cloud API key
27-
ibmcloud_api_key = "ibm cloud api key" # pragma: allowlist secret
28-
source = "terraform-ibm-modules/base-ocp-vpc/ibm"
29-
version = "latest" # Replace "latest" with a release version to lock into a specific release
37+
ibmcloud_api_key = "XXXXXXXXXXXXXXXXXXX"
38+
source = "terraform-ibm-modules/base-ocp-vpc/ibm"
39+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
3040
cluster_name = "example-cluster-name"
31-
# modify the value for resource_group_id with and id of a group you own
32-
resource_group_id = "id of existing resource group"
41+
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
3342
region = "us-south"
3443
force_delete_storage = true
35-
vpc_id = "id of existing VPC"
36-
## obtain the below values from the targeted VPC and adjust to the number of zones,
37-
## subnets, subnet name, cidr_block, id, zone
44+
vpc_id = "79cxxxx-xxxx-xxxx-xxxx-xxxxxXX8667"
45+
# obtain the below values from the targeted VPC and adjust to the number of zones, subnets, subnet name, cidr_block, id, zone
3846
vpc_subnets = {
3947
zone-1 = [
4048
{
@@ -91,9 +99,9 @@ module "ocp_base" {
9199
}
92100
```
93101

94-
## Troubleshooting
102+
### Troubleshooting
95103

96-
### New kube_version message
104+
#### New kube_version message
97105

98106
- When you run a `terraform plan` command, you might get a message about a new version of Kubernetes, as in the following example:
99107

@@ -107,7 +115,7 @@ module "ocp_base" {
107115
108116
The Kubernetes version is ignored in the module code, so the infrastructure will not be changed. The message identifies only that drift exists in the versions, and after you run a `terraform apply` command, the state will be refreshed.
109117
110-
## Required IAM access policies
118+
### Required IAM access policies
111119
You need the following permissions to run this module.
112120
113121
- Account Management
@@ -132,21 +140,9 @@ Optionally, you need the following permissions to attach Access Management tags
132140
- **Tagging** service
133141
- `Administrator` platform access
134142
135-
## Note :
143+
### Note :
136144
- One worker pool should always be named as `default`. Refer [issue 2849](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849) for further details.
137145
138-
<!-- BEGIN EXAMPLES HOOK -->
139-
## Examples
140-
141-
- [ Add Rules to Security Groups Example](examples/add_rules_to_sg)
142-
- [ Apply Taints Example](examples/apply_taints)
143-
- [ Existing COS](examples/existing_cos)
144-
- [ Financial Services Cloud profile example](examples/fscloud)
145-
- [ 2 MZR clusters in same VPC](examples/multiple_mzr_clusters)
146-
- [ Single zone autoscaling cluster example](examples/single_zone_autoscale_cluster)
147-
- [ Standard Example With User Managed Boot Volume Encryption](examples/standard)
148-
<!-- END EXAMPLES HOOK -->
149-
150146
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
151147
### Requirements
152148
@@ -230,12 +226,9 @@ Optionally, you need the following permissions to attach Access Management tags
230226
| <a name="output_workerpools"></a> [workerpools](#output\_workerpools) | Worker pools created |
231227
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
232228
233-
<!-- BEGIN CONTRIBUTING HOOK -->
234-
235229
<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->
236230
## Contributing
237231
238232
You can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).
239233
240234
To set up your local development environment, see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation.
241-
<!-- END CONTRIBUTING HOOK -->

examples/add_rules_to_sg/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
# Add Rules to Security Groups Example
1+
# Cluster security group rules example
22

3-
This example will add security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups
3+
This example will add security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups.
4+
5+
The following resources are provisioned by this example:
6+
- A new resource group, if an existing one is not passed in.
7+
- A VPC with subnets in a single zone and public gw attached
8+
- Security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups
9+
- A basic single zone OCP VPC cluster

examples/add_rules_to_sg/main.tf

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
##############################################################################
2-
# Provision an OCP cluster with one extra worker pool inside a VPC
3-
##############################################################################
1+
########################################################################################################################
2+
# Resource Group
3+
########################################################################################################################
44

55
module "resource_group" {
66
source = "terraform-ibm-modules/resource-group/ibm"
@@ -10,13 +10,9 @@ module "resource_group" {
1010
existing_resource_group_name = var.resource_group
1111
}
1212

13-
##############################################################################
14-
# Create a VPC with single subnet and zone, and public gateway
15-
# NOTE: this is a very simple VPC/Subnet configuration for example purposes only,
16-
# that will allow all traffic ingress/egress by default.
17-
# For production use cases this would need to be enhanced by adding more subnets
18-
# and zones for resiliency, and ACLs/Security Groups for network security.
19-
##############################################################################
13+
########################################################################################################################
14+
# VPC
15+
########################################################################################################################
2016

2117
resource "ibm_is_vpc" "vpc" {
2218
name = "${var.prefix}-vpc"
@@ -25,13 +21,21 @@ resource "ibm_is_vpc" "vpc" {
2521
tags = var.resource_tags
2622
}
2723

24+
########################################################################################################################
25+
# Public Gateway in zone-1
26+
########################################################################################################################
27+
2828
resource "ibm_is_public_gateway" "gateway" {
2929
name = "${var.prefix}-gateway-1"
3030
vpc = ibm_is_vpc.vpc.id
3131
resource_group = module.resource_group.resource_group_id
3232
zone = "${var.region}-1"
3333
}
3434

35+
########################################################################################################################
36+
# Subnet in zone-1
37+
########################################################################################################################
38+
3539
resource "ibm_is_subnet" "subnet_zone_1" {
3640
name = "${var.prefix}-subnet-1"
3741
vpc = ibm_is_vpc.vpc.id
@@ -41,9 +45,9 @@ resource "ibm_is_subnet" "subnet_zone_1" {
4145
public_gateway = ibm_is_public_gateway.gateway.id
4246
}
4347

44-
##############################################################################
45-
# Security Group Rules addition.
46-
##############################################################################
48+
########################################################################################################################
49+
# Security Group Rules addition
50+
########################################################################################################################
4751

4852
locals {
4953
standard_cluster_allow_rules = [
@@ -127,23 +131,9 @@ resource "ibm_is_security_group_rule" "kube_cluster_rules" {
127131
}
128132
}
129133

130-
##############################################################################
131-
# Key Protect
132-
##############################################################################
133-
134-
module "kp_all_inclusive" {
135-
source = "terraform-ibm-modules/key-protect-all-inclusive/ibm"
136-
version = "4.4.1"
137-
key_protect_instance_name = "${var.prefix}-kp-instance"
138-
resource_group_id = module.resource_group.resource_group_id
139-
region = var.region
140-
resource_tags = var.resource_tags
141-
key_map = { "ocp" = ["${var.prefix}-cluster-key"] }
142-
}
143-
144-
##############################################################################
145-
# Base OCP Cluster
146-
##############################################################################
134+
########################################################################################################################
135+
# OCP VPC single zone cluster
136+
########################################################################################################################
147137

148138
locals {
149139
cluster_vpc_subnets = {
@@ -180,10 +170,4 @@ module "ocp_base" {
180170
worker_pools = local.worker_pools
181171
ocp_version = var.ocp_version
182172
tags = var.resource_tags
183-
kms_config = {
184-
instance_id = module.kp_all_inclusive.key_protect_guid
185-
crk_id = module.kp_all_inclusive.keys["ocp.${var.prefix}-cluster-key"].key_id
186-
}
187173
}
188-
189-
##############################################################################

examples/add_rules_to_sg/outputs.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
##############################################################################
1+
########################################################################################################################
22
# Outputs
3-
##############################################################################
3+
########################################################################################################################
44

55
output "cluster_name" {
66
value = module.ocp_base.cluster_name
@@ -18,5 +18,3 @@ output "kube_cluster_rule_id" {
1818
description = "The kube-cluster-id security group rule ids"
1919
value = join(",", [for rule in data.ibm_is_security_group.kube_cluster_sg.rules : rule.rule_id])
2020
}
21-
22-
##############################################################################
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
##############################################################################
1+
########################################################################################################################
22
# Terraform providers
3-
##############################################################################
3+
########################################################################################################################
44

55
provider "ibm" {
66
ibmcloud_api_key = var.ibmcloud_api_key
77
region = var.region
88
}
9-
10-
##############################################################################

examples/add_rules_to_sg/variables.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
##############################################################################
1+
########################################################################################################################
22
# Input Variables
3-
##############################################################################
3+
########################################################################################################################
44

55
variable "ibmcloud_api_key" {
66
type = string
7-
description = "The IBM Cloud api token"
7+
description = "The IBM Cloud api key"
88
sensitive = true
99
}
1010

1111
variable "prefix" {
1212
type = string
1313
description = "Prefix for name of all resource created by this example"
14-
default = "base-ocp-std"
14+
default = "base-ocp-sg"
1515
validation {
1616
error_message = "Prefix must begin and end with a letter and contain only letters, numbers, and - characters."
1717
condition = can(regex("^([A-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix))

examples/add_rules_to_sg/version.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
terraform {
2-
required_version = ">=1.3.0, < 1.6.0"
2+
required_version = ">= 1.3.0, <1.6.0"
3+
4+
# Ensure that there is always 1 example locked into the lowest provider version of the range defined in the main
5+
# module's version.tf (basic and add_rules_to_sg), and 1 example that will always use the latest provider version (advanced, fscloud and multiple mzr).
36
required_providers {
47
ibm = {
5-
source = "ibm-cloud/ibm"
6-
version = ">= 1.59.0"
8+
source = "IBM-Cloud/ibm"
9+
version = "1.59.0"
710
}
811
}
912
}
10-
11-
##############################################################################

examples/advanced/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Advanced example (mzr, auto-scale, kms, taints)
2+
3+
An advanced example which shows how to create a multi-zone KMS encrypted OCP VPC cluster with custom worker node taints
4+
5+
The following resources are provisioned by this example:
6+
- A new resource group, if an existing one is not passed in.
7+
- A Key Protect instance with 2 root keys, one for cluster encryption, and one for worker block storage encryption
8+
- A VPC with subnets across 3 zones
9+
- A public gateway only in zone-1
10+
- A multi-zone (3 zone) KMS encrypted OCP VPC cluster, with worker pools in each zone
11+
- Auto scaling enabled for the default worker pool
12+
- Taints against the workers in zone-2 and zone-3

0 commit comments

Comments
 (0)