---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: orders-db
  labels:
    app: orders-db
  namespace: sock-shop
spec:
  replicas: 1
  selector:
    matchLabels:
      app: orders-db
  template:
    metadata:
      labels:
        app: orders-db
      annotations:
        sidecar.istio.io/proxyCPU: "10m"
    spec:
      containers:
        - name: orders-db
          image: mongo
          ports:
            - name: mongo
              containerPort: 27017
          securityContext:
            capabilities:
              drop:
                - all
              add:
                - CHOWN
                - SETGID
                - SETUID
            readOnlyRootFilesystem: true
          volumeMounts:
            - mountPath: /tmp
              name: tmp-volume
        - name: mongodb-exporter
          image: bitnami/mongodb-exporter
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 9216
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      volumes:
        - name: tmp-volume
          emptyDir:
            medium: Memory
      nodeSelector:
        beta.kubernetes.io/os: linux
