apiVersion: apps/v1
kind: Deployment
metadata:
  name: back-nestjs
  labels:
    app: back-nestjs
spec:
  replicas: 2
  selector:
    matchLabels:
      app: back-nestjs
  template:
    metadata:
      labels:
        app: back-nestjs
    spec:
      containers:
      - name: back-nestjs
        image: DOCKER_IMAGE:TAG
        ports:
        - containerPort: 3000
        env:
        - name: HOST
          value: mysql
        - name: PASS
          valueFrom:
            secretKeyRef:
              name: mysql-secrets
              key: MYSQL_PASSWORD
        - name: USER
          valueFrom:
            secretKeyRef:
              name: mysql-secrets
              key: MYSQL_USER
        - name: DATABASE
          valueFrom:
            configMapKeyRef:
              name: mysql-configs
              key: MYSQL_DATABASE
        - name: PORT
          valueFrom:
            configMapKeyRef:
              name: mysql-configs
              key: MYSQL_PORT