devstar部署文档
repo.diff.bin
docs/devstar-deploy/asset/image-20251104201036920.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 15 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104201132614.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 14 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104203152647.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 56 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104203353406.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 56 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104203454915.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 55 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104203757243.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 51 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104204421088.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 7.9 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104204424116.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 7.9 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104204453766.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 128 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104221729545.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 15 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104221749140.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 41 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104221811555.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 107 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104221928154.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 29 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104221950856.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 7.5 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104221953043.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 7.5 KiB |
repo.diff.bin
docs/devstar-deploy/asset/image-20251104222023293.png
Normal file
|
repo.diff.file_after repo.diff.file_image_width: | repo.diff.file_image_height: | repo.diff.file_byte_size: 21 KiB |
124
docs/devstar-deploy/devstar_deploy.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# Devstar 部署文档
|
||||
|
||||
## 1. 安装 Helm
|
||||
|
||||
在开始部署前,请先安装 Helm。建议使用官方提供的安装脚本,具体步骤可参考:安装 Helm | Helm。
|
||||
|
||||
推荐使用 `get_helm.sh`脚本进行安装,执行如下命令:
|
||||
|
||||
```
|
||||
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
|
||||
chmod 700 get_helm.sh
|
||||
./get_helm.sh
|
||||
```
|
||||
|
||||
## 2. 获取并准备部署文件
|
||||
|
||||
在待部署的机器上新建一个目录,然后将 DevStar 的 Helm Chart 仓库克隆到该目录中。请注意,该仓库为私有仓库,需先获取访问权限。
|
||||
|
||||
如部署目标为 `devstar.cn`,请确保切换到对应的分支(如图所示):
|
||||
|
||||

|
||||
|
||||
将代码仓库克隆到本地后,目录中应包含以下四个脚本文件:
|
||||
|
||||

|
||||
|
||||
## 3. 首次安装
|
||||
|
||||
执行 `step1-install-helm.sh`脚本进行首次安装。安装时间取决于网络状况和镜像拉取速度,请耐心等待。
|
||||
|
||||
安装完成后,使用以下命令检查 Pod 状态:
|
||||
|
||||
```
|
||||
kubectl get pods -n devstar-studio-ns
|
||||
```
|
||||
|
||||
如发现 Pod 状态异常,可使用如下命令排查:
|
||||
|
||||
- 查看 Pod 日志:
|
||||
|
||||
```
|
||||
kubectl logs -n devstar-studio-ns <pod名称>
|
||||
```
|
||||
|
||||
- 查看 Pod 详细信息:
|
||||
|
||||
```
|
||||
kubectl describe pod -n devstar-studio-ns <pod名称>
|
||||
```
|
||||
|
||||
首次安装时,Pod 可能处于 `Pending`状态,通常是由于 PVC(PersistentVolumeClaim)未绑定到对应的 PV(PersistentVolume)所致。请检查 PV 与 PVC 的状态:
|
||||
|
||||
```
|
||||
kubectl get pv -A
|
||||
kubectl get pvc -A
|
||||
```
|
||||
|
||||

|
||||
|
||||
如发现有 PVC 处于 `Pending`状态,请手动创建并绑定对应的 PV。以下为 PV 的示例 YAML 配置,请根据实际情况修改相应字段:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: node2-local-pv-gitea # 请根据实际情况修改名称
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: local
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
local:
|
||||
path: /mnt/datadisk/devstar/gitea-storage # 修改为实际存储路径
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- node2 # 修改为实际节点名称
|
||||
volumeMode: Filesystem
|
||||
claimRef:
|
||||
name: gitea-shared-storage-claim
|
||||
namespace: devstar-studio-ns
|
||||
```
|
||||
|
||||
使用以下命令应用 PV 配置:
|
||||
|
||||
```
|
||||
kubectl apply -f <yaml文件名>
|
||||
```
|
||||
|
||||
## 4. 域名解析与证书配置
|
||||
|
||||
如部署环境为公网可访问(如 `devstar.cn`),请在腾讯云(或其他域名服务商)控制台中配置域名解析,并申请及配置 HTTPS 证书。具体操作请参考相关证书配置文档。
|
||||
|
||||
## 5. 更新部署
|
||||
|
||||
若修改了 `values.yaml`文件,请执行 `step2-upgrade-helm.sh`脚本进行更新。更新完成后,会看到类似如下提示:
|
||||
|
||||

|
||||
|
||||
更新后请再次检查 Pod 状态:
|
||||
|
||||
```
|
||||
kubectl get pods -n devstar-studio-ns
|
||||
```
|
||||
|
||||
## 6. 验证部署版本
|
||||
|
||||
您可以通过以下两种方式确认 DevStar 的版本是否更新成功:
|
||||
|
||||
1. **在 DevStar 主界面查看**登录系统后,可在主界面右下角查看当前版本号。
|
||||
|
||||

|
||||
|
||||
2. **在流水线页面查看**进入“工作流”→“流水线”,在如图所示位置也可查看版本信息:
|
||||
|
||||

|
||||
|
||||
通过比对版本号,即可确认系统是否已成功更新至目标版本。
|
||||