apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: backend
    name: backend
  name: backend
spec:
  selector:
    matchLabels:
      app: backend
  replicas: 1
  revisionHistoryLimit: 3
  template:
    metadata:
      labels:
        app: backend
    spec:
      containers:
        - image: "reecerussell/open-social-backend:latest"
          name: backend
          resources:
            limits:
              cpu: "100m"
              memory: "200Mi"
            requests:
              cpu: "20m"
              memory: "50Mi"
          ports:
            - containerPort: 9292
              protocol: TCP
          env:
            - name: USERS_API_URL
              value: http://users
            - name: AUTH_API_URL
              value: http://auth
            - name: POSTS_API_URL
              value: http://posts
            - name: MEDIA_API_URL
              value: http://media
            - name: TOKEN_PUBLIC_KEY_DATA
              valueFrom:
                secretKeyRef:
                  name: token
                  key: public-key
          livenessProbe:
            httpGet:
              path: /health
              port: 9292
            initialDelaySeconds: 3
            periodSeconds: 3
          readinessProbe:
            httpGet:
              path: /health
              port: 9292
            initialDelaySeconds: 3
            periodSeconds: 3
