Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[ISSUE #73] Support mounting a configMap to rocketmq dashboard #182

Merged
merged 7 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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