1
0
Fork 0
home-stack-kustomize/kustomize/bases/home-assistant/home-assistant-deployment.yaml

97 lines
2.4 KiB
YAML
Raw Normal View History

2023-06-10 05:41:37 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: server
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: server
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: server
template:
metadata:
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: server
spec:
affinity:
nodeAffinity:
# TODO: eviction policy
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
# need a zigbee receiver
- key: badjnet.home/zigbee-receiver
operator: Exists
initContainers:
- image: busybox:1.36.1
name: cp-config
command: ["cp", "/server-config/configuration.yaml", "/config"]
volumeMounts:
- name: home-assistant-pv
mountPath: /config
- name: server-config
mountPath: /server-config
readOnly: true
containers:
2023-06-10 22:15:39 +00:00
- image: homeassistant/home-assistant
2023-06-10 05:41:37 +00:00
name: home-assistant
securityContext:
privileged: true
ports:
- name: http
containerPort: 8123
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 250m
memory: 500Mi
volumeMounts:
- name: home-assistant-pv
mountPath: /config
- name: zigbee-receiver
mountPath: /dev/ttyUSB0
volumes:
- name: zigbee-receiver
hostPath:
path: /dev/ttyUSB0
- name: home-assistant-pv
persistentVolumeClaim:
claimName: server-pvc
- name: server-config
configMap:
name: server-config
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: server-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
name: server
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: server
spec:
selector:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: server
ports:
- name: http
port: 80
targetPort: http