78 lines
1.6 KiB
YAML
78 lines
1.6 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: homeassistant
|
|
labels:
|
|
app: homeassistant
|
|
spec:
|
|
selector:
|
|
app: homeassistant
|
|
type: ClusterIP
|
|
clusterIP: None
|
|
ports:
|
|
- name: http-port
|
|
port: 8123
|
|
targetPort: 8123
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: homeassistant-proxy
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: homeassistant
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: homeassistant
|
|
spec:
|
|
containers:
|
|
- name: nginx
|
|
image: nginx
|
|
ports:
|
|
- name: http-port
|
|
containerPort: 8123
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /etc/nginx/nginx.conf
|
|
subPath: nginx.conf
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: homeassistant-proxy-nginx-conf
|
|
items:
|
|
- key: nginx.conf
|
|
path: nginx.conf
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: homeassistant-proxy-nginx-conf
|
|
namespace: default
|
|
data:
|
|
nginx.conf: |
|
|
worker_processes auto;
|
|
events {
|
|
worker_connections 2048;
|
|
}
|
|
http {
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
server {
|
|
error_log stdout;
|
|
access_log stdout;
|
|
|
|
listen 8123;
|
|
listen [::]:8123;
|
|
proxy_buffering off;
|
|
location / {
|
|
proxy_pass http://172.30.32.1:8123;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
}
|
|
}
|
|
}
|