-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cluster.yaml to support kubeblock
Signed-off-by: wangxye <[email protected]>
- Loading branch information
Showing
4 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ClusterDefinition | ||
metadata: | ||
name: {{ .Release.Name }} | ||
labels: | ||
{{- include "rocketmq-broker.selectorLabels" . | nindent 8 }} | ||
spec: | ||
type: rocketmq-on-s3 | ||
componentDefs: | ||
- name: rocketmq-on-s3 | ||
description: |- | ||
Rocketmq broker that act as both brokers and controllers are referred to as "combined" servers. | ||
workloadType: Stateful # Consensus | ||
characterType: rocketmq-broker | ||
probes: | ||
monitor: | ||
configSpecs: | ||
{{/* - name: broker-config*/}} | ||
{{/* configMap:*/}} | ||
{{/* name: broker-conf*/}} | ||
{{/* - name: broker-storage*/}} | ||
{{/* hostPath:*/}} | ||
{{/* path: /root/logs/rocketmqlogs*/}} | ||
{{/* type: DirectoryOrCreate*/}} | ||
scriptSpecs: | ||
service: | ||
ports: | ||
- name: rocketmq-broker | ||
targetPort: rocketmq-broker | ||
port: 8081 | ||
podSpec: | ||
securityContext: | ||
fsGroup: 1001 | ||
containers: | ||
- name: rocketmq | ||
command: [ "/bin/sh" ] | ||
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /home/rocketmq/rocketmq-on-s3-5.1.3/conf/broker/$(CLUSTER_NAME)-$(POD_NAME)" ] | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: CLUSTER_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.labels['app.kubernetes.io/cluster'] | ||
- name: INSTANCE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.labels['app.kubernetes.io/name'] | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: BROKER_MEM | ||
value: {{ .Values.broker.jvmMemory }} | ||
ports: | ||
- name: rocketmq-broker | ||
containerPort: 8081 | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
initialDelaySeconds: 60 | ||
periodSeconds: 15 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: rocketmq-broker | ||
timeoutSeconds: 1 | ||
livenessProbe: | ||
failureThreshold: 3 | ||
initialDelaySeconds: 60 | ||
periodSeconds: 15 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
tcpSocket: | ||
port: rocketmq-broker | ||
startupProbe: | ||
failureThreshold: 30 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
tcpSocket: | ||
port: rocketmq-broker | ||
volumeMounts: | ||
- mountPath: /home/rocketmq/rocketmq-on-s3-5.1.3/conf/broker | ||
name: broker-config | ||
- mountPath: /root/logs/rocketmqlogs | ||
name: broker-storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ClusterVersion | ||
metadata: | ||
name: {{ include "rocketmq-broker.fullname" . }}-{{ default .Chart.AppVersion .Values.clusterVersionOverride }} | ||
labels: | ||
{{- include "rocketmq-broker.selectorLabels" . | nindent 8 }} | ||
spec: | ||
clusterDefinitionRef: {{ .Release.Name }} | ||
componentVersions: | ||
- componentDefRef: rocketmq-on-s3 | ||
versionsContext: | ||
containers: | ||
- name: rocketmq-on-s3 | ||
image: {{ .Values.broker.image.repository }}:{{ .Values.broker.image.tag | default .Chart.AppVersion }} | ||
imagePullPolicy: {{ default "IfNotPresent" .Values.broker.image.pullPolicy }} | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
runAsNonRoot: true | ||
runAsUser: 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters