apiVersion: apps/v1
kind: Deployment
metadata:
  name: supplier-helidon-se
spec:
  replicas: 1
  selector:
    matchLabels:
      app: supplier
  template:
    metadata:
      labels:
        app: supplier
        version: helidon-se
    spec:
      containers:
      - name: supplier
        image: ${DOCKER_REGISTRY}/supplier-helidon-se:0.1
        imagePullPolicy: Always
        env:
        - name: database.user
          value: "INVENTORYUSER"
        - name: database.url
          value: "jdbc:oracle:thin:@${INVENTORY_DB_ALIAS}?TNS_ADMIN=/msdataworkshop/creds"
        - name: inventoryqueuename
          value: "inventoryqueue"
        - name: OCI_REGION
          value: "${OCI_REGION}"
        - name: VAULT_SECRET_OCID
          value: "${VAULT_SECRET_OCID}"
        - name: dbpassword
          valueFrom:
            secretKeyRef:
              name: dbuser
              key: dbpassword
              optional: true #not needed/used if using VAULT_SECRET_OCID exists
        volumeMounts:
        - name: creds
          mountPath: /msdataworkshop/creds
        ports:
        - containerPort: 8080
      restartPolicy: Always
      volumes:
      - name: creds
        secret:
          secretName: inventory-db-tns-admin-secret