From 11fcb6aa4957c3e1d5b77f8cc391479e81386985 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sun, 10 Oct 2021 02:58:38 +0200
Subject: [PATCH] terraform: Use correct labels for API and ingress

This patch adjust the label selectors for the loadbalancer and splits
into the expected ingress and master labels to correspond with the
firewall rules.
---
 terraform/loadbalancer.tf | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/terraform/loadbalancer.tf b/terraform/loadbalancer.tf
index 375ac8154..f01dca818 100644
--- a/terraform/loadbalancer.tf
+++ b/terraform/loadbalancer.tf
@@ -4,10 +4,17 @@ resource "hcloud_load_balancer" "lb" {
   location           = var.location
 }
 
-resource "hcloud_load_balancer_target" "lb_target" {
+resource "hcloud_load_balancer_target" "lb_target_master" {
   type             = "label_selector"
   load_balancer_id = hcloud_load_balancer.lb.id
-  label_selector   = "k8s.io/node"
+  label_selector   = "k8s.io/master"
+  use_private_ip   = false
+}
+
+resource "hcloud_load_balancer_target" "lb_target_ingress" {
+  type             = "label_selector"
+  load_balancer_id = hcloud_load_balancer.lb.id
+  label_selector   = "k8s.io/ingress"
   use_private_ip   = false
 }
 
-- 
GitLab