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}" +}