Skip to content

Commit 3964c3b

Browse files
ericfitzclaude
andcommitted
fix(terraform): align oci-private template with recent oci-public fixes
- Update kubernetes provider comment block: remove stale references to exec-based auth, GODEBUG workaround, and dummy host fallback; add deploy-oci.sh reference and manual kubeconfig instructions - Add explicit oke_public_endpoint = false and lb_public = false to network and kubernetes module calls for clarity and defensive coding - Add tmi_ux_load_balancer_ip and tmi_tf_wh_load_balancer_ip outputs to match public template parity - Improve load_balancer_ip output description for consistency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4427ae1 commit 3964c3b

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

terraform/environments/oci-private/main.tf

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,14 @@ provider "oci" {
4848
# auth = "InstancePrincipal" # Uncomment for IMDS authentication
4949
}
5050

51-
# Kubernetes Provider - configured after OKE cluster creation
52-
# Uses OCI CLI for token authentication
53-
# Note: Run with GODEBUG=x509negativeserial=1 if Go 1.24+ rejects OKE certs
51+
# Kubernetes Provider - uses kubeconfig for authentication.
5452
#
55-
# IMPORTANT: Fresh deployments or cluster-replacing changes require TWO applies.
56-
# The first apply creates the OKE cluster; the second creates K8s resources.
57-
# On the first apply the cluster endpoint is unknown, so the provider falls back
58-
# to a dummy host and "echo" command that let Terraform initialise without error.
59-
# The kubernetes provider v3.x has a bug where exec-based auth with an
60-
# explicit host fails during ConfigureProvider with "default cluster has no
61-
# server defined". Using kubeconfig-based auth avoids this.
53+
# Fresh deployments require two applies (Phase 1: infra, Phase 2: K8s resources).
54+
# The deploy-oci.sh script handles this automatically by providing an empty
55+
# kubeconfig for Phase 1, then generating a real one after the OKE cluster is
56+
# created and active.
6257
#
63-
# Prerequisites: run the following before terraform apply/destroy:
58+
# For manual deployments, generate a kubeconfig before apply/destroy:
6459
# oci ce cluster create-kubeconfig \
6560
# --cluster-id <cluster-id> --region <region> --profile <profile> \
6661
# --token-version 2.0.0
@@ -184,6 +179,8 @@ module "network" {
184179
oke_api_subnet_cidr = var.oke_api_subnet_cidr
185180
oke_pod_subnet_cidr = var.oke_pod_subnet_cidr
186181
oke_api_authorized_cidrs = ["${local.deployer_ip}/32"]
182+
oke_public_endpoint = false
183+
lb_public = false
187184

188185
tags = local.tags
189186
}
@@ -322,6 +319,8 @@ module "kubernetes" {
322319
# Network configuration — use private subnets for LB (internal only)
323320
vcn_id = module.network.vcn_id
324321
oke_api_subnet_id = module.network.oke_api_subnet_id
322+
oke_public_endpoint = false
323+
lb_public = false
325324
oke_worker_subnet_id = module.network.private_subnet_id
326325
oke_pod_subnet_id = module.network.oke_pod_subnet_id
327326
public_subnet_ids = [module.network.private_subnet_id] # Internal LB in private subnet

terraform/environments/oci-private/outputs.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,20 @@ output "note" {
5252
# Additional Outputs
5353
# ---------------------------------------------------------------------------
5454
output "load_balancer_ip" {
55-
description = "Internal IP address of the load balancer"
55+
description = "Internal IP address of the TMI API load balancer"
5656
value = module.kubernetes.load_balancer_ip
5757
}
5858

59+
output "tmi_ux_load_balancer_ip" {
60+
description = "Internal IP address of the TMI-UX load balancer"
61+
value = module.kubernetes.tmi_ux_load_balancer_ip
62+
}
63+
64+
output "tmi_tf_wh_load_balancer_ip" {
65+
description = "Internal IP address of the tmi-tf-wh webhook load balancer (null when ClusterIP)"
66+
value = module.kubernetes.tmi_tf_wh_load_balancer_ip
67+
}
68+
5969
output "vcn_id" {
6070
description = "OCID of the VCN"
6171
value = module.network.vcn_id

0 commit comments

Comments
 (0)