控制台配置

即可视化界面

kind: Deployment
apiVersion: apps/v1
metadata:
  name: rocketmq-console
  namespace: your-namespace
  labels:
    app: rocketmq-console
  annotations:
    deployment.kubernetes.io/revision: '3'
    kubesphere.io/creator: zhangsan
    kubesphere.io/description: rocketmq可视化服务
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rocketmq-console
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: rocketmq-console
    spec:
      volumes:
        - name: host-time
          hostPath:
            path: /etc/localtime
            type: ''
      containers:
        - name: rocketmq-console
          image: 'styletang/rocketmq-console-ng:1.0.0'
          ports:
            - name: http-8080
              containerPort: 8080
              protocol: TCP
          env:
            - name: JAVA_OPTS
              value: >-
                -Drocketmq.namesrv.addr=host:9876
                -Dcom.rocketmq.sendMessageWithVIPChannel=false
          resources:
            limits:
              cpu: '2'
              memory: 4000Mi
            requests:
              cpu: 10m
              memory: 10Mi
          volumeMounts:
            - name: host-time
              readOnly: true
              mountPath: /etc/localtime
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: default
      serviceAccount: default
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600

kubesphere配置
在这里插入图片描述

broker节点配置

k8s配置

kind: Deployment
apiVersion: apps/v1
metadata:
  name: rocketmq-broker
  namespace: your-namespace
  labels:
    app: rocketmq-broker
  annotations:
    deployment.kubernetes.io/revision: '7'
    kubesphere.io/alias-name: broker
    kubesphere.io/creator: zhangsan
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rocketmq-broker
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: rocketmq-broker
      annotations:
        logging.kubesphere.io/logsidecar-config: '{}'
    spec:
      volumes:
        - name: host-time
          hostPath:
            path: /etc/localtime
            type: ''
        - name: volume-nude2u
          configMap:
            name: rocket-conf
            items:
              - key: broker.conf
                path: broker.conf
            defaultMode: 420
      containers:
        - name: rocketmq-broker
          image: 'rocketmqinc/rocketmq:4.3.2'
          command:
            - sh
          args:
            - mqbroker
            - '-c'
            - /opt/rocketmq-4.3.2/conf/broker.conf
          ports:
            - name: tcp-10909
              containerPort: 10909
              protocol: TCP
            - name: tcp-10911
              containerPort: 10911
              protocol: TCP
          env:
            - name: NAMESRV_ADDR
              value: 'host:9876'
          resources:
            limits:
              cpu: '2'
              memory: 4000Mi
            requests:
              cpu: 10m
              memory: 10Mi
          volumeMounts:
            - name: host-time
              readOnly: true
              mountPath: /etc/localtime
            - name: volume-nude2u
              readOnly: true
              mountPath: /opt/rocketmq-4.3.2/conf/broker.conf
              subPath: broker.conf
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: default
      serviceAccount: default
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600

kubesphere界面配置
在这里插入图片描述
在这里插入图片描述

nameserver配置

yaml文件

kind: Deployment
apiVersion: apps/v1
metadata:
  name: rocketmq
  namespace: your-namespace
  labels:
    app: rocketmq
  annotations:
    deployment.kubernetes.io/revision: '4'
    kubesphere.io/alias-name: nameserver
    kubesphere.io/creator: zhangsan
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rocketmq
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: rocketmq
      annotations:
        kubesphere.io/restartedAt: '2023-10-20T03:11:56.869Z'
    spec:
      volumes:
        - name: host-time
          hostPath:
            path: /etc/localtime
            type: ''
      containers:
        - name: rocketmq-nameserver
          image: 'rocketmqinc/rocketmq:4.3.2'
          command:
            - sh
          args:
            - mqnamesrv
          ports:
            - name: tcp-9876
              containerPort: 9876
              protocol: TCP
          resources:
            limits:
              cpu: '2'
              memory: 4000Mi
            requests:
              cpu: 10m
              memory: 10Mi
          volumeMounts:
            - name: host-time
              readOnly: true
              mountPath: /etc/localtime
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: default
      serviceAccount: default
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600

kubesphere
在这里插入图片描述
创建nameserver服务
在这里插入图片描述
创建console-svc
在这里插入图片描述
完成。访问可视化界面,就是你console-svc的服务地址
在这里插入图片描述

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐