Kubernetes – Manifest example for RabbitMQ

 

Example manifest for creating a configmap, deployment and service for RabbitMQ

manifest.yml

apiVersion: v1
kind: ConfigMap
metadata:
  name: rabbitmq-config
  namespace: staging
  labels:
    app: rabbitmq
data:
  RABBITMQ_DEFAULT_USER: "user"
  RABBITMQ_DEFAULT_PASS: "password"
  RABBITMQ_DEFAULT_VHOST: "vhost"

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rabbitmq
  namespace: staging
  labels:
    app: rabbitmq-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rabbitmq-app
  strategy:
    type: RollingUpdate
  progressDeadlineSeconds: 300
  template:
    metadata:
      labels:
        app: rabbitmq-app
    spec:
      containers:
      - image: rabbitmq:3
        name: rabbitmq
        imagePullPolicy: "IfNotPresent"
        envFrom:
          - configMapRef:
              name: rabbitmq-config
        ports:
          - containerPort: 5672
        volumeMounts:
          - mountPath: /var/lib/rabbitmq
            subPath: data/rabbitmq
            name: persistent-storage
      volumes:
      - name: persistent-storage
        persistentVolumeClaim:
          claimName: persistent-storage

---

apiVersion: v1
kind: Service
metadata:
  name: rabbitmq-svc
  namespace: staging
spec:
  ports:
  - port: 5672
    targetPort: 5672
  selector:
    app: rabbitmq-app

Tagged: Tags

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments