当前位置:网站首页>微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
2022-07-07 16:58:00 【InfoQ】
- 一键 Run 和 远程Debug
- 持久化配置
- 开发容器资源限制
- 端口转发
开发模式开发模式开发模式部署 Rainbond + SpringCloud
部署 Rainbond
部署 SpringCloud
Spring Cloud Pig3.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 模式。

持久化配置
依赖包日志rainbondvolumerwxstorageClass: rainbondvolumerwx
persistentVolumeDirs:
- path: /root/.m2/repository
capacity: 10Gi

容器资源限制
resources:
limits:
memory: 4096Mi
cpu: "2"
requests:
memory: 2048Mi
cpu: "1"
端口转发
portForward:
- 3999:3000 # 转发容器 3000 端口到本地 3999 端口
最后
patterngitignoreAbout Rainbond
边栏推荐
- Some key points in the analysis of spot Silver
- How to choose the appropriate automated testing tools?
- Kirk borne's selection of learning resources this week [click the title to download directly]
- 高考填志愿规则
- 微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
- Interview vipshop internship testing post, Tiktok internship testing post [true submission]
- SD_ DATA_ SEND_ SHIFT_ REGISTER
- NAT地址转换
- Redis cluster and expansion
- Five network IO models
猜你喜欢

Improve application security through nonce field of play integrity API

3. About cookies

链式二叉树的基本操作(C语言实现)

DeSci:去中心化科学是Web3.0的新趋势?

Do you know all four common cache modes?

Wireshark analyzes packet capture data * cap

Redis集群与扩展

Wireshark分析抓包数据*.cap

抢占周杰伦

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
随机推荐
SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
Creative changes brought about by the yuan universe
前首富,沉迷种田
如何给“不卖笔”的晨光估值?
线程池和单例模式以及文件操作
coming! Gaussdb (for Cassandra) new features appear
unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
学习open62541 --- [67] 添加自定义Enum并显示名字
Differences between rip and OSPF and configuration commands
小试牛刀之NunJucks模板引擎
Redis的发布与订阅
PTA 1101 B是A的多少倍
嵌入式面试题(算法部分)
Do you really understand sticky bag and half bag? 3 minutes to understand it
Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products
能同时做三个分割任务的模型,性能和效率优于MaskFormer!Meta&UIUC提出通用分割模型,性能优于任务特定模型!开源!...
[demo] circular queue and conditional lock realize the communication between goroutines
Reject policy of thread pool
10 schemes to ensure interface data security
Embedded interview questions (algorithm part)