update helm chart
diff --git a/rocketmq-k8s-helm/templates/broker/_helpers.tpl b/rocketmq-k8s-helm/templates/broker/_helpers.tpl
index 0045eeb..32a4b2f 100644
--- a/rocketmq-k8s-helm/templates/broker/_helpers.tpl
+++ b/rocketmq-k8s-helm/templates/broker/_helpers.tpl
@@ -66,5 +66,5 @@
{{- end }}
{{- define "rocketmq-broker.brokerImage" -}}
-{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
+{{ .Values.broker.image.repository }}:{{ .Values.broker.image.tag | default .Chart.AppVersion }}
{{- end }}
diff --git a/rocketmq-k8s-helm/templates/broker/statefulset.yaml b/rocketmq-k8s-helm/templates/broker/statefulset.yaml
index 2889f00..8b0385c 100644
--- a/rocketmq-k8s-helm/templates/broker/statefulset.yaml
+++ b/rocketmq-k8s-helm/templates/broker/statefulset.yaml
@@ -33,11 +33,11 @@
containers:
- name: broker
image: {{ include "rocketmq-broker.brokerImage" . }}
- {{- if $.Values.image.pullPolicy }}
- imagePullPolicy: {{ $.Values.image.pullPolicy }}
- {{- end }}
- command: ["/bin/sh"]
- args: ["-c", "./mqbroker -c /home/rocketmq/conf/broker.conf"]
+ {{- if $.Values.broker.image.pullPolicy }}
+ imagePullPolicy: {{ $.Values.broker.image.pullPolicy }}
+ {{- end }}
+ command: [ "/bin/sh" ]
+ args: [ "-c", "./mqbroker -c /home/rocketmq/conf/broker.conf" ]
env:
- name: POD_NAME
valueFrom:
@@ -64,12 +64,53 @@
- name: proxy
containerPort: 8081
protocol: TCP
+ readinessProbe:
+ failureThreshold: 3
+ initialDelaySeconds: 60
+ periodSeconds: 15
+ successThreshold: 1
+ tcpSocket:
+ port: 10911
+ timeoutSeconds: 1
+ livenessProbe:
+ failureThreshold: 3
+ initialDelaySeconds: 60
+ periodSeconds: 15
+ successThreshold: 1
+ tcpSocket:
+ port: 10911
+ timeoutSeconds: 1
+ resources:
+ {{- toYaml .Values.broker.resources | nindent 12 }}
volumeMounts:
- - name: broker-config
- mountPath: /home/rocketmq/conf
+ - mountPath: /home/rocketmq/conf
+ name: broker-config
+ - mountPath: /home/rocketmq/logs
+ name: broker-storage
+ subPath: home/rocketmq/rocketmq-broker
+ - mountPath: /root/store
+ name: broker-storage
+ subPath: store/rocketmq-broker
dnsPolicy: ClusterFirst
terminationGracePeriodSeconds: 30
+ {{- with .Values.broker.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
volumes:
- name: broker-config
configMap:
name: broker-conf
+ {{- if not $.Values.broker.persistence.enabled }}
+ - name: broker-storage
+ emptyDir: { }
+ {{- else }}
+ volumeClaimTemplates:
+ - metadata:
+ name: broker-storage
+ spec:
+ accessModes: [ "ReadWriteOnce" ]
+ resources:
+ requests:
+ storage: {{ .Values.broker.store.data.size }}
+ {{- end }}
\ No newline at end of file
diff --git a/rocketmq-k8s-helm/templates/nameserver/_helpers.tpl b/rocketmq-k8s-helm/templates/nameserver/_helpers.tpl
index 5e9bb71..8125311 100644
--- a/rocketmq-k8s-helm/templates/nameserver/_helpers.tpl
+++ b/rocketmq-k8s-helm/templates/nameserver/_helpers.tpl
@@ -51,7 +51,7 @@
{{- end }}
{{- define "rocketmq-nameserver.namesrvImage" -}}
-{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
+{{ .Values.nameserver.image.repository }}:{{ .Values.nameserver.image.tag | default .Chart.AppVersion }}
{{- end }}
{{- define "rocketmq-nameserver.port" -}}
diff --git a/rocketmq-k8s-helm/templates/nameserver/deployment.yaml b/rocketmq-k8s-helm/templates/nameserver/deployment.yaml
index bad6966..2980b29 100644
--- a/rocketmq-k8s-helm/templates/nameserver/deployment.yaml
+++ b/rocketmq-k8s-helm/templates/nameserver/deployment.yaml
@@ -17,15 +17,18 @@
containers:
- name: nameserver
image: {{ include "rocketmq-nameserver.namesrvImage" . }}
- {{- if .Values.image.pullPolicy }}
- imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
+ {{- if .Values.nameserver.image.pullPolicy }}
+ imagePullPolicy: {{ .Values.nameserver.image.pullPolicy | quote }}
{{- end }}
ports:
- name: nameserver
containerPort: {{ include "rocketmq-nameserver.port" . }}
protocol: TCP
command: [ "/bin/sh" ]
- args: [ "-c", "./mqnamesrv -c /home/rocketmq/conf/namesrv.p" ]
+ args: [ "-c", "./mqnamesrv -c /home/rocketmq/config/namesrv.p" ]
+ env:
+ - name: JAVA_HEAP_SIZE
+ value: {{ .Values.nameserver.heapSize }}
startupProbe:
tcpSocket:
port: nameserver
@@ -45,10 +48,16 @@
periodSeconds: 5
timeoutSeconds: 1
failureThreshold: 3
+ resources:
+ {{- toYaml .Values.nameserver.resources | nindent 12 }}
volumeMounts:
- - mountPath: /home/rocketmq/conf
+ - mountPath: /home/rocketmq/config/
name: nameserver-config
volumes:
- name: nameserver-config
configMap:
name: nameserver-conf
+ {{- with .Values.nameserver.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
\ No newline at end of file
diff --git a/rocketmq-k8s-helm/templates/proxy/_helpers.tpl b/rocketmq-k8s-helm/templates/proxy/_helpers.tpl
index f5f8bd0..2d5f168 100644
--- a/rocketmq-k8s-helm/templates/proxy/_helpers.tpl
+++ b/rocketmq-k8s-helm/templates/proxy/_helpers.tpl
@@ -43,5 +43,5 @@
{{- end }}
{{- define "rocketmq-proxy.proxyImage" -}}
-{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
+{{ .Values.proxy.image.repository }}:{{ .Values.proxy.image.tag | default .Chart.AppVersion }}
{{- end }}
diff --git a/rocketmq-k8s-helm/templates/proxy/_proxyconfig.tpl b/rocketmq-k8s-helm/templates/proxy/_proxyconfig.tpl
index 8011c28..f49655c 100644
--- a/rocketmq-k8s-helm/templates/proxy/_proxyconfig.tpl
+++ b/rocketmq-k8s-helm/templates/proxy/_proxyconfig.tpl
@@ -2,12 +2,13 @@
Using mergeOverwrite to merge configs from Values into regional config,
valuse from .Values.config have the higher priority.
*/}}
-{{- define "rocketmq-proxy.conf" -}}
-{{- $regionalConf := fromYaml (include "rocketmq-proxy.regional.conf" . ) -}}
- rmq-proxy.json: |
-{{- end }}
-{{- define "rocketmq-proxy.regional.conf" -}}
+{{- define "rocketmq-proxy.conf" -}}
+{{- $commonConf := fromYaml (include "rocketmq-proxy.common.conf" . ) -}}
+ rmq-proxy.json: |
+{{- mergeOverwrite $commonConf .Values.proxy.config | mustToPrettyJson | nindent 4 }}
+{{- end }}
+{{- define "rocketmq-proxy.common.conf" -}}
enableFlowControl: true
enableFlowLimitAction: true
metricCollectorMode: "proxy"
@@ -20,6 +21,6 @@
grpcClientProducerBackoffMultiplier: 5
grpcClientProducerBackoffMaxMillis: 1000
transactionHeartbeatBatchNum: 1
-rocketMQClusterName= {{ include "rocketmq-broker.clusterName" . }}
-namesrvAddr= {{ include "rocketmq-nameserver.fullname" . }}:9876
+rocketMQClusterName: "{{ include "rocketmq-broker.clusterName" . }}"
+namesrvAddr: "{{ include "rocketmq-nameserver.fullname" . }}:9876"
{{- end -}}
\ No newline at end of file
diff --git a/rocketmq-k8s-helm/templates/proxy/deployment.yaml b/rocketmq-k8s-helm/templates/proxy/deployment.yaml
index 6cd53fc..ca0fb5d 100644
--- a/rocketmq-k8s-helm/templates/proxy/deployment.yaml
+++ b/rocketmq-k8s-helm/templates/proxy/deployment.yaml
@@ -23,7 +23,9 @@
containers:
- name: proxy
image: {{ include "rocketmq-proxy.proxyImage" . }}
- imagePullPolicy: {{ .Values.image.pullPolicy }}
+ {{- if .Values.proxy.image.pullPolicy }}
+ imagePullPolicy: {{ .Values.proxy.image.pullPolicy | quote }}
+ {{- end }}
command: [ "/bin/sh" ]
args: [ "-c", "./mqproxy -pc /home/rocketmq/rocketmq-proxy/configmap/rmq-proxy.json" ]
env:
@@ -55,6 +57,22 @@
- name: grpc
containerPort: 8081
protocol: TCP
+ startupProbe:
+ tcpSocket:
+ port: healthcheck
+ initialDelaySeconds: 10
+ failureThreshold: 30
+ periodSeconds: 10
+ readinessProbe:
+ tcpSocket:
+ port: healthcheck
+ periodSeconds: 5
+ livenessProbe:
+ tcpSocket:
+ port: healthcheck
+ periodSeconds: 10
+ resources:
+ {{- toYaml .Values.proxy.resources | nindent 12 }}
volumeMounts:
- name: conf
mountPath: /home/rocketmq/rocketmq-proxy/configmap/
@@ -62,3 +80,7 @@
- name: conf
configMap:
name: proxy-conf
+ {{- with .Values.proxy.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
\ No newline at end of file
diff --git a/rocketmq-k8s-helm/values.yaml b/rocketmq-k8s-helm/values.yaml
index c490c05..ec0d991 100644
--- a/rocketmq-k8s-helm/values.yaml
+++ b/rocketmq-k8s-helm/values.yaml
@@ -1,13 +1,13 @@
# Default values for rocketmq-proxy.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
-image:
- pullPolicy: IfNotPresent
- repository: "cn-cicd-repo-registry.cn-hangzhou.cr.aliyuncs.com/cicd/rocketmq"
- tag: "develop-44e58738-b644-430f-bd94-147cc8f3d731-centos-7"
nameserver:
replicaCount: 1
+ image:
+ pullPolicy: IfNotPresent
+ repository: "cn-cicd-repo-registry.cn-hangzhou.cr.aliyuncs.com/cicd/rocketmq"
+ tag: "develop-44e58738-b644-430f-bd94-147cc8f3d731-centos-7"
imagePullSecrets: [ ]
nameOverride: "nameserver"
@@ -26,6 +26,7 @@
name: ""
podAnnotations: { }
+ nodeSelector: { }
podSecurityContext:
{ }
@@ -76,6 +77,10 @@
proxy:
replicaCount: 1
+ image:
+ pullPolicy: IfNotPresent
+ repository: "cn-cicd-repo-registry.cn-hangzhou.cr.aliyuncs.com/cicd/rocketmq"
+ tag: "develop-44e58738-b644-430f-bd94-147cc8f3d731-centos-7"
imagePullSecrets: [ ]
nameOverride: "proxy"
@@ -146,7 +151,15 @@
broker:
replicaCount: 1
+ image:
+ pullPolicy: IfNotPresent
+ repository: "cn-cicd-repo-registry.cn-hangzhou.cr.aliyuncs.com/cicd/rocketmq"
+ tag: "develop-44e58738-b644-430f-bd94-147cc8f3d731-centos-7"
+
partition: 0
+ persistence:
+ enabled: false
+ size: 8Gi
nameOverride: "broker"
fullnameOverride: ""
@@ -163,6 +176,12 @@
config: ""
+ store:
+ data:
+ size: 10Gi
+ log:
+ size: 10Gi
+
service:
port: 10911