Compare commits

...

9 Commits

Author SHA1 Message Date
639f7a4031 change to use ingress routes 2024-02-13 06:39:52 -07:00
ba3e6551e2 fix ingress class name 2024-02-13 06:15:56 -07:00
d12db5479a fix typo 2024-02-13 06:06:50 -07:00
e44c961258 add home-assistant 2024-02-13 06:01:07 -07:00
0999f6272f fix image repo 2024-02-12 21:05:07 -07:00
7bfb8f5920 bump default resources 2024-02-12 20:55:47 -07:00
eb79c0ba68 add image name value 2024-02-12 20:06:10 -07:00
466b67581f raise default memory request 2024-02-12 19:33:50 -07:00
031b1dec3a fix linting 2024-02-10 11:34:47 -07:00
16 changed files with 432 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
apiVersion: v2
name: home-assistant
version: 0.0.4
description: Chart for Home Assistant
keywords:
- home-automation
sources:
- https://github.com/home-assistant
maintainers:
- name: alexlebens
icon: https://avatars.githubusercontent.com/u/13844975?s=200&v=4
appVersion: 2024.2.1

View File

@@ -0,0 +1,18 @@
## Introduction
[Home Assistant](https://www.home-assistant.io/)
Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.
This chart bootstraps a [Home-Assistant](https://github.com/benphelps/homepage) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Prerequisites
- Kubernetes
- Helm
- Traefik v2 / IngressRoute
- Authentik / Auth
## Parameters
See the [values files](values.yaml).

View File

@@ -0,0 +1,97 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: home-assistant
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: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
revisionHistoryLimit: 3
replicas: {{ .Values.deployment.replicas }}
strategy:
type: {{ .Values.deployment.strategy }}
selector:
matchLabels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: home-assistant
automountServiceAccountToken: true
containers:
- name: {{ .Release.Name }}
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}"
imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.http.port }}
protocol: TCP
env:
{{- range $k,$v := .Values.deployment.env }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- with .Values.deployment.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /config
name: home-assistant-config
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
livenessProbe:
tcpSocket:
port: {{ .Values.service.http.port }}
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
readinessProbe:
tcpSocket:
port: {{ .Values.service.http.port }}
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
startupProbe:
tcpSocket:
port: {{ .Values.service.http.port }}
initialDelaySeconds: 0
failureThreshold: 30
timeoutSeconds: 1
periodSeconds: 5
- name: codeserver
image: "{{ .Values.codeserver.image.repository }}:{{ .Values.codeserver.image.tag }}"
imagePullPolicy: {{ .Values.codeserver.image.imagePullPolicy }}
ports:
- containerPort: {{ .Values.codeserver.service.http.port }}
name: codeserver-http
protocol: TCP
env:
{{- range $k,$v := .Values.codeserver.env }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- with .Values.codeserver.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.codeserver.securityContext | nindent 12 }}
volumeMounts:
- mountPath: /config/home-assistant
name: home-assistant-config
volumes:
- name: home-assistant-config
persistentVolumeClaim:
claimName: home-assistant-config

View File

@@ -0,0 +1,62 @@
{{- if .Values.ingressRoute.enabled }}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: home-assistant
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
app.kubernetes.io/managed-by: helm
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: "Host(`{{ .Values.ingressRoute.host }}`)"
middlewares:
- name: authentik
namespace: {{ .Release.Namespace }}
priority: 10
services:
- kind: Service
name: home-assistant
port: {{ .Values.service.http.port }}
- kind: Rule
match: "Host(`{{ .Values.ingressRoute.host }}`) && PathPrefix(`/outpost.goauthentik.io/`)"
priority: 15
services:
- kind: Service
name: {{ .Values.ingressRoute.authentik.outpost }}
port: {{ .Values.ingressRoute.authentik.port }}
{{- 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
app.kubernetes.io/managed-by: helm
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: "Host(`{{ .Values.codeserver.ingressRoute.host }}`)"
priority: 10
services:
- kind: Service
name: codeserver-http
port: {{ .Values.codeserver.service.http.port }}
{{- end }}

View File

@@ -0,0 +1,30 @@
{{- if .Values.ingress.enabled }}
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: authentik
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: auth
app.kubernetes.io/part-of: home-assistant
app.kubernetes.io/managed-by: helm
spec:
forwardAuth:
address: "http://{{ .Values.ingress.authentik.outpost }}.authentik:{{ .Values.ingress.authentik.port }}/outpost.goauthentik.io/auth/traefik"
trustForwardHeader: true
authResponseHeaders:
- X-authentik-username
- X-authentik-groups
- X-authentik-email
- X-authentik-name
- X-authentik-uid
- X-authentik-jwt
- X-authentik-meta-jwks
- X-authentik-meta-outpost
- X-authentik-meta-provider
- X-authentik-meta-app
- X-authentik-meta-version
{{- end }}

View File

@@ -0,0 +1,20 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: home-assistant-config
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: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.persistence.config.storageSize }}
storageClassName: {{ .Values.persistence.config.storageClassName }}
volumeMode: {{ .Values.persistence.config.volumeMode }}

View File

@@ -0,0 +1,19 @@
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: home-assistant
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
app.kubernetes.io/managed-by: helm
spec:
groups:
- name: {{ .Release.Name }}
rules:
{{- toYaml .Values.prometheusRule.rules | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: home-assistant
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
app.kubernetes.io/managed-by: helm

View File

@@ -0,0 +1,27 @@
{{- if .Values.metrics.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: home-assistant
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
app.kubernetes.io/managed-by: helm
spec:
selector:
matchLabels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/instance: {{ .Release.Name }}
endpoints:
- port: http
interval: {{ .Values.metrics.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
path: /api/prometheus
bearerTokenSecret:
name: {{ .Values.metrics.serviceMonitor.bearerTokenSecret.name }}
key: {{ .Values.metrics.serviceMonitor.bearerTokenSecret.key }}
{{- end }}

View File

@@ -0,0 +1,48 @@
apiVersion: v1
kind: Service
metadata:
name: home-assistant
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: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
type: ClusterIP
ports:
- port: {{ .Values.service.http.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/instance: {{ .Release.Name }}
---
{{- if .Values.codeserver.enabled }}
apiVersion: v1
kind: Service
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: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
type: ClusterIP
ports:
- port: {{ .Values.codeserver.service.http.port }}
targetPort: codeserver-http
protocol: TCP
name: codeserver-http
selector:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@@ -0,0 +1,74 @@
deployment:
replicas: 1
strategy: Recreate
image:
repository: homeassistant/home-assistant
tag: 2024.2.1
imagePullPolicy: IfNotPresent
env:
TZ: US/Mountain
envFrom:
resources:
requests:
memory: 512Mi
cpu: 50m
limits:
memory: 1Gi
cpu: 500m
service:
http:
port: 8123
ingressRoute:
enabled: true
host: homeassistant.alexlebens.net
authentik:
outpost: authentik-proxy-outpost
port: 9000
metrics:
enabled: false
serviceMonitor:
interval: 1m
scrapeTimeout: 30s
## See https://www.home-assistant.io/docs/authentication/ for where to find
## long lived access token creation under your account profile, which is
## needed to monitor Home Assistant
bearerTokenSecret:
name: ""
key: ""
prometheusRule:
enabled: false
rules:
- alert: HomeAssistantAbsent
annotations:
description: Home Assistant has disappeared from Prometheus service discovery.
summary: Home Assistant is down.
expr: |
absent(up{job=~".*home-assistant.*"} == 1)
for: 5m
labels:
severity: critical
persistence:
config:
storageClassName: ceph-block
storageSize: 1Gi
volumeMode: Filesystem
codeserver:
enabled: true
image:
repository: linuxserver/code-server
tag: 4.21.1
imagePullPolicy: IfNotPresent
env:
TZ: US/Mountain
PUID: 1000
PGID: 1000
DEFAULT_WORKSPACE: /config
envFrom:
securityContext:
runAsUser: 0
service:
http:
port: 8443
ingressRoute:
enabled: true
host: codeserver.homeassistant.alexlebens.net

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: homepage
version: 0.0.2
version: 0.0.4
description: Chart for benphelps homepage
keywords:
- dashboard
@@ -9,4 +9,4 @@ sources:
maintainers:
- name: alexlebens
icon: https://github.com/benphelps/homepage/blob/de584eae8f12a0d257e554e9511ef19bd2a1232c/public/mstile-150x150.png
appVersion: 0.8.7
appVersion: v0.8.7

View File

@@ -2,17 +2,17 @@ deployment:
replicas: 1
strategy: Recreate
image:
repository: ghcr.io/benphelps/homepage
repository: ghcr.io/gethomepage/homepage
tag: v0.8.7
imagePullPolicy: IfNotPresent
env:
envFrom:
resources:
requests:
memory: 50Mi
cpu: 10m
memory: 256Mi
cpu: 50m
limits:
memory: 200Mi
memory: 512Mi
cpu: 500m
service:
http:

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: postgres-cluster
version: 0.0.1
version: 0.0.4
description: Chart for cloudnative-pg cluster
keywords:
- database

View File

@@ -11,6 +11,7 @@ metadata:
app.kubernetes.io/part-of: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
imageName: {{ .Values.cluster.imageName }}
instances: {{ .Values.cluster.instances }}
replicationSlots:
highAvailability:
@@ -66,7 +67,7 @@ spec:
barmanObjectStore:
destinationPath: "s3://{{ .Values.backup.bucket }}/{{ .Values.cluster.name }}/postgresql/{{ .Release.Name }}-cluster"
endpointURL: {{ .Values.backup.endpointURL }}
serverName: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.postgresql.backup.backupIndex }}"
serverName: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.backup.backupIndex }}"
s3Credentials:
accessKeyId:
name: "postgresql-{{ .Release.Name }}-cluster-backup-secret"

View File

@@ -1,5 +1,6 @@
cluster:
name: cl01tl
imageName: ghcr.io/cloudnative-pg/postgresql:16.0
instances: 2
parameters:
shared_buffers: 128MB
@@ -7,7 +8,7 @@ cluster:
hot_standby_feedback: "on"
resources:
requests:
memory: 128Mi
memory: 512Mi
cpu: 100m
limits:
memory: 2Gi
@@ -20,7 +21,7 @@ cluster:
wal:
storageClass: ceph-block
size: 2Gi
boostrap:
bootstrap:
initdbEnabled: false
initdb:
database: app