
##
## Copyright (c) 2021 Oracle and/or its affiliates.
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
apiVersion: apps/v1
kind: Deployment
metadata:
  name: inventory-helidon-se
  labels:
    app: inventory
spec:
  replicas: 1
  selector:
    matchLabels:
      app: inventory
  template:
    metadata:
      labels:
        app: inventory
        version: helidon-se
    spec:
      containers:
        - name: inventory
          imagePullPolicy: Always
          image: ${DOCKER_REGISTRY}/inventory-helidon-se:0.1
          volumeMounts:
            - name: creds
              mountPath: /msdataworkshop/creds
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /health/live
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 20
            timeoutSeconds: 5
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 3
            timeoutSeconds: 5
            failureThreshold: 20
          env:
            - name: LOG_LEVEL
              value: "DEBUG"
            - name: server_port
              value: "8080"
            - name: db_user
              value: "inventoryuser"
            - name: db_url
              value: "jdbc:oracle:thin:@${INVENTORY_DB_ALIAS}?TNS_ADMIN=/msdataworkshop/creds"
            - name: db_queueOwner
              value: "AQ"
            - name: db_orderQueueName
              value: "orderqueue"
            - name: db_inventoryQueueName
              value: "inventoryqueue"
            - name: OCI_REGION
              value: "${OCI_REGION-}"
            - name: VAULT_SECRET_OCID
              value: "${VAULT_SECRET_OCID-}"
            - name: db_password
              valueFrom:
                secretKeyRef:
                  name: dbuser
                  key: dbpassword
                  optional: true #not needed/used if using VAULT_SECRET_OCID exists
      restartPolicy: Always
      volumes:
      - name: creds
        secret:
          secretName: inventory-db-tns-admin-secret