---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: carts-db
  labels:
    name: carts-db
    app: sock-shop
  namespace: sock-shop
  annotations:
    litmuschaos.io/chaos: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      name: carts-db
      app: sock-shop
  template:
    metadata:
      labels:
        name: carts-db
        app: sock-shop
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9216"
    spec:
      containers:
      - name: carts-db
        image: mongo
        ports:
        - name: mongo
          containerPort: 27017
        volumeMounts:
        - mountPath: /tmp
          name: tmp-volume
        resources:
          limits:
            cpu: 200m
            memory: 200Mi
          requests:
            cpu: 200m
            memory: 200Mi
      - name: mongodb-exporter
        image: ssheehy/mongodb-exporter:0.10.0
        ports:
        - name: exporter
          containerPort: 9216
        env:
          - name: MONGODB_URI
            value: "mongodb://localhost:27017"
      volumes:
        - name: tmp-volume
          emptyDir:
            medium: Memory
      nodeSelector:
        beta.kubernetes.io/os: linux
        cloud.google.com/gke-nodepool: "default-pool"
