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

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