added deployment
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# esphome on kubernetes
|
||||
|
||||
## Installation
|
||||
Just deploy files in order:
|
||||
- namespace.yaml
|
||||
- pvc.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
name: esphome
|
||||
namespace: esphome
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: esphome
|
||||
app.kubernetes.io/name: esphome
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: esphome
|
||||
app.kubernetes.io/name: esphome
|
||||
spec:
|
||||
containers:
|
||||
- name: esphome-esphome-release
|
||||
env:
|
||||
- name: TZ
|
||||
value: Europe/Berlin
|
||||
- name: USERNAME
|
||||
value: admin
|
||||
- name: PASSWORD
|
||||
value: '#gentoo#'
|
||||
image: esphome/esphome:stable
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: 6052
|
||||
timeoutSeconds: 1
|
||||
ports:
|
||||
- containerPort: 6052
|
||||
name: http
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: 6052
|
||||
timeoutSeconds: 1
|
||||
resources: {}
|
||||
startupProbe:
|
||||
failureThreshold: 30
|
||||
periodSeconds: 5
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: 6052
|
||||
timeoutSeconds: 1
|
||||
volumeMounts:
|
||||
- mountPath: /config
|
||||
name: config-volume
|
||||
- mountPath: /cache
|
||||
name: cache-volume
|
||||
dnsPolicy: "None"
|
||||
dnsConfig:
|
||||
nameservers:
|
||||
- 192.168.0.5 # YOUR DNS SERVER
|
||||
searches:
|
||||
- realm.local # YOUR DOMAIN NAME
|
||||
volumes:
|
||||
- name: config-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: pvc-nfs-esphome
|
||||
- name: cache-volume
|
||||
emptyDir:
|
||||
sizeLimit: 5Gi
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: esphome
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pvc-nfs-esphome
|
||||
namespace: esphome
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Mi
|
||||
storageClassName: nfs-csi
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: esphome
|
||||
namespace: esphome
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 6052
|
||||
selector:
|
||||
app.kubernetes.io/instance: esphome
|
||||
app.kubernetes.io/name: esphome
|
||||
sessionAffinity: None
|
||||
type: LoadBalancer
|
||||
Reference in New Issue
Block a user