apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: rabbitmq
  namespace: airflow
spec:
  selector:
    matchLabels:
      app: rabbitmq
  serviceName: rabbitmq
  template:
    metadata:
      labels:
        app: rabbitmq
    spec:
      containers:
        - name: rabbitmq
          image: rabbitmq:3-alpine
          envFrom:
            - secretRef:
                name: rabbitmq
          ports:
            - containerPort: 5672
          volumeMounts:
            - name: rabbitmq
              mountPath: /var/lib/rabbitmq
  volumeClaimTemplates:
    - metadata:
        name: rabbitmq
        namespace: airflow
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi