kubernetes快速部署rocketmq-console 2.0.0

  sre

6006388d65cb9798.jpg_fo742.jpg

mvn package

git clone https://github.com/apache/rocketmq-externals.git
cd rocketmq-externals/rocketmq-console/
mvn clean package -Dmaven.test.skip=true

Dockerfile:

FROM dockerhub.my.com/base/java8
MAINTAINER me@me.org
#ENV TZ=PRC
ENV JAVA_OPTS="-server -Xms128m -Xmx4096m"
ENV JMX_OPTS="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.port=9999"
ADD target/rocketmq-console-ng-2.0.0.jar /opt/app.jar
CMD java JAVA_OPTSJMX_OPTS -Djava.rmi.server.hostname=$(hostname -I)  -jar -Dspring.config.location=/opt/application.properties  /opt/app.jar
EXPOSE 8080
EXPOSE 9999

docker build

docker build -t dockerhub.my.com/base/rocketmq-console-ng:2.0.0-20210319 .
docker push dockerhub.my.com/base/rocketmq-console-ng:2.0.0-20210319

cm rocketmq-console-ng

apiVersion: v1
kind: ConfigMap
metadata:
  name: rocketmq-console-ng
  namespace: quant
data:
  application.properties: |
        server.address=0.0.0.0
        server.port=8080

        #if this value is empty,use env value rocketmq.config.namesrvAddr  NAMESRV_ADDR |         now, you can set it in ops page.default localhost:9876
        rocketmq.config.namesrvAddr=172.16.0.120:9876
        #if you use rocketmq version < 3.5.8, rocketmq.config.isVIPChannel should be         false.default true
        rocketmq.config.isVIPChannel=
        #rocketmq-console's data path:dashboard/monitor
        rocketmq.config.dataPath=/tmp/rocketmq-console/data
        #set it false if you don't want use dashboard.default true
        rocketmq.config.enableDashBoardCollect=true
        #set the message track trace topic if you don't want use the default one
        rocketmq.config.msgTrackTopicName=
        rocketmq.config.ticketKey=ticket

        #Must create userInfo file: ${rocketmq.config.dataPath}/users.properties if the         login is required
        rocketmq.config.loginRequired=false



        #spring.application.index=true
        spring.application.name=rocketmq-console
        spring.http.encoding.charset=UTF-8
        spring.http.encoding.enabled=true
        spring.http.encoding.force=true
        logging.level.root=INFO
        logging.config=classpath:logback.xml

        ### SSL setting
        #server.ssl.key-store=classpath:rmqcngkeystore.jks
        #server.ssl.key-store-password=rocketmq
        #server.ssl.keyStoreType=PKCS12
        #server.ssl.keyAlias=rmqcngkey

        #set the accessKey and secretKey if you used acl
        #rocketmq.config.accessKey=
        #rocketmq.config.secretKey=

Deployment rocketmq-console-ng

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rocketmq-console-ng
  namespace: quant
  labels:
    name: rocketmq-console-ng
spec:
  selector:
    matchLabels:
      name: rocketmq-console-ng
  template:
    metadata:
      name: rocketmq-console-ng
      labels:
        name: rocketmq-console-ng
    spec:
      containers:
      - name: rocketmq-console-ng
        image: dockerhub.my.com/base/rocketmq-console-ng:2.0.0
        imagePullPolicy: IfNotPresent
        restartPolicy: OnFailure
        ports:
        - name: http
          containerPort: 8080
        volumeMounts:
          - name: console-config
            subPath: application.properties
            mountPath: /opt/application.properties
      volumes:
        - name: console-config
          configMap:
            name: rocketmq-console-ng

svc rocketmq-console-ng

apiVersion: v1
kind: Service
metadata:
 name: rocketmq-console-ng
 namespace: quant
spec:
 type: NodePort
 ports:
 - name: rocketmq-console-ng
   port: 8080
   protocol: TCP
   targetPort: 8080
   nodePort: 30082
 selector:
   name: rocketmq-console-ng

http

http://172.16.0.17:30082

LEAVE A COMMENT

Captcha Code