当前位置:网站首页>微服务远程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
边栏推荐
- 3. About cookies
- 2022年推荐免费在线接收短信平台(国内、国外)
- 面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
- [C language] string function
- 2022-07-04 matlab reads video frames and saves them
- 10 schemes to ensure interface data security
- 如何选择合适的自动化测试工具?
- [sword finger offer] 59 - I. maximum value of sliding window
- idea彻底卸载安装及配置笔记
- Learn open62541 -- [67] add custom enum and display name
猜你喜欢
Basic operation of chain binary tree (implemented in C language)
The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
[Blue Bridge Cup training 100 questions] sort scratch from small to large. Blue Bridge Cup scratch competition special prediction programming question centralized training simulation exercise question
10 schemes to ensure interface data security
Three forms of multimedia technology commonly used in enterprise exhibition hall design
A few simple steps to teach you how to see the K-line diagram
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
RIP和OSPF的区别和配置命令
Kubernetes DevOps CD工具对比选型
持续测试(CT)实战经验分享
随机推荐
【塔望方法论】塔望3W消费战略 - U&A研究法
IP netns command (memo)
99% of people don't know that privatized deployment is also a permanently free instant messaging software!
testing and SQA_动态白盒測试[通俗易懂]
如何选择合适的自动化测试工具?
gsap动画库
Wireshark analyzes packet capture data * cap
Wireshark分析抓包数据*.cap
In 2021, the national average salary was released. Have you reached the standard?
Redis publishing and subscription
咋吃都不胖的朋友,Nature告诉你原因:是基因突变了
數據驗證框架 Apache BVal 再使用
SD_ DATA_ SEND_ SHIFT_ REGISTER
Kirk borne's selection of learning resources this week [click the title to download directly]
Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
Calculation of torque target value (ftorque) in servo torque control mode
How much does it cost to develop a small program mall?
unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
Usage of PHP interview questions foreach ($arr as $value) and foreach ($arr as $value)
初识缓存以及ehcache初体验「建议收藏」