一、添加rocketmq仓库
# helm repo add rocketmq https://helm-charts.itboon.top/rocketmq
# helm repo up
# helm search repo rocketmq
# helm pull rocketmq/rocketmq-cluster --version 11.4.0
# tar -zxf rocketmq-cluster-11.4.0.tgz
二、修改value值
这里面需要根据自己的实际情况修改内存大小。
修改存储类及镜像仓库。
# cat values.yaml
clusterName: "rocketmq-helm"
nameOverride: rocketmq
image:
repository: "192.168.2.51/new_kyc/rocketmq"
pullPolicy: IfNotPresent
tag: "5.2.0"
broker:
size:
master: 2
replica: 1
master:
brokerRole: ASYNC_MASTER
jvm:
maxHeapSize: 1024M
# javaOptsOverride: ""
resources:
limits:
cpu: 4
memory: 4Gi
requests:
cpu: 200m
memory: 2Gi
replica:
jvm:
maxHeapSize: 1300M
# javaOptsOverride: ""
resources:
limits:
cpu: 4
memory: 4Gi
requests:
cpu: 50m
memory: 2Gi
persistence:
enabled: true
size: 20Gi
storageClass: "nfs-storage"
aclConfigMapEnabled: false
aclConfig: |
globalWhiteRemoteAddresses:
- '*'
- 10.*.*.*
- 192.168.*.*
config:
## brokerClusterName brokerName brokerRole brokerId 由内置脚本自动生成
deleteWhen: "04"
fileReservedTime: "48"
flushDiskType: "ASYNC_FLUSH"
waitTimeMillsInSendQueue: "1000"
# aclEnable: true
affinityOverride: {}
tolerations: []
nodeSelector: {}
## broker.readinessProbe
readinessProbe:
tcpSocket:
port: main
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
nameserver:
replicaCount: 2
jvm:
maxHeapSize: 1300M
# javaOptsOverride: ""
resources:
limits:
cpu: 2
memory: 4Gi
ephemeral-storage: 8Gi
requests:
cpu: 100m
memory: 2Gi
ephemeral-storage: 1Gi
persistence:
enabled: false
size: 8Gi
storageClass: "nfs-storage"
affinityOverride: {}
tolerations: []
nodeSelector: {}
## nameserver.readinessProbe
readinessProbe:
tcpSocket:
port: main
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
proxy:
enabled: true
replicaCount: 2
jvm:
maxHeapSize: 1300M
# javaOptsOverride: ""
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 100m
memory: 2Gi
affinityOverride: {}
tolerations: []
nodeSelector: {}
## proxy.readinessProbe
readinessProbe:
tcpSocket:
port: main
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
## proxy.service
service:
annotations: {}
type: ClusterIP
dashboard:
enabled: true
replicaCount: 1
image:
repository: "apacherocketmq/rocketmq-dashboard"
pullPolicy: IfNotPresent
tag: "1.0.0"
auth:
enabled: true
users:
- name: admin
password: admin
isAdmin: true
- name: user01
password: userPass
jvm:
maxHeapSize: 600M
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 20m
memory: 1Gi
## dashboard.readinessProbe
readinessProbe:
failureThreshold: 5
httpGet:
path: /
port: http
livenessProbe: {}
service:
annotations: {}
type: ClusterIP
# nodePort: 31007
ingress:
enabled: false
className: ""
annotations: {}
# nginx.ingress.kubernetes.io/whitelist-source-range: 10.0.0.0/8,124.160.30.50
hosts:
- host: rocketmq-dashboard.example.com
tls: []
# - secretName: example-tls
# hosts:
# - rocketmq-dashboard.example.com
三、运行
# helm upgrade --install rocketmq --namespace rocketmq \
> --create-namespace \
> . -f values.yaml
Release "rocketmq" does not exist. Installing it now.
NAME: rocketmq
LAST DEPLOYED: Fri Jul 12 09:45:01 2024
NAMESPACE: rocketmq
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
>>> Nameserver Address:
rocketmq-nameserver.rocketmq:9876
>>> Proxy Remoting Address:
rocketmq-proxy.rocketmq:8080
>>> Proxy gRPC Address:
rocketmq-proxy.rocketmq:8081
>>> RocketMQ Dashboard Auth:
username: admin password: admin
username: user01 password: userPass
Modify "rocketmq-dashboard-cm" configmap to change the password
四、注意
这里的镜像我是单独下载的,然后推向自己的私有仓库。
# docker pull dhub.kubesre.xyz/apache/rocketmq:5.2.0
# docker tag dhub.kubesre.xyz/apache/rocketmq:5.2.0 192.168.2.51/new_kyc/rocketmq:5.2.0
# docker push 192.168.2.51/new_kyc/rocketmq:5.2.0
如果需要访问,就直接修改service的type: ClusterIP为type: NodePort
账号密码都在values.yaml文件中