当前位置:网站首页>Zadig 正式推出 VS Code 插件,本地开发更高效
Zadig 正式推出 VS Code 插件,本地开发更高效
2022-06-28 21:46:00 【InfoQ】
- Zadig 环境查看
- 微服务重启、服务镜像更换、服务详情查看、Pod 实时日志查看、登录到服务实例 Pod
- 远程调试本地应用程序、配置远程开发环境
准备工作
- 系统准备:安装 Zadig v1.12.0 版本
- 项目准备:参考如何使用 GitHub + Zadig 实现产品级持续交付
安装插件
- 打开 Visual Studio Code 并进入应用市场。
- 在应用市场中搜索 「Zadig Toolkit」,查看详情并安装。

配置插件
- 打开已安装的 Zadig Toolkit 插件。
- 点击“设置”进入插件配置页。


- Zadig 部署地址:请根据实际协议,填写完整的 URI,例如:http://zadig.com。
- Zadig API Token:进入 Zadig 系统,点击
账号设置后获取,如下图所示。


如何使用
远程调试本地代码
voting-demo- 选择
voting-demo项目 ->dev环境,点击环境右侧图标设置 Kube Config,可在文件目录中选择该配置文件或手动输入其路径后回车。

- 选择
vote服务,点击调试按钮进入开发模式。

- 选择本地开发代码目录,本例中为koderover/zadig-> examples -> voting-app。


- 选择开发环境使用的基础镜像
python:3.10.4-buster。


- 稍等片刻待开发模式启动执行完毕后,进入开发容器
dev,所选目录中内容将自动同步到开发容器中。


- 修改本地代码并保存:修改第一个投票按钮的背景颜色。

- 改动的代码会自动同步到远端
dev开发环境。在终端中进入vote目录,执行启动命令。
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
gunicorn app:app -b 0.0.0.0:80 --log-file - --access-logfile - --workers 4 --keep-alive 0

- 访问 vote 服务地址,修改结果如下图所示。

- 点击红色按钮,确定结束开发模式,容器恢复正常。


查看环境和服务
- 右键点击服务可查看服务详情,在服务详情页面中可查看服务实时日志,点击镜像右侧的修改图标可修改服务镜像。

- 右键点击服务后,点击
重启服务可以对服务进行重启。

- 右键点击服务,点击
终端可登录到服务对应的 Pod 中。

配置远程开发环境
- 需要修改开发环境的基础镜像,或者修改同步的本地代码目录时,可通过点击
开发模式配置按钮快速设置。
[
{
"projectName": 项目名称,
"envName": 环境名称,
"serviceName": 服务名称,
"containerName": 开发环境容器名称,
"image": 开发环境基础镜像,
"codeDir": 同步至开发环境容器中的本地目录
}
]
- 保存自定义的开发模式配置后,点击
启动开发模式,会基于配置文件中的信息快速启动开发模式。

边栏推荐
猜你喜欢

零基础自学SQL课程 | SQL中的日期函数大全
![Sword finger offer:[day 2 linked list (simple)] --- > reverse linked list](/img/05/0d7ed95f83c2188d274dde84817dc3.jpg)
Sword finger offer:[day 2 linked list (simple)] --- > reverse linked list
![Sword finger offer:[day 1 stack and queue (simple)] --- > stack containing min function](/img/16/2edfc478a56e5b5e7299621ac778c2.jpg)
Sword finger offer:[day 1 stack and queue (simple)] --- > stack containing min function

Live broadcast preview | can SQL also play industrial machine learning? Mlops meetup V3 takes you to the bottom!

How do independent site sellers efficiently manage complex Facebook pages?

如何制作精美的图片

BOE was brilliant for the Winter Olympics, but revealed another Chinese technology enterprise dominating the world

After reading the list of global patent and chip buyers, I understand that high innovation can lead to high profits

科技巨头成立元宇宙标准论坛,走向开放还是建立围城?

Microsoft's exclusive payment function has also been perfectly unlocked
随机推荐
Live broadcast preview | can SQL also play industrial machine learning? Mlops meetup V3 takes you to the bottom!
BOE was brilliant for the Winter Olympics, but revealed another Chinese technology enterprise dominating the world
Security dilemma of NFT liquidity agreement - Analysis of the hacked event of NFT loan agreement xcarnival
用指针计算数组的个数
The rogue downloader named by 315 is back
Move the mouse out of the selected area style cancel
PAT 1021. Traversal of the deep root (25 points) graph, DFS, calculating the number of connected components
Multinomial distribution (a discrete distribution)
Ctrip will push the "3+2" working mode: 3 days a week on duty and 2 days of free choice of office space. Do you envy it?
Is it safe to open an account on great wisdom
Survival of beaver: post-90s female doctors and AI developers
apipost脚本使用讲解一~全局变量
Hyperjumptech/grule-rule-engine: rule engine implementation of golang
華為雲的AI深潜之旅
Smarca2 antibody study: abnova smarca2 monoclonal antibody protocol
CORBA Architecture Guide (Common Object Request Broker Architecture)
Akamai acquires linode
阿海的忠告
Appium automated test Jiugongge unlock
QT how the coordinates of one control are relatively fixed and displayed on another control (coordinate system)