---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: storefront
  labels:
    name: storefront
    layer: client
    app.kubernetes.io/name: storefront
spec:
  replicas: 1
  selector:
    matchLabels:
      app: storefront
      app.kubernetes.io/name: storefront
  template:
    metadata:
      labels:
        name: storefront
        layer: client
        app.kubernetes.io/name: storefront
      annotations:
        sidecar.istio.io/rewriteAppHTTPProbers: "true"
    spec:
      containers:
      - name: storefront
        image: iad.ocir.io/oracle/ateam/mushop-storefront:2.3
        imagePullPolicy: Always
        ports:
        - name: http
          containerPort: 8080
        - name: status
          containerPort: 8888
        resources:
          limits:
            cpu: 300m
            memory: 300Mi
          requests:
            cpu: 100m
            memory: 100Mi
        securityContext:
          runAsNonRoot: true
          runAsUser: 10001
          capabilities:
            drop:
              - all
            add:
              - NET_BIND_SERVICE
              - CHOWN
              - SETGID
              - SETUID
          readOnlyRootFilesystem: true
        livenessProbe:
          httpGet:
            path: /
            port: http
        readinessProbe:
          httpGet:
            path: /
            port: http
        volumeMounts:
        - mountPath: /tmp
          name: tmp-volume
      volumes:
        - name: tmp-volume
          emptyDir:
            medium: Memory
