apiVersion: apps/v1
kind: Deployment
metadata:
  name: express-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: express-app
  template:
    metadata:
      labels:
        app: express-app
    spec:
      containers:
      - name: express-app
        image: myproject/express-app:1.0.0
        ports:
          - containerPort: 3000
        env:
        - name: MONGO_DB_USERNAME
          valueFrom:
            secretKeyRef:
              name: mongodb
              key: MONGO_INITDB_ROOT_USERNAME
        - name: MONGO_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mongodb
              key: MONGO_INITDB_ROOT_PASSWORD
        - name: MONGO_DB_HOST
          value: mongodb.default.svc
        