kubernetes cluster - working version

This commit is contained in:
2022-06-20 23:24:17 +02:00
parent 86cd07c4b6
commit fb2895f79d
14 changed files with 99 additions and 20 deletions

View File

@@ -0,0 +1,21 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: homeassistant-pv
spec:
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: local-storage
local:
path: {{ .Values.homeassistant.config_folder }}
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .Values.general.hostname }}

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: homeassistant-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-storage
resources:
requests:
storage: 1Gi

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: homeassistant
spec:
type: NodePort
ports:
- port: 8123
name: portal
targetPort: 8123
nodePort: {{ .Values.homeassistant.portal_nodePort }}
protocol: TCP
selector:
app: homeassistant

View File

@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: homeassistant
spec:
serviceName: homeassistant
selector:
matchLabels:
app: homeassistant
replicas: 1
template:
metadata:
labels:
app: homeassistant
spec:
containers:
- name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 8123
volumeMounts:
- name: homeassistant-config
mountPath: /config
volumes:
- name: homeassistant-config
persistentVolumeClaim:
claimName: homeassistant-pvc