295 lines
8.2 KiB
YAML
295 lines
8.2 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: sastrafilm-server
|
|
namespace: default
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: sastrafilm-server
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: sastrafilm-server
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: sastrafilm-image-registry
|
|
|
|
volumes:
|
|
- name: maxmind-database
|
|
persistentVolumeClaim:
|
|
claimName: maxmind-database
|
|
- name: credentials
|
|
secret:
|
|
secretName: sastrafilm-server
|
|
defaultMode: 420
|
|
items:
|
|
- key: TRUEMONEY_PRIVATE_KEY_DATA
|
|
path: truemoney-private-key
|
|
- key: GOOGLE_PAY_SERVICE_ACCOUNT_FILE_DATA
|
|
path: google-pay-sa.json
|
|
- key: PLASGATE_CA_CERT_PEM
|
|
path: plasgate-ca.cert.pem
|
|
- key: PLASGATE_CLIENT_CERT_PEM
|
|
path: plasgate.cert.pem
|
|
- key: PLASGATE_CLIENT_KEY_PEM
|
|
path: plasgate.key.pem
|
|
|
|
containers:
|
|
- name: sastrafilm-server
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
resources:
|
|
limits:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
requests:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
|
|
envFrom:
|
|
- configMapRef:
|
|
name: sastrafilm-server
|
|
- secretRef:
|
|
name: sastrafilm-server
|
|
|
|
volumeMounts:
|
|
- mountPath: /maxmind-geoip-database
|
|
name: maxmind-database
|
|
- mountPath: /etc/sastrafilm
|
|
name: credentials
|
|
readOnly: true
|
|
|
|
env:
|
|
- name: REDIS_HOST
|
|
value: sastrafilm-redis.default.svc.cluster.local
|
|
- name: REDIS_PORT
|
|
value: "6379"
|
|
- name: DATABASE_REPL_MASTER_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: sastrafilm-postgres
|
|
- name: DATABASE_REPL_REPLICA_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: sastrafilm-postgres
|
|
- name: DATABASE_REPL_MASTER_HOST
|
|
value: sastrafilm-postgres-rw.default.svc.cluster.local
|
|
- name: DATABASE_REPL_MASTER_PORT
|
|
value: "5432"
|
|
- name: DATABASE_REPL_MASTER_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: sastrafilm-postgres
|
|
- name: DATABASE_REPL_REPLICA_HOST
|
|
value: sastrafilm-postgres-ro.default.svc.cluster.local
|
|
- name: DATABASE_REPL_REPLICA_PORT
|
|
value: "5432"
|
|
- name: DATABASE_REPL_REPLICA_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: sastrafilm-postgres
|
|
- name: AMQP_HOST
|
|
value: sastrafilm-amqp.default.svc.cluster.local
|
|
- name: AMQP_PORT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: port
|
|
name: sastrafilm-amqp-default-user
|
|
- name: AMQP_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: sastrafilm-amqp-default-user
|
|
- name: AMQP_PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: sastrafilm-amqp-default-user
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: sastrafilm-worker
|
|
namespace: default
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: sastrafilm-worker
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: sastrafilm-worker
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: sastrafilm-image-registry
|
|
|
|
volumes:
|
|
- name: maxmind-database
|
|
persistentVolumeClaim:
|
|
claimName: maxmind-database
|
|
- name: credentials
|
|
secret:
|
|
secretName: sastrafilm-server
|
|
defaultMode: 420
|
|
items:
|
|
- key: TRUEMONEY_PRIVATE_KEY_DATA
|
|
path: truemoney-private-key
|
|
- key: GOOGLE_PAY_SERVICE_ACCOUNT_FILE_DATA
|
|
path: google-pay-sa.json
|
|
- key: PLASGATE_CA_CERT_PEM
|
|
path: plasgate-ca.cert.pem
|
|
- key: PLASGATE_CLIENT_CERT_PEM
|
|
path: plasgate.cert.pem
|
|
- key: PLASGATE_CLIENT_KEY_PEM
|
|
path: plasgate.key.pem
|
|
|
|
containers:
|
|
- name: sastrafilm-amqp-worker
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- yarn
|
|
- start:amqp-worker
|
|
|
|
resources: &sastrafilm-worker-resource
|
|
limits:
|
|
cpu: 400m
|
|
memory: 512Mi
|
|
requests:
|
|
cpu: 64m
|
|
memory: 128Mi
|
|
|
|
envFrom: &sastrafilm-env-from
|
|
- configMapRef:
|
|
name: sastrafilm-server
|
|
- secretRef:
|
|
name: sastrafilm-server
|
|
|
|
volumeMounts: &sastrafilm-worker-volume-mounts
|
|
- mountPath: /maxmind-geoip-database
|
|
name: maxmind-database
|
|
- mountPath: /etc/sastrafilm
|
|
name: credentials
|
|
readOnly: true
|
|
|
|
env: &sastrafilm-env
|
|
- name: REDIS_HOST
|
|
value: sastrafilm-redis.default.svc.cluster.local
|
|
- name: REDIS_PORT
|
|
value: "6379"
|
|
- name: DATABASE_REPL_MASTER_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: sastrafilm-postgres
|
|
- name: DATABASE_REPL_REPLICA_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: sastrafilm-postgres
|
|
- name: DATABASE_REPL_MASTER_HOST
|
|
value: sastrafilm-postgres-rw.default.svc.cluster.local
|
|
- name: DATABASE_REPL_MASTER_PORT
|
|
value: "5432"
|
|
- name: DATABASE_REPL_MASTER_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: sastrafilm-postgres
|
|
- name: DATABASE_REPL_REPLICA_HOST
|
|
value: sastrafilm-postgres-ro.default.svc.cluster.local
|
|
- name: DATABASE_REPL_REPLICA_PORT
|
|
value: "5432"
|
|
- name: DATABASE_REPL_REPLICA_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: sastrafilm-postgres
|
|
- name: AMQP_HOST
|
|
value: sastrafilm-amqp.default.svc.cluster.local
|
|
- name: AMQP_PORT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: port
|
|
name: sastrafilm-amqp-default-user
|
|
- name: AMQP_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: sastrafilm-amqp-default-user
|
|
- name: AMQP_PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: sastrafilm-amqp-default-user
|
|
|
|
- name: sastrafilm-materialized-refresher
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- yarn
|
|
- start:materialized-refresher
|
|
|
|
env: *sastrafilm-env
|
|
envFrom: *sastrafilm-env-from
|
|
resources: *sastrafilm-worker-resource
|
|
volumeMounts: *sastrafilm-worker-volume-mounts
|
|
|
|
- name: sastrafilm-maxmind-geoip-data-updater
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- yarn
|
|
- start:maxmind-geoip-data-updater
|
|
|
|
env: *sastrafilm-env
|
|
envFrom: *sastrafilm-env-from
|
|
resources: *sastrafilm-worker-resource
|
|
volumeMounts: *sastrafilm-worker-volume-mounts
|
|
|
|
- name: sastrafilm-cron-worker
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- yarn
|
|
- start:cron-worker
|
|
|
|
env: *sastrafilm-env
|
|
envFrom: *sastrafilm-env-from
|
|
resources: *sastrafilm-worker-resource
|
|
volumeMounts: *sastrafilm-worker-volume-mounts
|
|
|
|
- name: sastrafilm-telebot
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- yarn
|
|
- start:telebot
|
|
|
|
env: *sastrafilm-env
|
|
envFrom: *sastrafilm-env-from
|
|
resources: *sastrafilm-worker-resource
|
|
volumeMounts: *sastrafilm-worker-volume-mounts
|
|
|
|
- name: sastrafilm-user-subscription-worker
|
|
image: sastrafilm-server
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- yarn
|
|
- start:user-subscription-worker
|
|
|
|
env: *sastrafilm-env
|
|
envFrom: *sastrafilm-env-from
|
|
resources: *sastrafilm-worker-resource
|
|
volumeMounts: *sastrafilm-worker-volume-mounts
|