---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-java
  namespace: api
  labels:
    app: user-java
spec:
  replicas: 3
  selector:
    matchLabels:
      app: user-java
  template:
    metadata:
      labels:
        app: user-java
    spec:
      volumes:
      - name: tripinsights-secrets
        csi:
          driver: secrets-store.csi.k8s.io
          readOnly: true
          volumeAttributes:
            secretProviderClass: tripinsights-secrets
      containers:
      - name: user-java
        image: registrydoy6068.azurecr.io/tripinsights/user-java:1.0
        env:
          - name: SQL_SERVER
            valueFrom:
              configMapKeyRef:
                name: sqlserver-configmap
                key: sql_server
          - name: SQL_DBNAME
            valueFrom:
              configMapKeyRef:
                name: sqlserver-configmap
                key: sql_dbname
          - name: SQL_USER
            valueFrom:
              configMapKeyRef:
                name: sqlserver-configmap
                key: sql_user
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /secrets
          name: tripinsights-secrets
          readOnly: true
