74 lines
2.2 KiB
YAML
74 lines
2.2 KiB
YAML
# services/mailu/mailu-sync-job.yaml
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: mailu-sync
|
|
namespace: mailu-mailserver
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: mailu-sync
|
|
image: python:3.11-alpine
|
|
imagePullPolicy: IfNotPresent
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
pip install --no-cache-dir requests psycopg2-binary passlib >/tmp/pip.log \
|
|
&& python /app/sync.py
|
|
env:
|
|
- name: KEYCLOAK_BASE_URL
|
|
value: http://keycloak.sso.svc.cluster.local
|
|
- name: KEYCLOAK_REALM
|
|
value: atlas
|
|
- name: MAILU_DOMAIN
|
|
value: bstein.dev
|
|
- name: MAILU_DEFAULT_QUOTA
|
|
value: "20000000000"
|
|
- name: MAILU_DB_HOST
|
|
value: postgres-service.postgres.svc.cluster.local
|
|
- name: MAILU_DB_PORT
|
|
value: "5432"
|
|
- name: MAILU_DB_NAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mailu-db-secret
|
|
key: database
|
|
- name: MAILU_DB_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mailu-db-secret
|
|
key: username
|
|
- name: MAILU_DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mailu-db-secret
|
|
key: password
|
|
- name: KEYCLOAK_CLIENT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mailu-sync-credentials
|
|
key: client-id
|
|
- name: KEYCLOAK_CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mailu-sync-credentials
|
|
key: client-secret
|
|
volumeMounts:
|
|
- name: sync-script
|
|
mountPath: /app/sync.py
|
|
subPath: sync.py
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
volumes:
|
|
- name: sync-script
|
|
configMap:
|
|
name: mailu-sync-script
|
|
defaultMode: 0444
|