From 2fc151251e980dc39be8b815eb4f5be022d5f744 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 24 Apr 2024 00:31:29 -0700 Subject: [PATCH] Proof of concept for working simple nginx service --- lab/cluster/hello.tf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lab/cluster/hello.tf diff --git a/lab/cluster/hello.tf b/lab/cluster/hello.tf new file mode 100644 index 0000000..afba7d3 --- /dev/null +++ b/lab/cluster/hello.tf @@ -0,0 +1,37 @@ +resource kubernetes_pod nginx_plain { + metadata { + name = "plain-service" + labels = { + app = "plain-app" + } + } + spec { + container { + image = "nginx" + name = "plain-hello" + env { + name = "arbitrary" + value = "rando value" + } + port { + container_port = 80 + } + } + } +} + +resource kubernetes_service nginx_plain { + metadata { + name = "plain-service" + } + spec { + selector = { + app = kubernetes_pod.nginx_plain.metadata.0.labels.app + } + port { + port = 8080 + target_port = 80 + } + type = "LoadBalancer" + } +}