apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.axel/name: axel-api-server
  name: api-server-deployment
spec:
  replicas: 4
  selector:
    matchLabels:
      app.axel/name: axel-api-server
  template:
    metadata:
      labels:
        app.axel/name: axel-api-server
    spec:
      containers:
      - image: ghcr.io/notaphplover/axel/backend-node:latest
        env:
        - name: APP_ENV
          value: "kubernetes"
        name: backend
        ports:
        - containerPort: 3000
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
      initContainers:
        - name: init-db
          image: busybox:1.32
          command: ['sh', '-c', "until nc -z db-service 27017 && nc -z redis-service 6379; do echo waiting for db and redis; sleep 2; done"]
