Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(distribution): refactor helm chart #777

Merged
merged 5 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,13 @@ app.kubernetes.io/cluster: {{ include "rocketmq-broker.clusterName" . }}
{{- end }}

{{- define "rocketmq-broker.clusterName" -}}
{{- if .Values.broker.conf.clusterNameOverride }}
{{- .Values.broker.conf.clusterNameOverride | trunc 63 | trimSuffix "-" }}
{{- if .Values.broker.clusterNameOverride }}
{{- .Values.broker.clusterNameOverride | trunc 63 | trimSuffix "-" }}
{{- else -}}
{{ .Release.Name }}
{{- end }}
{{- end }}

{{- define "rocketmq-broker.brokerNamePrefix" -}}
{{- if .Values.broker.conf.brokerNamePrefixOverride }}
{{- .Values.broker.conf.brokerNamePrefixOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- include "rocketmq-broker.fullname" . }}
{{- end }}
{{- end }}

{{- define "rocketmq-broker.brokerImage" -}}
{{ .Values.broker.image.repository }}:{{ .Values.broker.image.tag | default .Chart.AppVersion }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,52 @@ metadata:
labels:
{{- include "rocketmq-broker.labels" . | nindent 4 }}
data:
{{- include "rocketmq-broker.config" . }}
broker.conf: |
wangxye marked this conversation as resolved.
Show resolved Hide resolved
instanceId: "{{- include "rocketmq-broker.clusterName" . }}"
bindAddress: 0.0.0.0:8081

innerAccessKey: ""
innerSecretKey: ""

s3Stream:
s3WALPath: "/root/logs/wal"
s3Endpoint: "{{- if .Values.localstack.enabled }}http://{{ .Release.Name }}-localstack:4566{{- else }}{{- .Values.broker.storage.s3.endpoint }}{{- end }}"
s3Bucket: "{{ .Values.broker.storage.s3.bucket }}"
s3Region: "{{ .Values.broker.storage.s3.region }}"
s3ForcePathStyle: {{ .Values.broker.storage.s3.forcePathStyle }}
s3AccessKey: "{{ .Values.broker.storage.s3.accessKey }}"
s3SecretKey: "{{ .Values.broker.storage.s3.secretKey }}"
networkBaselineBandwidth: {{ int .Values.broker.storage.s3.networkBaselineBandwidth }}
refillPeriodMs: {{ .Values.broker.storage.s3.refillPeriodMs }}

db:
url: "{{- if .Values.mysql.enabled }}jdbc:mysql://{{ .Release.Name }}-mysql:3306/{{ .Values.mysql.auth.database }}{{- else }}{{- .Values.broker.db.url }}{{- end }}"
userName: "{{ .Values.broker.db.userName }}"
password: "{{ .Values.broker.db.password }}"

store:
kvPath: "/root/logs/kvstore"

controller:
recycleS3IntervalInSecs: 360
dumpHeapOnError: true

{{- if .Values.broker.metrics.enabled }}
metrics:
exporterType: "OTLP_GRPC"
grpcExporterTarget: "http://localhost:4317"
grpcExporterHeader: ""
grpcExporterTimeOutInMills: 31000
periodicExporterIntervalInMills: 30000
promExporterPort: 5557
promExporterHost: "localhost"
labels: ""
exportInDelta: false
{{- else }}
metrics:
exporterType: "DISABLE"
{{- end }}


---
{{- if .Values.mysql.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ spec:
imagePullPolicy: {{ $.Values.broker.image.pullPolicy }}
{{- end }}
command: [ "/bin/sh" ]
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /home/rocketmq/automq-for-rocketmq/conf/broker/$(POD_NAME)" ]
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /etc/automq-for-rocketmq/broker.conf" ]
env:
- name: ROCKETMQ_NODE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAME
valueFrom:
fieldRef:
Expand All @@ -56,35 +60,35 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: BROKER_MEM
value: {{ .Values.broker.jvmMemory }}
ports:
- name: broker
containerPort: {{ .Values.broker.service.port }}
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 15
failureThreshold: 10
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
tcpSocket:
port: {{ .Values.broker.service.port }}
timeoutSeconds: 1
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 15
failureThreshold: 10
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
tcpSocket:
port: {{ .Values.broker.service.port }}
timeoutSeconds: 1
resources:
{{- toYaml .Values.broker.resources | nindent 12 }}
volumeMounts:
- mountPath: /home/rocketmq/automq-for-rocketmq/conf/broker
- mountPath: /etc/automq-for-rocketmq
name: broker-config
- mountPath: /root/logs/rocketmqlogs
{{- if .Values.broker.storage.local.persistence.enabled }}
- mountPath: /root/logs
name: broker-storage
{{- end }}
{{- with .Values.broker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -93,7 +97,17 @@ spec:
- name: broker-config
configMap:
name: broker-conf
- name: broker-storage
hostPath:
path: /root/logs/rocketmqlogs
type: DirectoryOrCreate
{{- if .Values.broker.storage.local.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: broker-storage
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.broker.storage.local.persistence.storageClass }}
storageClassName: {{ .Values.broker.storage.local.persistence.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.broker.storage.local.persistence.size }}
{{- end }}
74 changes: 32 additions & 42 deletions distribution/helm/charts/automq-for-rocketmq/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,55 +24,36 @@ broker:
repository: "automqinc/automq-for-rocketmq"
tag: "v0.0.3-alpha"

persistence:
db:
ShadowySpirits marked this conversation as resolved.
Show resolved Hide resolved
url: ""
userName: "root"
password: "automq"

storage:
local:
persistence:
enabled: true
storageClass: ""
size: 10Gi
s3:
endpoint: ""
bucket: "automq-for-rocketmq"
region: "eu-west-2"
forcePathStyle: true
accessKey: "access-key"
secretKey: "secret-key"
networkBaselineBandwidth: 5242880
refillPeriodMs: 100

metrics:
enabled: false
size: 8Gi

fullnameOverride: ""

conf:
name: ""
clusterNameOverride: ""
brokerNamePrefixOverride: ""

inner:
accessKey: "automq"
secretKey: "rocketmq"

s3Stream:
s3WALPath: "/root/logs/rocketmqlogs/s3rocketmq/wal"
s3Endpoint: "http://automq-for-rocketmq-localstack:4566"
s3Bucket: "automq-for-rocketmq"
s3Region: "eu-west-2"
s3ForcePathStyle: true
s3AccessKey: "access-key"
s3SecretKey: "secret-key"
networkBaselineBandwidth: 5242880
refillPeriodMs: 100
db:
url: "jdbc:mysql://automq-for-rocketmq-mysql:3306/metadata"
userName: "root"
password: "automq"
store:
kvPath: "/root/logs/rocketmqlogs/s3rocketmq/kvstore"
controller:
recycleS3IntervalInSecs: 360
dumpHeapOnError: true
metrics:
exporterType: "OTLP_GRPC"
grpcExporterTarget: "http://localhost:4317"
grpcExporterHeader: ""
grpcExporterTimeOutInMills: 31000
periodicExporterIntervalInMills: 30000
promExporterPort: 5557
promExporterHost: "localhost"
labels: ""
exportInDelta: false
clusterNameOverride: ""

service:
port: 8081

jvmMemory: " -Xms4g -Xmx4g -Xmn2g -XX:MaxDirectMemorySize=8g "
resources:
limits:
cpu: 4
Expand Down Expand Up @@ -106,11 +87,20 @@ mysql:
- name: init
configMap:
name: mysql-initdb-config
persistence:
enabled: true
storageClass: ""
size: 10Gi

localstack:
enabled: true
enableStartupScripts: true

persistence:
enabled: true
storageClass: ""
size: 10Gi

service:
type: ClusterIP

Expand Down