Skip to content

Commit

Permalink
Trying to add home assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryGF committed Aug 15, 2023
1 parent bd85b06 commit 564cab6
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 0 deletions.
7 changes: 7 additions & 0 deletions argocd/home-assistant/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: home-assistant-umbrella
version: 0.0.1
dependencies:
- name: home-assistant
repository: https://geek-cookbook.github.io/charts
version: 13.5.0
19 changes: 19 additions & 0 deletions argocd/home-assistant/files/configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes

# Text to speech
tts:
- platform: google_translate

# automation: !include automations.yaml
# script: !include scripts.yaml
# scene: !include scenes.yaml

http:
use_x_forwarded_for: true
trusted_proxies: 0.0.0.0/0
7 changes: 7 additions & 0 deletions argocd/home-assistant/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
datafile.yaml: |
{{ .Files.Get "files/configuration.yaml" | indent 4 }}
25 changes: 25 additions & 0 deletions argocd/home-assistant/templates/install-plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: batch/v1
kind: Job
metadata:
name: install-ha-plugins
spec:
template:
metadata:
name: install-ha-plugins
spec:
volumes:
- name: ha-config
persistentVolumeClaim:
claimName: ha-config
containers:
- name: install-ha-plugins
image: bash
command:
- bash
- "-c"
- "cd /config && wget -O - https://get.hacs.xyz | bash -"
volumeMounts:
- name: ha-config
mountPath: "/config"
restartPolicy: Never
backoffLimit: 1
108 changes: 108 additions & 0 deletions argocd/home-assistant/values.common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
home-assistant:
# home-assistant.yaml
image:
repository: lscr.io/linuxserver/homeassistant
tag: 2023.4.4

initContainers:
copy-configmap:
image: busybox
command:
- "sh"
- "-c"
- |
cp /ha-config/configuration.yaml /config/configuration.yaml
volumeMounts:
- name: config
mountPath: /config
- name: config-custom
mountPath: /ha-config

securityContext:
runAsUser: 0

# install-hasc:
# image: bash
# command:
# - "bash"
# - "-c"
# - |
# cd /config && ls && wget -O - https://get.hacs.xyz | bash -
# volumeMounts:
# - name: config
# mountPath: /config

# securityContext:
# runAsUser: 0

ingress:
main:
ingressClassName: traefik
annotations:
cert-manager.io/cluster-issuer: letsencrypt
traefik.ingress.kubernetes.io/router.entrypoints: websecure
enabled: true
hosts:
- host: "ha.${duckdns_domain}.duckdns.org"
paths:
- path: /
tls:
- hosts:
- "ha.${duckdns_domain}.duckdns.org"
secretName: tls-ha-ingress

hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet

persistence:
config:
enabled: true
existingClaim: ha-config
config-custom:
enabled: true
type: configMap
name: config-file
# usb:
# enabled: true
# type: hostPath
# hostPath: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2434151-if00
# mountPath: /dev/ttyUSB0

nodeSelector:
# kubernetes.io/hostname: ${master_hostname}
kubernetes.io/arch : amd64


securityContext:
privileged: true

addons:
codeserver:
image:
repository: codercom/code-server
tag: 4.11.0
enabled: true
ingress:
enabled: true
annotations:
cert-manager.io/issuer: letsencrypt
hosts:
- host: code.ha.${duckdns_domain}.duckdns.org
paths:
- path: /
tls:
- secretName: tls-code-ha-ingress
hosts:
- code.ha.${duckdns_domain}.duckdns.org

args:
- --auth
- none
- --user-data-dir
- "/config/.vscode"

workingDir: "/config"

volumeMounts:
- name: config
mountPath: /config
18 changes: 18 additions & 0 deletions terraform/applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,24 @@ renovate:
gh_username: ${gh_username}
gh_token: ${gh_token}


home-assistant:
name: home-assistant
namespace: services
deploy: true
volumes:
config:
enabled: true
name: ha-config
size: 5Gi
access_modes:
- ReadWriteOnce
override:
timezone: ${timezone}
duckdns_domain: ${duckdns_domain}
gh_username: ${gh_username}
gh_token: ${gh_token}

sonarr:
name: sonarr
namespace: services
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
grafana:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-prometheus:9090
access: proxy
isDefault: true
- name: Alertmanager
type: alertmanager
url: http://prometheus-alertmanager:9093
access: proxy
jsonData:
implementation: prometheus
handleGrafanaManagedAlerts: false
- name: Loki
type: loki
access: proxy
url: http://loki-gateway
jsonData:
maxLines: 1000

grafana.ini:
auth.anonymous:
enabled: true
org_name: Main Org.
org_role: Admin
panels:
disable_sanitize_html: true

persistence:
enabled: true
existingClaim: grafana-config

0 comments on commit 564cab6

Please sign in to comment.