Skip to content

Commit

Permalink
fix: update broker with StatefulSet
Browse files Browse the repository at this point in the history
Signed-off-by: wangxye <[email protected]>
  • Loading branch information
wangxye committed Oct 20, 2023
1 parent 0c63e59 commit 75dedfc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rocketmq-k8s-helm/helm_sample_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

broker:
replicaCount: 1
replicaCount: 2
conf:
clusterNameOverride: "automq"
s3stream:
Expand Down
2 changes: 1 addition & 1 deletion rocketmq-k8s-helm/templates/broker/_brokerconfig.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.
{{- $db := .Values.broker.db }}
{{- $replicaCount := .Values.broker.replicaCount | int }}
{{- range $index := until $replicaCount }}
{{ $name }}-{{ $clusterName }}: |
{{ $clusterName }}-{{ $name }}-{{ $index }}: |
name: {{ $clusterName }}-{{ $brokerNamePrefix }}
instanceId: {{ $brokerNamePrefix }}-{{ $index }}
bindAddress: "0.0.0.0:{{ $bindAddress.port }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ include "rocketmq-broker.fullname" . }}
spec:
replicas: {{ .Values.broker.replicaCount }}
serviceName: {{ include "rocketmq-broker.fullname" . }}
selector:
matchLabels:
{{- include "rocketmq-broker.selectorLabels" . | nindent 6 }}
podManagementPolicy: Parallel
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
Expand All @@ -34,7 +38,7 @@ spec:
imagePullPolicy: {{ $.Values.broker.image.pullPolicy }}
{{- end }}
command: [ "/bin/sh" ]
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /home/rocketmq/rocketmq-on-s3-5.1.3/conf/$(INSTANCE_NAME)-$(CLUSTER_NAME)" ]
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /home/rocketmq/rocketmq-on-s3-5.1.3/conf/$(CLUSTER_NAME)-$(POD_NAME)" ]
env:
- name: POD_NAME
valueFrom:
Expand Down

0 comments on commit 75dedfc

Please sign in to comment.