apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-deployment
  namespace: simpleecom
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth
  template:
    metadata:
      labels:
        app: auth
        azure.workload.identity/use: "false"
    spec:
      # serviceAccountName: serversa
      containers:
      - name: auth
        image: <acr-name>.azurecr.io/auth:v1
        ports:
        - containerPort: 8083
        env:
        - name: COSMOSDBOPTIONS__DATABASE_ID
          value: "Simpleecom"
        - name: COSMOSDBOPTIONS__PARTITION_KEY
          value: "/email"
        - name: COSMOSDBOPTIONS__CONTAINER_NAME
          value: "Users"
        - name: COSMOSDBOPTIONS__COSMOS_ENDPOINT
          value: "<cosmosdb endpoint>"
        - name: ASPNETCORE_ENVIRONMENT
          value: "Development"
        - name: ASPNETCORE_HTTP_PORTS
          value: "8083"
        - name: COSMOSDBOPTIONS__CONNECTION_STRING
          value: "<cosmosdb-conn-string>"

---
apiVersion: v1
kind: Service
metadata:
  name: auth
  namespace: simpleecom
spec:
  selector:
    app: auth
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8083
  type: ClusterIP