apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: chorro
    component: server
  name: chorro-server-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: chorro
      component: server
  template:
    metadata:
      labels:
        app: chorro
        component: server
    spec:
      containers:
        - env:
            - name: GOOGLE_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  key: googleClientId
                  name: chorro-secret
            - name: GOOGLE_SECRET
              valueFrom:
                secretKeyRef:
                  key: googleSecret
                  name: chorro-secret
            - name: POSTGRES_DATABASE_NAME
              valueFrom:
                secretKeyRef:
                  key: postgresDatabaseName
                  name: chorro-secret
            - name: POSTGRES_HOST
              valueFrom:
                secretKeyRef:
                  key: postgresHost
                  name: chorro-secret
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: postgresPassword
                  name: chorro-secret
            - name: POSTGRES_PORT
              valueFrom:
                secretKeyRef:
                  key: postgresPort
                  name: chorro-secret
            - name: POSTGRES_USER
              valueFrom:
                secretKeyRef:
                  key: postgresUser
                  name: chorro-secret
            - name: REDIS_HOST
              valueFrom:
                secretKeyRef:
                  key: redisHost
                  name: chorro-secret
            - name: REDIS_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: redisPassword
                  name: chorro-secret
            - name: REDIS_PORT
              valueFrom:
                secretKeyRef:
                  key: redisPort
                  name: chorro-secret
            - name: SMTP_HOST
              valueFrom:
                secretKeyRef:
                  key: smtpHost
                  name: chorro-secret
            - name: SMTP_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: smtpPassword
                  name: chorro-secret
            - name: SMTP_PORT
              valueFrom:
                secretKeyRef:
                  key: smtpPort
                  name: chorro-secret
            - name: SMTP_USER
              valueFrom:
                secretKeyRef:
                  key: smtpUser
                  name: chorro-secret
            - name: SMTP_USER_NAME
              valueFrom:
                secretKeyRef:
                  key: smtpUserName
                  name: chorro-secret
          image: ghcr.io/skeswa/chorro-server:0.4.1
          name: chorro-server
          ports:
            - containerPort: 8000
          resources:
            limits:
              cpu: 500m
              memory: 128Mi
            requests:
              cpu: 100m
              memory: 64Mi
