pvc mq-data

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mq-data
  namespace: test
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 2000Gi
  storageClassName: nas

Deployment rabbitmq

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: rabbitmq
  name: rabbitmq
  namespace: test
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: rabbitmq
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: rabbitmq
    spec:
      containers:
        - env:
            - name: RABBITMQ_DEFAULT_USER
              value: admin
            - name: RABBITMQ_DEFAULT_PASS
              value: '123456'
            - name: RABBITMQ_ERLANG_COOKIE
              value: pg9xqVbysu_zpYH5JfVQpOu0J6O_K7
          image: 'rabbitmq:3.9.10-management'
          imagePullPolicy: IfNotPresent
          name: rabbitmq
          ports:
            - containerPort: 15672
              name: http
              protocol: TCP
            - containerPort: 5672
              name: amqp
              protocol: TCP

          volumeMounts:
            - mountPath: /var/lib/rabbitmq
              name: mq-data

      volumes:
        - name: mq-data
          persistentVolumeClaim:
            claimName: mq-data

Service rabbitmq

apiVersion: v1
kind: Service
metadata:
  labels:
    app: rabbitmq
  name: rabbitmq
  namespace: test
spec:
  ports:
    - name: http
      nodePort: 30055
      port: 15672
      protocol: TCP
      targetPort: 15672
    - name: amqp
      nodePort: 30057
      port: 5672
      protocol: TCP
      targetPort: 5672
  selector:
    app: rabbitmq
  sessionAffinity: None
  type: NodePort

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code