apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-java-deployment
  labels:
    app: user-java
spec:
  replicas: 1
  selector:
    matchLabels:
      app: user-java
  template:
    metadata:
      labels:
        app: user-java
    spec:
      containers:
      - name: user-java
        image: registryldb3678.azurecr.io/user-java:1.0
        volumeMounts:
        - name: secrets-store01-inline
          mountPath: "/mnt/secrets-store"
          readOnly: true
        ports:
        - containerPort: 80
        env:
          - name: SQL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: secrets-from-kv
                key: password
          - name: SQL_SERVER
            valueFrom:
              secretKeyRef:
                name: secrets-from-kv
                key: sqlserver
          - name: SQL_USER
            valueFrom:
              secretKeyRef:
                name: secrets-from-kv
                key: username
          - name: ASPNETCORE_ENVIRONMENT
            value: Development
      volumes:
      - name: secrets-store01-inline
        csi:
          driver: secrets-store.csi.k8s.io
          readOnly: true
          volumeAttributes:
            secretProviderClass: "azure-kvname-user-msi"