Skip to content

Commit

Permalink
[ISSUE #73] Support mounting a configMap to rocketmq dashboard (#182)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Sep 25, 2023
1 parent dd4ec64 commit f2d0706
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
64 changes: 63 additions & 1 deletion example/rocketmq_v1alpha1_console_cr.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
- containerPort: 8080
volumeMounts:
- mountPath: "/apps/data/console/config"
name: console-config
volumes:
- name: console-config
configMap:
name: console-config
3 changes: 3 additions & 0 deletions pkg/controller/console/console_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
Expand Down

0 comments on commit f2d0706

Please sign in to comment.