Skip to content

Commit 0db7afd

Browse files
authored
feat: added support to attach additional security groups to the worker pools, VPE and load balancers. See the new [Attaching custom security groups example](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/tree/main/examples/custom_sg) for usage. (#342)
1 parent 1c7f708 commit 0db7afd

File tree

22 files changed

+440
-35
lines changed

22 files changed

+440
-35
lines changed

.secrets.baseline

Lines changed: 2 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-12-11T10:54:11Z",
6+
"generated_at": "2024-01-31T10:58:57Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -82,7 +82,7 @@
8282
"hashed_secret": "dce1f02ca7cc4b63ac43008b7a3ce96e702a0c24",
8383
"is_secret": false,
8484
"is_verified": false,
85-
"line_number": 41,
85+
"line_number": 45,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
}

README.md

Lines changed: 74 additions & 22 deletions
Large diffs are not rendered by default.

examples/add_rules_to_sg/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
This example will add security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups.
44

55
The following resources are provisioned by this example:
6+
67
- A new resource group, if an existing one is not passed in.
78
- A VPC with subnets in a single zone and public gw attached.
89
- Security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups.
910
- A basic single zone OCP VPC cluster.
11+
12+
You may also be interested in the [example](../custom_sg) that attaches separate security groups to worker nodes, as opposed to adding rules to existing IBM managed security groups.

examples/add_rules_to_sg/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = "1.60.0"
9+
version = "1.62.0"
1010
}
1111
}
1212
}

examples/advanced/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = ">= 1.60.0"
9+
version = "1.62.0"
1010
}
1111
kubernetes = {
1212
source = "hashicorp/kubernetes"

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = "1.60.0"
9+
version = "1.62.0"
1010
}
1111
}
1212
}

examples/cross_kms_support/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = "1.60.0"
9+
version = "1.62.0"
1010
}
1111
}
1212
}

examples/custom_sg/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Attaching custom security groups
2+
3+
An example showing how to attach additional security groups to the worker pools, VPE and load balancers:
4+
5+
1. A custom security group, named `custom-cluster-sg`, is specified at cluster creation. This security group is attached to all worker nodes of the cluster, including the worker nodes created after the creation of the cluster.
6+
2. A second custom security group, named `custom-worker-pool-sg`, is specified for one of the `custom-sg` worker pools. This security group is not applied to other worker pools.
7+
3. Three custom security groups, named `custom-master-vpe-sg`, `custom-registry-vpe-sg`, and `custom-api-vpe-sg`, are attached to the three VPEs created by the ROKS-stack: the master VPE, the container registry VPE, and the kubernetes API VPE. This is in addition to the IBM-managed security groups that are still attached to those resources.
8+
4. One custom security group, named `custom-kube-api-vpe-sg`, is attached to the LB created out-of-the-box by the IBM stack.
9+
10+
Furthermore, the default IBM-managed `kube-<clusterId>` security group is linked to all worker nodes of the cluster by utilizing the `attach_ibm_managed_security_group` input variable. It is important to note that, in this configuration, the default VPC security group is not connected to any worker node.
11+
12+
See [Adding VPC security groups to clusters and worker pools during create time](https://cloud.ibm.com/docs/openshift?topic=openshift-vpc-security-group&interface=ui#vpc-sg-worker-pool) for further details.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"ibmcloud_api_key": $VALIDATION_APIKEY,
3+
"region": "au-syd",
4+
"resource_tags": $TAGS,
5+
"prefix": $PREFIX
6+
}

0 commit comments

Comments
 (0)