---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
  labels:
    name: api
    app.kubernetes.io/name: api
    layer: client
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api
      app.kubernetes.io/name: api
  template:
    metadata:
      labels:
        name: api
        layer: client
        version: "2.2.1"
        app.kubernetes.io/name: api
      annotations:
        sidecar.istio.io/rewriteAppHTTPProbers: "true"
    spec:
      containers:
      - name: api
        image: "iad.ocir.io/oracle/ateam/mushop-api:2.2.1"
        imagePullPolicy: IfNotPresent
        ports:
        - name: http
          containerPort: 3000
        env:
        - name: SESSION_REDIS
          value: session
        - name: CATALOGUE_URL
          value: http://catalogue
        - name: ORDERS_URL
          value: http://orders
        - name: CARTS_URL
          value: http://carts
        - name: USERS_URL
          value: http://user
        - name: EVENTS_URL
          value: http://mushop-events
        - name: STATIC_MEDIA_URL
          value: /assets
        - name: NEWSLETTER_SUBSCRIBE_URL
          value: ""
        livenessProbe:
          httpGet:
            path: /health
            port: http
        readinessProbe:
          httpGet:
            path: /health
            port: http
        resources:
          limits:
            cpu: 300m
            memory: 300Mi
          requests:
            cpu: 100m
            memory: 100Mi
        securityContext:
          capabilities:
            add:
              - NET_BIND_SERVICE
            drop:
              - all
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 10001
