hass
This commit is contained in:
parent
d5933d6be0
commit
54b5e8d6f9
37
hass/elect/deployment.yaml
Normal file
37
hass/elect/deployment.yaml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: sgcc-electricity
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sgcc-electricity
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: sgcc-electricity
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: envfile
|
||||||
|
configMap:
|
||||||
|
name: sgcc-electricity
|
||||||
|
items:
|
||||||
|
- key: .env
|
||||||
|
path: .env
|
||||||
|
containers:
|
||||||
|
- name: sgcc-electricity
|
||||||
|
image: dockerproxy.com/dscao/sgcc_electricity
|
||||||
|
imagePullPolicy: Always
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "16Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
env:
|
||||||
|
- name: HASS_URL
|
||||||
|
value: http://home-assistant:8124
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: sgcc-electricity
|
||||||
|
command:
|
||||||
|
- ""
|
||||||
|
|
13
hass/elect/kustomization.yaml
Normal file
13
hass/elect/kustomization.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: hass
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
secretGenerator:
|
||||||
|
- name: sgcc-electricity
|
||||||
|
files:
|
||||||
|
- config/HASS_TOKEN
|
||||||
|
- config/PASSWORD
|
||||||
|
- config/PHONE_NUMBER
|
41
hass/home-assistant/deployment.yaml
Normal file
41
hass/home-assistant/deployment.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: home-assistant
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: home-assistant
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: home-assistant
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
hostPath:
|
||||||
|
path: /data/home-assistant/data
|
||||||
|
- name: media
|
||||||
|
hostPath:
|
||||||
|
path: /data/home-assistant/media
|
||||||
|
containers:
|
||||||
|
- name: home-assistant
|
||||||
|
image: home-assistant
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "2Gi"
|
||||||
|
cpu: "2"
|
||||||
|
requests:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "128Mi"
|
||||||
|
ports:
|
||||||
|
- containerPort: 8123
|
||||||
|
name: web
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /config
|
||||||
|
name: data
|
||||||
|
- mountPath: /media
|
||||||
|
name: media
|
18
hass/home-assistant/ingress.yaml
Normal file
18
hass/home-assistant/ingress.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: home-assistant
|
||||||
|
labels:
|
||||||
|
name: home-assistant
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: ha.sense-t.eu.org
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- pathType: Prefix
|
||||||
|
path: "/"
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: home-assistant
|
||||||
|
port:
|
||||||
|
number: 8124
|
8
hass/home-assistant/kustomization.yaml
Normal file
8
hass/home-assistant/kustomization.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- ingress.yaml
|
||||||
|
- service.yaml
|
15
hass/home-assistant/service.yaml
Normal file
15
hass/home-assistant/service.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: home-assistant
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
|
selector:
|
||||||
|
app: home-assistant
|
||||||
|
ports:
|
||||||
|
- port: 8124
|
||||||
|
targetPort: web
|
||||||
|
ipFamilyPolicy: PreferDualStack
|
||||||
|
ipFamilies:
|
||||||
|
- IPv4
|
||||||
|
- IPv6
|
21
hass/kustomization.yaml
Normal file
21
hass/kustomization.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: hass
|
||||||
|
resources:
|
||||||
|
- home-assistant
|
||||||
|
- mqtt
|
||||||
|
configMapGenerator:
|
||||||
|
- name: mosquitto
|
||||||
|
files:
|
||||||
|
- config/mosquitto.conf
|
||||||
|
images:
|
||||||
|
- name: home-assistant
|
||||||
|
newName: m.daocloud.io/ghcr.io/home-assistant/home-assistant
|
||||||
|
newTag: 2023.8.4
|
||||||
|
- name: mosquitto
|
||||||
|
newName: eclipse-mosquitto
|
||||||
|
newTag: 2.0.17
|
||||||
|
- name: influxdb
|
||||||
|
newTag: 2.7.1-alpine
|
35
hass/mqtt/deployment.yaml
Normal file
35
hass/mqtt/deployment.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mosquitto
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mosquitto
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mosquitto
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: mosquitto
|
||||||
|
- name: data
|
||||||
|
hostPath:
|
||||||
|
path: /data/home-assistant/mqtt
|
||||||
|
containers:
|
||||||
|
- name: mosquitto
|
||||||
|
image: mosquitto
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
ports:
|
||||||
|
- containerPort: 1883
|
||||||
|
name: mqtt
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data
|
||||||
|
name: data
|
||||||
|
- mountPath: /mosquitto/config
|
||||||
|
name: config
|
7
hass/mqtt/kustomization.yaml
Normal file
7
hass/mqtt/kustomization.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
16
hass/mqtt/service.yaml
Normal file
16
hass/mqtt/service.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mosquitto
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: mosquitto
|
||||||
|
ports:
|
||||||
|
- port: 1883
|
||||||
|
targetPort: mqtt
|
||||||
|
name: mqtt
|
||||||
|
type: LoadBalancer
|
||||||
|
ipFamilyPolicy: PreferDualStack
|
||||||
|
ipFamilies:
|
||||||
|
- IPv4
|
||||||
|
- IPv6
|
Loading…
Reference in New Issue
Block a user