apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: servala
  name: servala
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: servala
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: servala
    spec:
      containers:
        - name: servala
          image: servala-2nkgm.app.codey.ch/servala/servala-portal:latest
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          envFrom:
            - secretRef:
                name: servala
          env:
            - name: SERVALA_DB_USER
              valueFrom:
                secretKeyRef:
                  name: database-creds
                  key: POSTGRESQL_USER
            - name: SERVALA_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: database-creds
                  key: POSTGRESQL_PASSWORD
            - name: SERVALA_DB_HOST
              valueFrom:
                secretKeyRef:
                  name: database-creds
                  key: POSTGRESQL_HOST
            - name: SERVALA_DB_PORT
              valueFrom:
                secretKeyRef:
                  name: database-creds
                  key: POSTGRESQL_PORT
            - name: SERVALA_DB_NAME
              valueFrom:
                secretKeyRef:
                  name: database-creds
                  key: POSTGRESQL_DB
            - name: UV_CACHE_DIR
              value: /app/.uvcache
