apiVersion: apps/v1
kind: Deployment
metadata:
  name: colosseum-snacks-app
spec:
  selector:
    matchLabels:
      app: colosseum-snacks-app
  replicas: 2
  template:
    metadata:
      labels:
        app: colosseum-snacks-app
    spec:
      containers:
        - name: colosseum-snacks-app
          image: springboot-mongo-kubernetes:0.0.1-SNAPSHOT
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            - name: MONGO_USERNAME
              valueFrom:
                secretKeyRef:
                  name: db-secret
                  key: username
            - name: MONGO_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: db-secret
                  key: password