---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: shoppingcartservice
  name: shoppingcartservice
  namespace: shopping
  annotations:
    fluxcd.io/automated: "true"
spec:
  replicas: 3
  selector:
    matchLabels:
      app: shoppingcartservice
  template:
    metadata:
      labels:
        app: shoppingcartservice
    spec:
      containers:
      - name: shoppingcartservice
        image: docker.io/octonato/shopping-cart-service:0.0.0-4-7d43d55e
          # remove for real clusters, useful for minikube
          #imagePullPolicy: Never
        readinessProbe:
          httpGet:
            path: "/ready"
            port: management
          periodSeconds: 10
          failureThreshold: 10
          initialDelaySeconds: 20
        livenessProbe:
          httpGet:
            path: "/alive"
            port: management
          periodSeconds: 10
          failureThreshold: 10
          initialDelaySeconds: 20
        ports:
        - name: management
          containerPort: 8558
          protocol: TCP
        - name: http
          containerPort: 8080
          protocol: TCP
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: REQUIRED_CONTACT_POINT_NR
          value: "2"
        resources:
          limits:
            memory: 512Mi
          requests:
            cpu: "300m"
            memory: 128Mi
