netflux-kubernetes/deploy/base/deploy-invidious.yaml

116 lines
3.2 KiB
YAML
Raw Normal View History

2022-05-11 09:18:49 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: invidious
labels:
app.kubernetes.io/name: invidious
app.kubernetes.io/instance: invidious
spec:
selector:
matchLabels:
app.kubernetes.io/name: invidious
app.kubernetes.io/instance: invidious
template:
metadata:
labels:
app.kubernetes.io/name: invidious
app.kubernetes.io/instance: invidious
spec:
initContainers:
- image: alpine/git:latest
imagePullPolicy: IfNotPresent
name: init-invidious-repo
volumeMounts:
- mountPath: /data
name: data
command: ["git", "clone", "--depth", "1", "https://github.com/iv-org/invidious.git", "/data/repo"]
2022-05-11 09:18:49 +00:00
- image: jbergknoff/postgresql-client:latest
imagePullPolicy: IfNotPresent
name: init-invidious-db
volumeMounts:
- mountPath: /data
name: data
2022-05-11 09:18:49 +00:00
env:
- name: PGHOST
valueFrom:
secretKeyRef:
name: invidious-credentials
key: database-host
optional: false
- name: PGPORT
valueFrom:
secretKeyRef:
name: invidious-credentials
key: database-port
optional: false
# See init-invidious-db.sh:
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: invidious-credentials
key: database-name
optional: false
# See init-invidious-db.sh:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: invidious-credentials
key: database-user
optional: false
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: invidious-credentials
key: database-password
optional: false
workingDir: /data/repo
command: ["sh", "docker/init-invidious-db.sh"]
2022-05-11 09:18:49 +00:00
containers:
- image: quay.io/invidious/invidious:latest
imagePullPolicy: IfNotPresent
name: invidious
ports:
- name: http
protocol: TCP
containerPort: 3000
env:
- name: INVIDIOUS_CONFIG_FILE
value: /invidious/config/config.yml
- name: INVIDIOUS_DATABASE_URL
valueFrom:
secretKeyRef:
name: invidious-credentials
key: database-url
optional: false
volumeMounts:
- mountPath: /invidious/config/config.yml
subPath: config.yml
name: config
2022-05-11 18:21:14 +00:00
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"
lifecycle:
preStop:
exec:
command: ["kill", "-INT", "1"]
2022-05-11 09:18:49 +00:00
livenessProbe:
failureThreshold: 10
httpGet:
path: /api/v1/comments/jNQXAC9IVRw
port: 3000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
volumes:
- name: data
2022-05-11 09:18:49 +00:00
emptyDir: {}
- name: config
configMap:
name: invidious-config