当前位置:网站首页>微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
2022-07-07 16:58:00 【InfoQ】
- 一键 Run 和 远程Debug
- 持久化配置
- 开发容器资源限制
- 端口转发
开发模式
开发模式
开发模式
部署 Rainbond + SpringCloud
部署 Rainbond
部署 SpringCloud
Spring Cloud Pig
3.5.0
Nocalhost 对接 Rainbond
- 安装 Nocalhost JetBrains Plugin 插件,请参阅文档安装Nocalhost JetBrains Plugin 插件。
- 获取 K8s Kubeconfig,请参阅文档获取 Kubeconfig 文件。
- 在
pig
命名空间下,找到工作负载pig-auth
右击并选择Dev Config
(开发配置)
- 将以下配置文件复制到
Dev Config
中。
# Deployment Name
name: pig-auth
serviceType: deployment
containers:
# Deployment 主容器名称
- name: auth
dev:
# 开发镜像,该镜像包含了 Java Maven 环境
image: registry.cn-hangzhou.aliyuncs.com/zqqq/maven:3.8.6-openjdk-8
# 默认终端为 bash
shell: bash
# Rainbond 提供的 StorageClass Name
storageClass: rainbondvolumerwx
# 配置开发容器资源
resources:
limits:
memory: 4096Mi
cpu: "2"
requests:
memory: 2048Mi
cpu: "1"
persistentVolumeDirs:
# Maven 依赖包缓存路径,配合 storageClass 一起食用
- path: /root/.m2/repository
capacity: 10Gi
command:
# 一键启动命令,安装依赖包和启动 pig-auth 子模块
run:
- mvn
- install
- '&&'
- mvn
- spring-boot:run
- -pl
# 指定子模块启动
- pig-auth
# 一键 Debug 命令,安装依赖包和 Debug pig-auth 子模块
debug:
- mvn
- install
- '&&'
- mvn
- spring-boot:run
- -pl
# 指定子模块启动
- pig-auth
# Java Debug 命令
- -Dspring-boot.run.jvmArguments=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
debug:
# 远程端口,对应Debug命令中的 address=5005
remoteDebugPort: 5005
# 选择 Java 语言
language: java
# 热加载
hotReload: true
# 文件同步
sync:
type: send
mode: gitIgnore
deleteProtection: true
# 端口转发,转发容器内的3000端口到本地3999
portForward:
- 3999:3000
一键 Run
- 右击工作负载
pig-auth
。
- 选择 Remote Run。
- Nocalhost 会自动进入 DevMode 并执行 Remote Run。
一键 Debug
- 右击工作负载
pig-auth
。
- 选择 Remote Debug。
- Nocalhost 会自动进入 DevMode 并执行 Remote Debug。
- 在代码中打上断点,发起请求,进入 IDE Debug 模式。
持久化配置
依赖包
日志
rainbondvolumerwx
storageClass: rainbondvolumerwx
persistentVolumeDirs:
- path: /root/.m2/repository
capacity: 10Gi
容器资源限制
resources:
limits:
memory: 4096Mi
cpu: "2"
requests:
memory: 2048Mi
cpu: "1"
端口转发
portForward:
- 3999:3000 # 转发容器 3000 端口到本地 3999 端口
最后
pattern
gitignore
About Rainbond
边栏推荐
- 微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
- sqlite sql 异常 near “with“: syntax error
- The moveposition function of rigidbody2d of unity2d solves the problem of people or screen jitter when moving
- Calculation of torque target value (ftorque) in servo torque control mode
- Improve application security through nonce field of play integrity API
- PTA 1102 教超冠军卷
- Rules for filling in volunteers for college entrance examination
- Wireshark analyzes packet capture data * cap
- Reuse of data validation framework Apache bval
- 数据验证框架 Apache BVal 再使用
猜你喜欢
Simple configuration of single arm routing and layer 3 switching
Tsinghua, Cambridge and UIC jointly launched the first Chinese fact verification data set: evidence-based, covering many fields such as medical society
【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的
Wireshark analyzes packet capture data * cap
[论文分享] Where’s Crypto?
Three forms of multimedia technology commonly used in enterprise exhibition hall design
强化学习-学习笔记8 | Q-learning
Charles+Postern的APP抓包
In 2021, the national average salary was released. Have you reached the standard?
GSAP animation library
随机推荐
NAT地址转换
企业展厅设计中常用的三种多媒体技术形式
【Base64笔记】「建议收藏」
99% of people don't know that privatized deployment is also a permanently free instant messaging software!
Recommend free online SMS receiving platform in 2022 (domestic and foreign)
Kirk borne's selection of learning resources this week [click the title to download directly]
Basic concepts and properties of binary tree
PTA 1101 B是A的多少倍
Will domestic software testing be biased
如何给“不卖笔”的晨光估值?
Antisamy: a solution against XSS attack tutorial
嵌入式面试题(算法部分)
How many times is PTA 1101 B than a
Wireshark分析抓包数据*.cap
小试牛刀之NunJucks模板引擎
Golang client server login
The performance and efficiency of the model that can do three segmentation tasks at the same time is better than maskformer! Meta & UIUC proposes a general segmentation model with better performance t
线程池和单例模式以及文件操作
前首富,沉迷种田
Do you know all four common cache modes?