From 9550dbb9b58eab38a7ec57ed685f3243489981e7 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 24 Apr 2024 00:58:59 -0700 Subject: [PATCH] Filebrowser almost setup now --- lab/cluster/filebrowser.tf | 39 ++++++++++++++++++++++++++++++++++++++ lab/cluster/output.tf | 6 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 lab/cluster/filebrowser.tf diff --git a/lab/cluster/filebrowser.tf b/lab/cluster/filebrowser.tf new file mode 100644 index 0000000..c6c4509 --- /dev/null +++ b/lab/cluster/filebrowser.tf @@ -0,0 +1,39 @@ +resource kubernetes_pod filebrowser { + metadata { + name = "filebrowser" + namespace = kubernetes_namespace.vault.metadata.0.name + labels = { + app = "filebrowser" + } + } + spec { + container { + image = "filebrowser/filebrowser" + name = "filebrowser" + env { + name = "TZ" + value = "PST" + } + port { + container_port = 80 + } + } + } +} + +resource kubernetes_service filebrowser { + metadata { + name = "filebrowser" + namespace = kubernetes_namespace.vault.metadata.0.name + } + spec { + selector = { + app = kubernetes_pod.filebrowser.metadata.0.labels.app + } + port { + port = 8000 + target_port = 80 + } + type = "LoadBalancer" + } +} diff --git a/lab/cluster/output.tf b/lab/cluster/output.tf index 64158ce..6374da3 100644 --- a/lab/cluster/output.tf +++ b/lab/cluster/output.tf @@ -1,3 +1,7 @@ -output hello_address { +output hello { value = "${var.cluster_dns}:${kubernetes_service.nginx_plain.spec.0.port.0.port}" } + +output filebrowser { + value = "${var.cluster_dns}:${kubernetes_service.filebrowser.spec.0.port.0.port}" +}