From 312d2e0e14a4fc71d4225588a16e7117d5e3bb7e Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Wed, 29 Jan 2025 09:47:03 -0600 Subject: [PATCH] Expose k8s application config via terraform --- charms/worker/k8s/terraform/main.tf | 6 ++++++ charms/worker/k8s/terraform/variables.tf | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/charms/worker/k8s/terraform/main.tf b/charms/worker/k8s/terraform/main.tf index fccc1f15..188b365d 100644 --- a/charms/worker/k8s/terraform/main.tf +++ b/charms/worker/k8s/terraform/main.tf @@ -12,6 +12,12 @@ resource "juju_application" "k8s" { base = var.base } + expose { + cidrs = var.expose.cidrs + endpoints = var.expose.endpoints + spaces = var.expose.spaces + } + config = var.config constraints = var.constraints units = var.units diff --git a/charms/worker/k8s/terraform/variables.tf b/charms/worker/k8s/terraform/variables.tf index 74652458..ccb72ad5 100644 --- a/charms/worker/k8s/terraform/variables.tf +++ b/charms/worker/k8s/terraform/variables.tf @@ -57,3 +57,13 @@ variable "units" { type = number default = 1 } + +variable "expose" { + description = "How to expose the Kubernetes API endpoint" + type = map(string) + default = { + cidrs = "0.0.0.0/32" + endpoints = null + spaces = null + } +} \ No newline at end of file