Skip to content

Commit 950777e

Browse files
committed
feat: added support for using public endpoints in kubeconfig
Signed-off-by: Ali Mukadam <ali.mukadam@oracle.com>
1 parent e39f2fc commit 950777e

File tree

6 files changed

+14
-20
lines changed

6 files changed

+14
-20
lines changed

docs/src/multi/pub-ep.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,6 @@ terraform apply
191191
The operator host is created in the admin region only.
192192
```
193193

194-
## Configure connectivity with Remote Peering Connection
195-
196-
1. In OCI console, select your admin region and navigate to Networking > Dynamic Routing Gateway. Click on the admin drg.
197-
2. Under Resources, click on Remote Peering Connections Attachments.
198-
3. Under Remote Peering Connections, click on the Remote Peering Connection.
199-
4. Copy the RPC OCID (in the right column). Do not mistake the RPC OCID for the DRG OCID which is also shown on the left.
200-
5. If your managed cluster is in another region, select the managed cluster's region. This will change the OCI Console page to Networking > Dynamic Routing Gateway.
201-
6. Repeat steps 2-3.
202-
7. Click on "Establish Connection".
203-
8. Select the region of the Admin cluster.
204-
9. Paste the RPC OCID you copied from Step 4 and click on "Establish Connection".
205-
10. Wait for the Remote Peering to be established.
206-
207194
## Setting up kubeconfig
208195

209196
You will now generate the installation script.

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ module "verrazzano" {
7979

8080
ssh_private_key_path = var.ssh_private_key_path
8181

82+
oke_control_plane = var.oke_control_plane
83+
8284
verrazzano_version = var.verrazzano_version
8385

8486
install_verrazzano = var.install_verrazzano

modules/verrazzano/contexts.tf

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

44
resource "null_resource" "set_contexts" {
5-
for_each = local.all_clusters
6-
5+
# for_each = local.all_clusters
6+
for_each = local.managed_clusters
77
connection {
88
host = var.operator_ip
99
private_key = file(var.ssh_private_key_path)

modules/verrazzano/scripts/generate_kubeconfig.template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Copyright (c) 2023 Oracle Corporation and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
44

5-
oci ce cluster create-kubeconfig --cluster-id ${cluster-id} --file $HOME/.kube/config --region ${region} --token-version 2.0.0 --kube-endpoint PRIVATE_ENDPOINT
5+
oci ce cluster create-kubeconfig --cluster-id ${cluster-id} --file $HOME/.kube/config --region ${region} --token-version 2.0.0 --kube-endpoint ${endpoint}

modules/verrazzano/templates.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ locals {
88
c => templatefile("${path.module}/scripts/generate_kubeconfig.template.sh",
99
{
1010
cluster-id = lookup(var.cluster_ids, c)
11+
endpoint = var.oke_control_plane == "public" ? "PUBLIC_ENDPOINT" : "PRIVATE_ENDPOINT"
1112
region = c == "admin" ? local.admin_region : lookup(local.regions, c)
12-
}
13-
)
13+
}
14+
) if (c != "admin")
1415
}
1516

1617
set_credentials_templates = {
@@ -21,7 +22,7 @@ locals {
2122
cluster-id-11 = substr(lookup(var.cluster_ids, c), (length(lookup(var.cluster_ids, c)) - 11), length(lookup(var.cluster_ids, c)))
2223
region = c == "admin" ? local.admin_region : lookup(local.regions, c)
2324
}
24-
)
25+
) if (c != "admin")
2526
}
2627

2728
set_alias_templates = {
@@ -31,7 +32,7 @@ locals {
3132
cluster = c
3233
cluster-id-11 = substr(lookup(var.cluster_ids, c), (length(lookup(var.cluster_ids, c)) - 11), length(lookup(var.cluster_ids, c)))
3334
}
34-
)
35+
) if (c != "admin")
3536
}
3637

3738
setup_vz_env_template = templatefile("${path.module}/scripts/setup_vz_env.template.sh", {})

modules/verrazzano/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ variable "ssh_private_key_path" {
1212
type = string
1313
}
1414

15+
variable "oke_control_plane" {
16+
type = string
17+
}
18+
1519
variable "install_verrazzano" {
1620
type = bool
1721
}

0 commit comments

Comments
 (0)