## 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-postgres-kafka
spec:
  replicas: 1
  selector:
    matchLabels:
      app: inventory
  template:
    metadata:
      labels:
        app: inventory
        version: helidon
    spec:
      containers:
      - name: inventory
        image: ${DOCKER_REGISTRY}/inventory-postgres-kafka:0.1
        imagePullPolicy: Always
        env:
        - name: javax.sql.DataSource.postgresDataSource.dataSource.user
          value: "postgresadmin"
        - name: javax.sql.DataSource.postgresDataSource.dataSource.URL
          value: "jdbc:postgresql://postgres.msdataworkshop:5432/postgresdb"
#        - name: javax.sql.DataSource.postgresDataSource.dataSource.password
#          value: "admin123"
        - name: javax.sql.DataSource.postgresDataSource.dataSource.password
          valueFrom:
            secretKeyRef:
              name: dbuser
              key: dbpassword
        volumeMounts:
        - name: creds
          mountPath: /msdataworkshop/creds
        ports:
        - containerPort: 8080
      restartPolicy: Always
      volumes:
      - name: creds
        secret:
          secretName: inventory-db-tns-admin-secret