This is an automated email from the ASF dual-hosted git repository.
caigy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-operator.git
The following commit(s) were added to refs/heads/master by this push:
new f2d0706 [ISSUE #73] Support mounting a configMap to rocketmq
dashboard (#182)
f2d0706 is described below
commit f2d0706a4cf6eb3438f036b710d3863adfd3580c
Author: yangw <[email protected]>
AuthorDate: Mon Sep 25 21:03:02 2023 +0800
[ISSUE #73] Support mounting a configMap to rocketmq dashboard (#182)
* support mounting a configMap to rocketmq-dashboard
* prepare for v0.4.0 development
* support mounting a configMap to rocketmq-dashboard
* support mounting a configMap to rocketmq-dashboard
* format example file
---------
Co-authored-by: shendong <[email protected]>
Co-authored-by: caigy <[email protected]>
---
example/rocketmq_v1alpha1_console_cr.yaml | 64 +++++++++++++++++++++++++++-
pkg/controller/console/console_controller.go | 3 ++
2 files changed, 66 insertions(+), 1 deletion(-)
diff --git a/example/rocketmq_v1alpha1_console_cr.yaml
b/example/rocketmq_v1alpha1_console_cr.yaml
index 3761ac9..b322c30 100644
--- a/example/rocketmq_v1alpha1_console_cr.yaml
+++ b/example/rocketmq_v1alpha1_console_cr.yaml
@@ -1,3 +1,57 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: console-config
+data:
+ application.yml: |
+ server:
+ port: 8080
+ servlet:
+ encoding:
+ charset: UTF-8
+ enabled: true
+ force: true
+ spring:
+ application:
+ name: rocketmq-dashboard
+ logging:
+ config: classpath:logback.xml
+ rocketmq:
+ config:
+ isVIPChannel:
+ timeoutMillis:
+ dataPath: /tmp/rocketmq-console/data
+ enableDashBoardCollect: true
+ msgTrackTopicName:
+ ticketKey: ticket
+ loginRequired: false
+ useTLS: false
+ threadpool:
+ config:
+ coreSize: 10
+ maxSize: 10
+ keepAliveTime: 3000
+ queueSize: 5000
+ role-permission.yml: |
+ rolePerms:
+ ordinary:
+ - /rocketmq/*.query
+ - /ops/*.query
+ - /dashboard/*.query
+ - /topic/*.query
+ - /topic/sendTopicMessage.do
+ - /producer/*.query
+ - /message/*.query
+ - /messageTrace/*.query
+ - /monitor/*.query
+ - /consumer/*.query
+ - /cluster/*.query
+ - /dlqMessage/*.query
+ - /dlqMessage/exportDlqMessage.do
+ - /dlqMessage/batchResendDlqMessage.do
+ - /acl/*.query
+---
+
apiVersion: rocketmq.apache.org/v1alpha1
kind: Console
metadata:
@@ -26,5 +80,13 @@ spec:
containers:
- name: console
image: apacherocketmq/rocketmq-console:2.0.0
+ args: ["--spring.config.location=/apps/data/console/config/"]
ports:
- - containerPort: 8080
\ No newline at end of file
+ - containerPort: 8080
+ volumeMounts:
+ - mountPath: "/apps/data/console/config"
+ name: console-config
+ volumes:
+ - name: console-config
+ configMap:
+ name: console-config
\ No newline at end of file
diff --git a/pkg/controller/console/console_controller.go
b/pkg/controller/console/console_controller.go
index c5f323d..63c3fe3 100644
--- a/pkg/controller/console/console_controller.go
+++ b/pkg/controller/console/console_controller.go
@@ -207,11 +207,14 @@ func newDeploymentForCR(cr *rocketmqv1alpha1.Console)
*appsv1.Deployment {
Containers: []corev1.Container{{
Resources:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Resources,
Image:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Image,
+ Args:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Args,
Name:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Name,
ImagePullPolicy:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy,
Env:
append(cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Env, env),
Ports:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Ports,
+ VolumeMounts:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].VolumeMounts,
}},
+ Volumes:
cr.Spec.ConsoleDeployment.Spec.Template.Spec.Volumes,
},
},
},