installer: app templates
diff --git a/core/installer/values-tmpl/core-auth.yaml b/core/installer/values-tmpl/core-auth.yaml
index 53c8ca9..13e9c9c 100644
--- a/core/installer/values-tmpl/core-auth.yaml
+++ b/core/installer/values-tmpl/core-auth.yaml
@@ -297,3 +297,4 @@
       ingressClassName: {{ .Global.PCloudEnvName }}-ingress-public
       domain: {{ .Global.Domain }}
       internalDomain: p.{{ .Global.Domain }}
+      hydra: hydra-admin.lekva-core-auth.svc.cluster.local
diff --git a/core/installer/values-tmpl/headscale.yaml b/core/installer/values-tmpl/headscale.yaml
index cecd068..79e457e 100644
--- a/core/installer/values-tmpl/headscale.yaml
+++ b/core/installer/values-tmpl/headscale.yaml
@@ -52,4 +52,10 @@
       hydraPublic: https://hydra.{{ .Global.Domain }}
       clientId: headscale
       secretName: oauth2-client-headscale
-
+    ipAddressPool: {{ .Global.Id }}-headscale
+    api:
+      port: 8585
+      image:
+        repository: giolekva/headscale-api
+        tag: latest
+        pullPolicy: Always
diff --git a/core/installer/values-tmpl/ingress-private.jsonschema b/core/installer/values-tmpl/ingress-private.jsonschema
index f9556db..46ae9c3 100644
--- a/core/installer/values-tmpl/ingress-private.jsonschema
+++ b/core/installer/values-tmpl/ingress-private.jsonschema
@@ -2,7 +2,6 @@
   "type": "object",
   "properties": {
     "GandiAPIToken": { "type": "string" },
-	"ReservedIP": { "type": "string" },
   },
   "additionalProperties": false
 }
diff --git a/core/installer/values-tmpl/ingress-private.yaml b/core/installer/values-tmpl/ingress-private.yaml
index 5696f62..f33e179 100644
--- a/core/installer/values-tmpl/ingress-private.yaml
+++ b/core/installer/values-tmpl/ingress-private.yaml
@@ -64,7 +64,8 @@
       service:
         enabled: true
         type: LoadBalancer
-        loadBalancerIP: {{ .Values.ReservedIP }}
+        annotations:
+          metallb.universe.tf/address-pool: {{ .Global.Id }}-ingress-private
       ingressClassByName: true
       ingressClassResource:
         name: {{ .Global.Id }}-ingress-private
diff --git a/core/installer/values-tmpl/metallb-config-env.jsonschema b/core/installer/values-tmpl/metallb-config-env.jsonschema
new file mode 100644
index 0000000..f42d895
--- /dev/null
+++ b/core/installer/values-tmpl/metallb-config-env.jsonschema
@@ -0,0 +1,6 @@
+{
+  "type": "object",
+  "properties": {
+  },
+  "additionalProperties": false
+}
diff --git a/core/installer/values-tmpl/metallb-config-env.md b/core/installer/values-tmpl/metallb-config-env.md
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/core/installer/values-tmpl/metallb-config-env.md
@@ -0,0 +1 @@
+foo
diff --git a/core/installer/values-tmpl/metallb-config-env.yaml b/core/installer/values-tmpl/metallb-config-env.yaml
new file mode 100644
index 0000000..6ea2ac9
--- /dev/null
+++ b/core/installer/values-tmpl/metallb-config-env.yaml
@@ -0,0 +1,22 @@
+apiVersion: helm.toolkit.fluxcd.io/v2beta1
+kind: HelmRelease
+metadata:
+  name: meteallb-config-env
+  namespace: {{ .Global.Id }}
+spec:
+  chart:
+    spec:
+      chart: charts/metallb-config-env
+      sourceRef:
+        kind: GitRepository
+        name: pcloud
+        namespace: {{ .Global.Id }}
+  interval: 1m0s
+  values:
+    id: {{ .Global.Id }}
+    ingressPrivate: {{ .Values.IngressPrivate }}
+    headscale: {{ .Values.Headscale }}
+    softServe: {{ .Values.SoftServe }}
+    rest:
+      from: {{ .Values.Rest.From }}
+      to: {{ .Values.Rest.To }}
diff --git a/core/installer/values-tmpl/tailscale-proxy.jsonschema b/core/installer/values-tmpl/tailscale-proxy.jsonschema
index f42d895..9452893 100644
--- a/core/installer/values-tmpl/tailscale-proxy.jsonschema
+++ b/core/installer/values-tmpl/tailscale-proxy.jsonschema
@@ -1,6 +1,8 @@
 {
   "type": "object",
   "properties": {
+	"Username": { "type": "string", "default": "example" },
+	"IPSubnet": { "type": "string", "default": "10.1.0.1" }
   },
   "additionalProperties": false
 }
diff --git a/core/installer/values-tmpl/tailscale-proxy.yaml b/core/installer/values-tmpl/tailscale-proxy.yaml
index 308cac4..56dec5e 100644
--- a/core/installer/values-tmpl/tailscale-proxy.yaml
+++ b/core/installer/values-tmpl/tailscale-proxy.yaml
@@ -39,3 +39,6 @@
   values:
     hostname: {{ .Global.PCloudEnvName }}-{{ .Global.Id }}-internal-proxy
     loginServer: https://headscale.{{ .Global.Domain }} # TODO(gio): take headscale subdomain from configuration
+    ipSubnet: {{ .Values.IPSubnet }}
+    username: {{ .Values.Username }}
+    preAuthKeySecret: headscale-preauth-key