headscale: run ui container
diff --git a/charts/headscale/templates/headscale.yaml b/charts/headscale/templates/headscale.yaml
index 128a24c..fa58ab5 100644
--- a/charts/headscale/templates/headscale.yaml
+++ b/charts/headscale/templates/headscale.yaml
@@ -6,6 +6,9 @@
annotations:
acme.cert-manager.io/http01-edit-in-place: "true"
cert-manager.io/cluster-issuer: {{ .Values.certificateIssuer}}
+ {{ if .Values.ui.enabled }}
+ nginx.org/rewrites: "serviceName=headscale rewrite=/;serviceName=headscale-ui rewrite=/"
+ {{ end }}
spec:
ingressClassName: {{ .Values.ingressClassName }}
tls:
@@ -23,6 +26,15 @@
name: headscale
port:
name: http
+ {{ if .Values.ui.enabled }}
+ - path: /web
+ pathType: Prefix
+ backend:
+ service:
+ name: headscale-ui
+ port:
+ name: http
+ {{ end }}
---
apiVersion: v1
kind: Service
@@ -40,6 +52,25 @@
port: 80
targetPort: http
protocol: TCP
+{{ if .Values.ui.enabled }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: headscale-ui
+ namespace: {{ .Release.Namespace }}
+ # annotations:
+ # metallb.universe.tf/address-pool: {{ .Values.ipAddressPool }}
+spec:
+ type: ClusterIP
+ selector:
+ app: headscale
+ ports:
+ - name: http
+ port: 80
+ targetPort: http-ui
+ protocol: TCP
+{{ end }}
---
apiVersion: v1
kind: Service
@@ -160,3 +191,12 @@
readOnly: false
- mountPath: /headscale-api
name: api-socket
+ {{ if .Values.ui.enabled }}
+ - name: headscale-ui # TODO(gio): separate deployment
+ image: {{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag }}
+ imagePullPolicy: {{ .Values.ui.image.pullPolicy }}
+ ports:
+ - name: http-ui
+ containerPort: 80
+ protocol: TCP
+ {{ end }}
diff --git a/charts/headscale/values.yaml b/charts/headscale/values.yaml
index e8ccc76..20247f2 100644
--- a/charts/headscale/values.yaml
+++ b/charts/headscale/values.yaml
@@ -20,3 +20,9 @@
repository: giolekva/headscale-api
tag: latest
pullPolicy: Always
+ui:
+ enabled: false
+ image:
+ repository: ghcr.io/gurucomputing/headscale-ui
+ tag: latest
+ pullPolicy: Always
diff --git a/core/installer/values-tmpl/headscale.yaml b/core/installer/values-tmpl/headscale.yaml
index c6c04a2..4eeeacd 100644
--- a/core/installer/values-tmpl/headscale.yaml
+++ b/core/installer/values-tmpl/headscale.yaml
@@ -39,3 +39,5 @@
repository: giolekva/headscale-api
tag: latest
pullPolicy: Always
+ ui:
+ enabled: false