apiVersion: apps/v1
kind: Deployment
metadata:
  name: coap-app
  labels: 
    app: dev
spec:
  selector:
    matchLabels:
      app: coap-interface
  template:
    metadata:
      labels:
        app: coap-interface
    spec:
      containers:
      - name: coap-interface
        image: docker.io/ocfcloud/coap-interface:latest
        ports:
        - containerPort: 8080
        - containerPort: 5684
        resources:
          limits:
            memory: "1Gi"
            cpu: 200m
        env:
        - name: MY_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: CACHE_URI
          valueFrom:
            configMapKeyRef:
              name: registry-configmap
              key: CACHE_URI
        - name: CACHE_PASSWORD
          valueFrom:
            configMapKeyRef:
              name: registry-configmap
              key: CACHE_PASSWORD
        - name: DB_USERNAME
          valueFrom:
            configMapKeyRef:
              name: registry-configmap
              key: DB_USERNAME
        - name: DB_PASSWORD
          valueFrom: 
            configMapKeyRef:
              name: registry-configmap
              key: DB_PASSWORD
        - name: DB_NAME
          valueFrom:
            configMapKeyRef:
              name: registry-configmap
              key: DB_NAME
        - name: DB_URI
          valueFrom:
            configMapKeyRef:
              name: registry-configmap
              key: DB_URI
      