apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-springboot-deployment
  labels:
    app: api-springboot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api-springboot
  template:
    metadata:
      labels:
        app: api-springboot
    spec:
      containers:
      - name: api-springboot
        image: api-springboot:1.0
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: application-config
          mountPath: /app/config/application.properties
          subPath: application.properties
        env:
        - name: MONGODB_USERNAME
          valueFrom:
            secretKeyRef:
              name: mongodb-creds
              key: username
        - name: MONGODB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mongodb-creds
              key: password
      volumes:
      - name: application-config
        configMap:
          name: api-springboot

        