k8s

Helm命令

axing
2025-07-27 / 0 评论 / 3 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2025年07月28日,已超过27天没有更新,若内容或图片失效,请留言反馈。

一、升级Helm版本

root@k8s01:~/helm/harbor# helm list -A
NAME                               NAMESPACE          REVISION    UPDATED                                    STATUS      CHART                                     APP VERSION
ceph-csi-cephfs                    ceph-csi-cephfs    1           2025-05-26 18:32:41.809322395 +0000 UTC    deployed    ceph-csi-rbd-3-canary                     canary     
ceph-csi-rbd                       ceph-csi-rbd       1           2025-05-26 18:26:58.557977154 +0000 UTC    deployed    ceph-csi-cephfs-3-canary                  canary     
harbor                             harbor             2           2025-07-27 06:12:45.385163599 +0000 UTC    deployed    harbor-1.17.0                             2.13.0     
nfs-subdir-external-provisioner    kube-system        1           2025-06-15 10:31:25.632197317 +0000 UTC    deployed    nfs-subdir-external-provisioner-4.0.18    4.0.2      
traefik-crds                       traefik            2           2025-06-05 14:35:34.23815576 +0000 UTC     deployed    traefik-35.4.0                            v3.4.0     
root@k8s01:~/helm/harbor #
root@k8s01:~/helm/harbor #
root@k8s01:~/helm/harbor # helm upgrade harbor . -f values.yaml -n harbor
发布“港口”已升级。祝您掌舵愉快!
名称:港口
最后部署时间:2025年7月27日 星期日 06:12:45
所属空间: 港口
状态:已部署
修订:2
测试套件:无
笔记:
请等待完成港口部署。
然后你应该能够访问 Harbor 门户 https://192.168.3.200:30003
更多详情请访问 https://github.com/goharbor/harbor
root@k8s01:~/helm/harbor #

二、升级操作建议

# 确认在正确的目录
cd ~/helm/harbor

# 执行升级(使用正确的命名空间)
helm upgrade harbor . -f values.yaml -n harbor

三、升级后验证

#查看升级状态
root@k8s01:~/helm/harbor# helm history harbor -n harbor
REVISION    UPDATED                     STATUS        CHART            APP VERSION    DESCRIPTION     
1           Tue May 27 15:33:51 2025    superseded    harbor-1.17.0    2.13.0         Install complete
2           Sun Jul 27 06:12:45 2025    deployed      harbor-1.17.0    2.13.0         Upgrade complete

#如果想回滚之前的版本
helm rollback harbor 1 -n harbor
- rollback:回滚命令
- harbor:Release 名称
- 1:目标 Revision 号
- -n harbor:指定命名空间

# 查看 Pod 状态
kubectl get pods -n harbor -w

# 检查Service的NodePort
kubectl get svc -n harbor | grep  NodePort
0

评论 (0)

取消