apiVersion: apps/v1
kind: Deployment
metadata:
  name: unleash-deployment
  labels:
    app: unleash
spec:
  replicas: 1
  selector:
    matchLabels:
      app: unleash
  template:
    metadata:
      labels:
        app: unleash
    spec:
      containers:
        - name: achievements-unleash
          image: unleashorg/unleash-server:latest
          resources:
            requests:
              cpu: '25m'
              memory: '64Mi'
            limits:
              cpu: '100m'
              memory: '256Mi'
          envFrom:
            - secretRef:
                name: provisioned-secrets
            - configMapRef:
                name: provisioned-config
          env:
            - name: DATABASE_HOST
              value: '$(DB_UNLEASH_PRIVATE_HOST)'
            - name: DATABASE_PORT
              value: '$(DB_UNLEASH_PORT)'
            - name: DATABASE_NAME
              value: '$(DB_UNLEASH_NAME)'
            - name: DATABASE_USERNAME
              value: '$(DB_UNLEASH_USER)'
            - name: DATABASE_PASSWORD
              value: '$(DB_UNLEASH_PASSWORD)'
            - name: DATABASE_SSL
              value: '{"rejectUnauthorized":false}'
          ports:
            - containerPort: 4242
              protocol: TCP
          startupProbe:
            httpGet:
              path: '/health'
              port: 4242
            failureThreshold: 5
            periodSeconds: 10
