Repository navigation
Expand file tree
/
Copy pathkubernetes.yaml
More file actions
93 lines (93 loc) · 2.29 KB
/
Copy pathkubernetes.yaml
File metadata and controls
93 lines (93 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Example Kubernetes manifests. Replace secret values before apply.
# Image is public on GHCR after package visibility is set — no imagePullSecrets needed.
---
apiVersion: v1
kind: Namespace
metadata:
name: teslamate
---
apiVersion: v1
kind: Secret
metadata:
name: teslamate-frontend-secrets
namespace: teslamate
type: Opaque
stringData:
# Prefer a read-only Postgres role (see README).
DATABASE_URL: "postgres://teslamate_ro:CHANGE_ME@teslamate-db:5432/teslamate"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: teslamate-frontend
namespace: teslamate
spec:
replicas: 1
selector:
matchLabels:
app: teslamate-frontend
template:
metadata:
labels:
app: teslamate-frontend
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: teslamate-frontend
# Pin release or sha tag from GHCR (immutable).
image: ghcr.io/jmcglock/a-better-teslamate-frontend:1.1.4
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3000
env:
- name: HOSTNAME
value: "0.0.0.0"
- name: PORT
value: "3000"
- name: MQTT_URL
value: "mqtt://mosquitto:1883"
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: teslamate-frontend-secrets
key: DATABASE_URL
livenessProbe:
httpGet:
path: /api/health
port: http
initialDelaySeconds: 15
periodSeconds: 30
readinessProbe:
httpGet:
path: /api/health
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 50m
memory: 256Mi
limits:
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
---
apiVersion: v1
kind: Service
metadata:
name: teslamate-frontend
namespace: teslamate
spec:
selector:
app: teslamate-frontend
ports:
- name: http
port: 3000
targetPort: http