apiVersion: apps/v1
kind: Deployment
metadata:
  name: rabbitmq-deployment
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      run: rabbitmq
  template:
    metadata:
      labels:
        run: rabbitmq

    spec:
      volumes:
      - name: rabbitmq-data-storage
        persistentVolumeClaim:
          claimName: claim-rabbitmq-data
      containers:
      - image: rabbitmq:3.7-alpine
        name: rabbitmq
        ports:
        - containerPort: 5672
        volumeMounts:
        - name: rabbitmq-data-storage
          mountPath: /var/lib/rabbitmq