change proxy auth to code server

This commit is contained in:
2024-03-15 22:36:45 -06:00
parent 42231a40f4
commit 32bda525a1
9 changed files with 44 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: home-assistant name: home-assistant
version: 0.0.16 version: 0.1.0
description: Chart for Home Assistant description: Chart for Home Assistant
keywords: keywords:
- home-automation - home-automation

View File

@@ -4,7 +4,7 @@ metadata:
name: home-assistant name: home-assistant
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
@@ -16,15 +16,15 @@ spec:
type: {{ .Values.deployment.strategy }} type: {{ .Values.deployment.strategy }}
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
template: template:
metadata: metadata:
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
spec: spec:
serviceAccountName: home-assistant serviceAccountName: {{ .Release.Name }}
automountServiceAccountToken: true automountServiceAccountToken: true
containers: containers:
- name: {{ .Release.Name }} - name: {{ .Release.Name }}
@@ -95,4 +95,4 @@ spec:
volumes: volumes:
- name: home-assistant-config - name: home-assistant-config
persistentVolumeClaim: persistentVolumeClaim:
claimName: home-assistant-config claimName: "{{ .Release.Name }}-config"

View File

@@ -2,28 +2,55 @@
apiVersion: traefik.io/v1alpha1 apiVersion: traefik.io/v1alpha1
kind: IngressRoute kind: IngressRoute
metadata: metadata:
name: home-assistant name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
app.kubernetes.io/part-of: home-assistant app.kubernetes.io/part-of: {{ .Release.Name }}
spec: spec:
entryPoints: entryPoints:
- websecure - websecure
routes: routes:
- kind: Rule - kind: Rule
match: "Host(`{{ .Values.ingressRoute.host }}`)" match: "Host(`{{ .Values.ingressRoute.host }}`)"
priority: 10
services:
- kind: Service
name: {{ .Release.Name }}
port: {{ .Values.service.http.port }}
{{- end }}
---
{{- if and .Values.codeserver.ingressRoute.enabled .Values.codeserver.enabled }}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: "{{ .Release.Name }}-codeserver"
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: "Host(`{{ .Values.codeserver.ingressRoute.host }}`)"
middlewares: middlewares:
- name: "authentik-{{ .Release.Name }}" - name: "authentik-{{ .Release.Name }}"
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
priority: 10 priority: 10
services: services:
- kind: Service - kind: Service
name: home-assistant name: "{{ .Release.Name }}-codeserver"
port: {{ .Values.service.http.port }} port: {{ .Values.codeserver.service.http.port }}
- kind: Rule - kind: Rule
match: "Host(`{{ .Values.ingressRoute.host }}`) && PathPrefix(`/outpost.goauthentik.io/`)" match: "Host(`{{ .Values.ingressRoute.host }}`) && PathPrefix(`/outpost.goauthentik.io/`)"
priority: 15 priority: 15
@@ -32,29 +59,3 @@ spec:
name: {{ .Values.ingressRoute.authentik.outpost }} name: {{ .Values.ingressRoute.authentik.outpost }}
port: {{ .Values.ingressRoute.authentik.port }} port: {{ .Values.ingressRoute.authentik.port }}
{{- end }} {{- end }}
---
{{- if and .Values.codeserver.ingressRoute.enabled .Values.codeserver.enabled }}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: home-assistant-codeserver
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: home-assistant
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: "Host(`{{ .Values.codeserver.ingressRoute.host }}`)"
priority: 10
services:
- kind: Service
name: home-assistant-codeserver
port: {{ .Values.codeserver.service.http.port }}
{{- end }}

View File

@@ -1,10 +1,10 @@
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: home-assistant-config name: "{{ .Release.Name }}-config"
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web

View File

@@ -2,14 +2,14 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule kind: PrometheusRule
metadata: metadata:
name: home-assistant name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
app.kubernetes.io/part-of: home-assistant app.kubernetes.io/part-of: {{ .Release.Name }}
spec: spec:
groups: groups:
- name: {{ .Release.Name }} - name: {{ .Release.Name }}

View File

@@ -1,11 +1,11 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: home-assistant name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
app.kubernetes.io/part-of: home-assistant app.kubernetes.io/part-of: {{ .Release.Name }}

View File

@@ -2,18 +2,18 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
name: home-assistant name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
app.kubernetes.io/part-of: home-assistant app.kubernetes.io/part-of: {{ .Release.Name }}
spec: spec:
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
endpoints: endpoints:
- port: http - port: http

View File

@@ -1,10 +1,10 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: home-assistant name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
@@ -17,7 +17,7 @@ spec:
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
--- ---
@@ -25,10 +25,10 @@ spec:
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: home-assistant-codeserver name: "{{ .Release.Name }}-codeserver"
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
@@ -41,6 +41,6 @@ spec:
protocol: TCP protocol: TCP
name: codeserver-http name: codeserver-http
selector: selector:
app.kubernetes.io/name: home-assistant app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }} {{- end }}

View File

@@ -22,7 +22,7 @@ ingressRoute:
enabled: true enabled: true
host: host:
authentik: authentik:
outpost: authentik-proxy-outpost outpost:
port: 9000 port: 9000
metrics: metrics:
enabled: false enabled: false