apiVersion: apps/v1
kind: Deployment
metadata:
  name: rabbit
  labels:
    name: rabbit
spec:
  replicas: 1 
  selector:
    matchLabels:
      name: rabbit
  template:
    metadata:
      labels:
        name: rabbit
    spec:
      subdomain: primary
      containers:
      - name: rabbit
        image: rabbitmq:3.8-management
        env:
        - name: RABBITMQ_DEFAULT_USER
          valueFrom:
            secretKeyRef:
              name: rabbit
              key: username
        - name: RABBITMQ_DEFAULT_PASS
          valueFrom:
            secretKeyRef:
              name: rabbit
              key: password
        ports:
        - containerPort: 5672
        - containerPort: 15672

