apiVersion : apps/v1
kind: Deployment
metadata:
  name: telefonia 
spec:
  replicas: 1
  selector:
    matchLabels:
      app: telefonia
  template:
    metadata:
      labels:
        app: telefonia 
    spec:
      containers:
        - name: telefonia 
          image: assaabloy.azurecr.io/telefonia
          ports:
          - containerPort: 8080

          env:
            - name: TELEFONIA
              valueFrom:
                configMapKeyRef:
                  name: telefonia-config
                  key: TELEFONIA_APP_PROFILE

            - name: TELEFONIA_APP_PORT
              valueFrom:
                configMapKeyRef:
                  name: telefonia-config
                  key: TELEFONIA_APP_PORT

            - name: TELEFONIA_DB_HOST
              valueFrom:
                configMapKeyRef:
                  name: telefonia-config
                  key: TELEFONIA_DB_HOST

            - name: TELEFONIA_DB_NAME
              valueFrom:
                configMapKeyRef:
                  name: telefonia-config
                  key: TELEFONIA_DB_NAME

            - name: TELEFONIA_DB_PORT
              valueFrom:
                configMapKeyRef:
                  name: telefonia-config
                  key: TELEFONIA_DB_PORT

            - name: TELEFONIA_DB_TIMEZONE
              valueFrom:
                configMapKeyRef:
                  name: telefonia-config
                  key: TELEFONIA_DB_TIMEZONE

            - name: TELEFONIA_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: telefonia-secret
                  key: TELEFONIA_DB_PASSWORD

            - name: TELEFONIA_DB_USERNAME
              valueFrom:
                secretKeyRef:
                  name: telefonia-secret
                  key: TELEFONIA_DB_USERNAME