rabbitmq.yaml

mail@pastecode.io avatar
unknown
yaml
a year ago
1.5 kB
2
Indexable
Never
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rmq-deployment
  namespace: foodapp
  labels:
    app: rmq-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rmq-pod
  template:
    metadata:
      labels:
        app: rmq-pod
    spec:
      containers:
      - name: rabbitmq 
        image: rabbitmq:3.9.13-management-alpine
        resources:
          requests:
            memory: "256Mi"
            cpu: "100m"
          limits:
            memory: "512Mi"
            cpu: "500m"
        ports:
        - containerPort: 15672
        - containerPort: 5672
        env:
        - name: RABBITMQ_DEFAULT_USER
          value: user
        - name: RABBITMQ_DEFAULT_PASS
          value: password
        volumeMounts:
          - name: rmq-data
            mountPath: /var/lib/rabbitmq
      volumes:
        - name: rmq-data
          persistentVolumeClaim:
            claimName: rmq-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: rmq-pvc
  namespace: foodapp
spec:
  accessModes:
    - ReadWriteOnce 
  resources:
    requests:
      storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
  name: rmq-servivce
  namespace: foodapp
  labels:
    app: rabbitmq-service
spec:
  selector:
    app: rmq-pod
  ports:
    - name: amqp
      protocol: TCP
      port: 5672
      targetPort: 5672
    - name: management
      protocol: TCP
      port: 15672
      targetPort: 15672
  type: ClusterIP