Skip to content

Commit

Permalink
have CPs pre-provision CM (#345)
Browse files Browse the repository at this point in the history
this will set us up for any addons to assume CM is pre-existing. ie: vm
onboarding needs a cert, so want to have that prepared before hand.
  • Loading branch information
shamusx authored Dec 28, 2023
1 parent 8ea48ab commit d477175
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/tsb/cp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ provider "kubernetes" {
token = var.k8s_client_token
}

resource "kubernetes_namespace" "istio-system" {
metadata {
name = "istio-system"
}
lifecycle {
ignore_changes = [metadata]
}
}

resource "null_resource" "jumpbox_tctl" {
connection {
host = var.jumpbox_host
Expand Down Expand Up @@ -71,7 +80,6 @@ resource "helm_release" "controlplane" {
repository_password = var.tsb_helm_repository_password
chart = "controlplane"
version = var.tsb_helm_version
create_namespace = true
namespace = "istio-system"
timeout = 900

Expand Down Expand Up @@ -102,6 +110,7 @@ resource "helm_release" "controlplane" {
name = "secrets.elasticsearch.cacert"
value = var.es_cacert
}
depends_on = [ kubernetes_namespace.istio-system ]
}

resource "kubernetes_secret" "redis_password" {
Expand Down
8 changes: 8 additions & 0 deletions tsb/cp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ data "terraform_remote_state" "tsb_mp" {
}
}

module "cert-manager" {
source = "../../modules/addons/cert-manager"
cluster_name = data.terraform_remote_state.infra.outputs.cluster_name
k8s_host = data.terraform_remote_state.infra.outputs.host
k8s_cluster_ca_certificate = data.terraform_remote_state.infra.outputs.cluster_ca_certificate
k8s_client_token = data.terraform_remote_state.k8s_auth.outputs.token
cert-manager_enabled = local.cluster.tetrate.management_plane ? false : var.cert-manager_enabled
}
module "ratelimit" {
source = "../../modules/addons/ratelimit"
cluster_name = data.terraform_remote_state.infra.outputs.cluster_name
Expand Down

0 comments on commit d477175

Please sign in to comment.