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

155 lines
4.2 KiB
YAML
Raw Normal View History

2022-05-11 09:18:49 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: invidious
labels:
2022-06-05 15:44:52 +00:00
app: invidious
component: web
2022-05-11 09:18:49 +00:00
app.kubernetes.io/name: invidious
app.kubernetes.io/instance: invidious
spec:
selector:
matchLabels:
2022-06-05 15:44:52 +00:00
app: invidious
component: web
2022-05-11 09:18:49 +00:00
template:
metadata:
labels:
2022-06-05 15:44:52 +00:00
app: invidious
component: web
2022-05-11 09:18:49 +00:00
app.kubernetes.io/name: invidious
app.kubernetes.io/instance: invidious
spec:
2023-09-10 22:18:13 +00:00
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
2022-05-11 09:18:49 +00:00
initContainers:
2023-09-10 18:14:22 +00:00
- image: alpine/git:2.40.1
2022-05-11 09:18:49 +00:00
imagePullPolicy: IfNotPresent
name: init-invidious-repo
volumeMounts:
- mountPath: /data
name: data
2023-01-12 06:05:10 +00:00
- mountPath: /scripts
name: scripts
command: ["/bin/sh", "/scripts/init.sh"]
2023-09-10 18:44:15 +00:00
resources:
requests:
memory: 64Mi
cpu: 100m
limits:
memory: 128Mi
cpu: 500m
securityContext:
readOnlyRootFilesystem: true
2023-09-10 18:14:22 +00:00
- image: jbergknoff/postgresql-client@sha256:45e175ebb700cfd46e23a610477c3576550055ef40c394e663623946a5eced39
2022-05-11 09:18:49 +00:00
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
2023-09-10 18:44:15 +00:00
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 256Mi
cpu: 1000m
securityContext:
readOnlyRootFilesystem: true
workingDir: /data/repo
command: ["sh", "docker/init-invidious-db.sh"]
2022-05-11 09:18:49 +00:00
containers:
2023-09-10 18:14:22 +00:00
- image: quay.io/invidious/invidious:ac0c0609bb8b652e630c3603cd9dbb1c87fbdf44
2022-06-27 16:49:41 +00:00
imagePullPolicy: Always
2022-05-11 09:18:49 +00:00
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
- name: INVIDIOUS_HMAC_KEY
valueFrom:
secretKeyRef:
name: invidious-credentials
key: hmac-key
optional: false
2022-05-11 09:18:49 +00:00
volumeMounts:
- mountPath: /invidious/config/config.yml
subPath: config.yml
name: config
2022-05-11 18:21:14 +00:00
resources:
requests:
2023-09-10 18:44:15 +00:00
memory: 128Mi
cpu: 100m
2022-05-11 18:21:14 +00:00
limits:
2023-09-10 18:44:15 +00:00
memory: 256Mi
cpu: 1000m
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
securityContext:
readOnlyRootFilesystem: true
2022-05-11 09:18:49 +00:00
volumes:
- name: data
2022-05-11 09:18:49 +00:00
emptyDir: {}
- name: config
configMap:
name: invidious-config
2023-01-12 06:05:10 +00:00
- name: scripts
configMap:
name: invidious-scripts