---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rabbitmq-v1
  labels:
    name: rabbitmq
    app: rabbitmq
    version: v1
  namespace: sock-shop
spec:
  replicas: 1
  selector:
    matchLabels:
      name: rabbitmq
      app: rabbitmq
      version: v1
  template:
    metadata:
      labels:
        name: rabbitmq
        app: rabbitmq
        version: v1
    spec:
      containers:
      - name: rabbitmq
        image: rabbitmq:3.6.8-management
        resources:
          requests:
            cpu: 100m
            memory: 200Mi
          limits:
            cpu: 300m
            memory: 500Mi
        ports:
        - containerPort: 15672
          name: management
        - containerPort: 5672
          name: rabbitmq
        securityContext:
          capabilities:
            drop:
              - all
            add:
              - CHOWN
              - SETGID
              - SETUID
              - DAC_OVERRIDE
          readOnlyRootFilesystem: true
      - name: rabbitmq-exporter
        image: kbudde/rabbitmq-exporter
        resources:
          requests:
            cpu: 100m
            memory: 200Mi
          limits:
            cpu: 300m
            memory: 500Mi
        ports:
        - containerPort: 9090
          name: exporter
      nodeSelector:
        beta.kubernetes.io/os: linux
