Skip to content

Commit 554af42

Browse files
committed
Add IPv6 support
1 parent d29a715 commit 554af42

Some content is hidden

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

53 files changed

+611
-253
lines changed

docs/src/guide/cluster.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The OKE parameters concern mainly the following:
1212
* number of node pools and their respective size of the cluster
1313
* services and pods cidr blocks
1414
* whether to use encryption
15+
* whether you want to enable [dual-stack](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/conteng_ipv4-and-ipv6.htm): IPv4 & IPv6
1516

1617
```admonish notice
1718
If you need to change the default services and pods' CIDRs, note the following:

docs/src/guide/network_subnets.md

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ Subnets are created for core components managed within the module, namely:
2727
{{#include ../../../examples/network/vars-network-subnets-create-cidr.auto.tfvars:4:}}
2828
```
2929

30+
## Create new subnets with IPv4 and IPv6 (CIDR notation)
31+
32+
```javascript
33+
{{#include ../../../examples/network/vars-network-subnets-create-cidr-ipv4-and-ipv6.tfvars:4:}}
34+
```
35+
3036
## Use existing subnets
3137

3238
```javascript

examples/cluster-addons/vars-cluster-addons.auto.tfvars

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
cluster_addons = {
55
"CertManager" = {
66
remove_addon_resources_on_delete = true
7-
override_existing = true # Default is false if not specified
7+
override_existing = true # Default is false if not specified
88
# The list of supported configurations for the cluster addons is here: https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengconfiguringclusteraddons-configurationarguments.htm#contengconfiguringclusteraddons-configurationarguments_CertificateManager
99
configurations = [
1010
{
11-
key = "numOfReplicas"
12-
value = "1"
11+
key = "numOfReplicas"
12+
value = "1"
1313
}
1414
]
1515
}
@@ -20,7 +20,7 @@ cluster_addons = {
2020
# Prevent Flannel pods from being scheduled using a non-existing label as nodeSelector
2121
"Flannel" = {
2222
remove_addon_resources_on_delete = true
23-
override_existing = true # Override the existing configuration with this one, if Flannel addon in already enabled
23+
override_existing = true # Override the existing configuration with this one, if Flannel addon in already enabled
2424
configurations = [
2525
{
2626
key = "nodeSelectors"
@@ -31,7 +31,7 @@ cluster_addons = {
3131
# Prevent Kube-Proxy pods from being scheduled using a non-existing label as nodeSelector
3232
"KubeProxy" = {
3333
remove_addon_resources_on_delete = true
34-
override_existing = true # Override the existing configuration with this one, if KubeProxy addon in already enabled
34+
override_existing = true # Override the existing configuration with this one, if KubeProxy addon in already enabled
3535
configurations = [
3636
{
3737
key = "nodeSelectors"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
1+
# Copyright (c) 2017, 2025 Oracle Corporation and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

44
cluster_name = "oke-example"
5-
kubernetes_version = "v1.31.1"
5+
kubernetes_version = "v1.32.1"
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
1+
# Copyright (c) 2017, 2025 Oracle Corporation and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

44
create_cluster = true // *true/false
@@ -7,9 +7,10 @@ cluster_kms_key_id = null
77
cluster_name = "oke"
88
cluster_type = "enhanced" // *basic/enhanced
99
cni_type = "flannel" // *flannel/npn
10-
assign_public_ip_to_control_plane = true // true/*false
10+
assign_public_ip_to_control_plane = true // true/*false
1111
image_signing_keys = []
12-
kubernetes_version = "v1.31.1"
12+
kubernetes_version = "v1.32.1"
1313
pods_cidr = "10.244.0.0/16"
1414
services_cidr = "10.96.0.0/16"
1515
use_signed_images = false // true/*false
16+
enable_ipv6 = false //true/*false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright (c) 2017, 2025 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
create_cluster = true // *true/false
5+
cluster_dns = null
6+
cluster_kms_key_id = null
7+
cluster_name = "oke"
8+
cluster_type = "enhanced" // *basic/enhanced
9+
cni_type = "flannel" // *flannel/npn
10+
assign_public_ip_to_control_plane = true // true/*false
11+
image_signing_keys = []
12+
kubernetes_version = "v1.32.1"
13+
pods_cidr = "10.244.0.0/16"
14+
services_cidr = "10.96.0.0/16"
15+
use_signed_images = false // true/*false
16+
17+
# Enable OIDC token authentication for Github Actions using API server configuration file
18+
open_id_connect_token_auth_enabled = true
19+
open_id_connect_token_authentication_config = {
20+
configuration_file = base64encode(yamlencode(
21+
{
22+
"apiVersion" = "apiserver.config.k8s.io/v1beta1"
23+
"kind" = "AuthenticationConfiguration"
24+
"jwt" = [
25+
{
26+
"issuer" = {
27+
"url" = "https://token.actions.githubusercontent.com",
28+
"audiences" = [
29+
"oke-kubernetes-cluster" # Must match the audience in the GitHub Actions workflow.
30+
],
31+
"audienceMatchPolicy" = "MatchAny"
32+
}
33+
"claimMappings" = {
34+
"username" = {
35+
"claim" = "sub"
36+
"prefix" = ""
37+
}
38+
}
39+
"claimValidationRules" = [
40+
{
41+
"claim" = "repository"
42+
"requiredValue" = "GITHUB_ACCOUNT/GITHUB_REPOSITORY"
43+
},
44+
{
45+
"claim" = "workflow"
46+
"requiredValue" = "oke-oidc" # Must match the workflow name.
47+
},
48+
{
49+
"claim" = "ref"
50+
"requiredValue" = "refs/heads/main"
51+
},
52+
]
53+
}
54+
]
55+
}
56+
))
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2017, 2025 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
create_cluster = true // *true/false
5+
cluster_dns = null
6+
cluster_kms_key_id = null
7+
cluster_name = "oke"
8+
cluster_type = "enhanced" // *basic/enhanced
9+
cni_type = "flannel" // *flannel/npn
10+
assign_public_ip_to_control_plane = true // true/*false
11+
image_signing_keys = []
12+
kubernetes_version = "v1.32.1"
13+
pods_cidr = "10.244.0.0/16"
14+
services_cidr = "10.96.0.0/16"
15+
use_signed_images = false // true/*false
16+
17+
# Enable OIDC token authentication for Github Actions using API server flags
18+
oidc_token_auth_enabled = true
19+
oidc_token_authentication_config = {
20+
client_id = "oke-kubernetes-cluster" # Must match the audience in the GitHub Actions workflow.
21+
issuer_url = "https://token.actions.githubusercontent.com",
22+
username_claim = "sub"
23+
required_claims = [
24+
{
25+
key = "repository",
26+
value = "GITHUB_ACCOUNT/GITHUB_REPOSITORY"
27+
},
28+
{
29+
key = "workflow",
30+
value = "oke-oidc" # Must match the workflow name.
31+
},
32+
{
33+
key = "ref"
34+
value = "refs/heads/main"
35+
}
36+
],
37+
}
38+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2017, 2025 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
create_cluster = true // *true/false
5+
cluster_dns = null
6+
cluster_kms_key_id = null
7+
cluster_name = "oke"
8+
cluster_type = "enhanced" // *basic/enhanced
9+
cni_type = "flannel" // *flannel/npn
10+
assign_public_ip_to_control_plane = true // true/*false
11+
image_signing_keys = []
12+
kubernetes_version = "v1.32.1"
13+
pods_cidr = "10.244.0.0/16"
14+
services_cidr = "10.96.0.0/16"
15+
use_signed_images = false // true/*false
16+
17+
# Enable OIDC discovery
18+
oidc_discovery_enabled = true

examples/extensions/vars-extensions-service-account.auto.tfvars

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

44
create_service_account = true
5-
service_accounts = {
5+
service_accounts = {
66
# Example to create a cluster role binding using a cluster role.
77
example_cluster_role_binding = {
8-
sa_name = "sa1"
9-
sa_namespace = "kube-system"
10-
sa_cluster_role = "cluster-admin"
8+
sa_name = "sa1"
9+
sa_namespace = "kube-system"
10+
sa_cluster_role = "cluster-admin"
1111
sa_cluster_role_binding = "sa1-crb"
1212
}
1313
# Example to create a role binding using a cluster role.
1414
example_role_binding = {
15-
sa_name = "sa2"
16-
sa_namespace = "default"
15+
sa_name = "sa2"
16+
sa_namespace = "default"
1717
sa_cluster_role = "cluster-admin"
1818
sa_role_binding = "sa1-rb"
1919
}
2020
# Example to create a role binding using a role, the role needs to exist within the namespace.
2121
example_role_binding = {
22-
sa_name = "sa3"
23-
sa_namespace = "kube-system"
24-
sa_role = "system:controller:token-cleaner"
22+
sa_name = "sa3"
23+
sa_namespace = "kube-system"
24+
sa_role = "system:controller:token-cleaner"
2525
sa_role_binding = "sa3-rb"
2626
}
2727
}

examples/istio-mc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ clusters = {
5151
5. Configure additional parameters if necessary:
5252

5353
```
54-
kubernetes_version = "v1.28.2"
54+
kubernetes_version = "v1.32.1"
5555
5656
cluster_type = "basic"
5757

examples/istio-mc/terraform.tfvars.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ clusters = {
2323
c2 = { region = "melbourne", vcn = "10.2.0.0/16", pods = "10.202.0.0/16", services = "10.102.0.0/16", enabled = true }
2424
}
2525

26-
kubernetes_version = "v1.28.2"
26+
kubernetes_version = "v1.32.1"
2727

2828
cluster_type = "basic"
2929

examples/istio-mc/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ variable "clusters" {
6161
}
6262

6363
variable "kubernetes_version" {
64-
default = "v1.30.1"
64+
default = "v1.32.1"
6565
description = "The version of Kubernetes to use."
6666
type = string
6767
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
subnets = {
5+
bastion = { cidr = "10.0.0.0/29", ipv6_cidr = "8, 0" }
6+
operator = { cidr = "10.0.0.64/29", ipv6_cidr = "8, 1" }
7+
cp = { cidr = "10.0.0.8/29", ipv6_cidr = "8, 2" }
8+
int_lb = { cidr = "10.0.0.32/27", ipv6_cidr = "8, 3" }
9+
pub_lb = { cidr = "10.0.128.0/27", ipv6_cidr = "8, 4" }
10+
workers = { cidr = "10.0.144.0/20", ipv6_cidr = "2603:c020:8010:f002::/64" }
11+
pods = { cidr = "10.0.64.0/18", ipv6_cidr = "2603:c020:8010:f003::/64" }
12+
}

examples/network/vars-network.auto.tfvars

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ drg_display_name = "drg"
7474
drg_id = null
7575

7676
# Routing
77-
ig_route_table_id = null # Optional ID of existing internet gateway route table
77+
ig_route_table_id = null # Optional ID of existing internet gateway route table
78+
internet_gateway_id = null # Optional ID of existing internet gateway
7879
internet_gateway_route_rules = [
7980
# {
8081
# destination = "192.168.0.0/16" # Route Rule Destination CIDR
@@ -84,6 +85,9 @@ internet_gateway_route_rules = [
8485
# },
8586
]
8687

88+
igw_ngw_mixed_route_id = null # Optional ID of existing mixed route table NAT GW for IPv4 and Internet GW for IPv6
89+
90+
nat_gateway_id = null # Optional ID of existing NAT gateway
8791
nat_gateway_public_ip_id = "none"
8892
nat_route_table_id = null # Optional ID of existing NAT gateway route table
8993
nat_gateway_route_rules = [

examples/rms/oke-cluster-only/variables-cluster.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ variable "services_cidr" {
2525
default = "10.96.0.0/16"
2626
type = string
2727
}
28-
variable "kubernetes_version" { default = "v1.26.2" }
28+
variable "kubernetes_version" { default = "v1.32.1" }
2929

3030
variable "cluster_kms_vault_id" {
3131
default = null

examples/rms/oke-workers-only/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ variable "cluster_id" {
3232
}
3333
variable "cni_type" { default = "Flannel" }
3434
variable "kubernetes_version" {
35-
default = "v1.26.2"
35+
default = "v1.32.1"
3636
type = string
3737
}
3838

examples/workers/vars-workers-instance.auto.tfvars

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ worker_pools = {
1818
description = "Self-managed Instance With Bursting",
1919
mode = "instance",
2020
size = 1,
21-
burst = "BASELINE_1_8", # Valid values BASELINE_1_8,BASELINE_1_2
21+
burst = "BASELINE_1_8", # Valid values BASELINE_1_8,BASELINE_1_2
2222
},
2323
}

examples/workers/vars-workers-instancepool.auto.tfvars

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ worker_pools = {
1818
description = "Self-managed Instance Pool With Bursting",
1919
mode = "instance-pool",
2020
size = 1,
21-
burst = "BASELINE_1_8", # Valid values BASELINE_1_8,BASELINE_1_2
21+
burst = "BASELINE_1_8", # Valid values BASELINE_1_8,BASELINE_1_2
2222
},
2323
oke-vm-instance-pool-with-block-volume = {
24-
description = "Self-managed Instance Pool with block volume",
25-
mode = "instance-pool",
26-
size = 1,
27-
disable_block_volume = false,
24+
description = "Self-managed Instance Pool with block volume",
25+
mode = "instance-pool",
26+
size = 1,
27+
disable_block_volume = false,
2828
block_volume_size_in_gbs = 60,
2929
},
3030
oke-vm-instance-pool-without-block-volume = {
31-
description = "Self-managed Instance Pool without block volume",
32-
mode = "instance-pool",
33-
size = 1,
31+
description = "Self-managed Instance Pool without block volume",
32+
mode = "instance-pool",
33+
size = 1,
3434
disable_block_volume = true,
3535
},
3636
}

module-cluster.tf

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module "cluster" {
6060
vcn_id = local.vcn_id
6161
cni_type = var.cni_type
6262
control_plane_is_public = var.control_plane_is_public
63+
enable_ipv6 = var.enable_ipv6
6364
assign_public_ip_to_control_plane = var.assign_public_ip_to_control_plane
6465
control_plane_nsg_ids = compact(flatten([var.control_plane_nsg_ids, try(module.network.control_plane_nsg_id, null)]))
6566
control_plane_subnet_id = try(module.network.control_plane_subnet_id, "") # safe destroy; validated in submodule
@@ -70,6 +71,7 @@ module "cluster" {
7071
: try(module.network.int_lb_subnet_id, "")
7172
)
7273

74+
7375
# Cluster
7476
cluster_kms_key_id = var.cluster_kms_key_id
7577
cluster_name = local.cluster_name

0 commit comments

Comments
 (0)