【笔记】Helm-2 如何使用-2 同步你的仓库

同步你的仓库

注意:该示例是专门针对Google Cloud Storage(GCS)提供的chart仓库。

先决条件

安装gsutil工具。我们非常依赖gsutil rsync功能

https://cloud.google.com/storage/docs/gsutil

确保可以使用Helm程序

可选:我们推荐在您的GCS中设置 对象版本 以防不小心删除了什么。

https://cloud.google.com/storage/docs/gsutil/addlhelp/ObjectVersioningandConcurrencyControl#top_of_page

设置本地chart仓库目录

就像我们在 chart仓库指南 做的,创建一个本地目录,并将打包好的chart放在该目录中。

Helm | Chart仓库指南

例如:

$ mkdir fantastic-charts

$ mv alpine-0.1.0tgz fantastic-charts/

复制代码
$ mkdir fantastic-charts
$ mv alpine-0.1.0.tgz fantastic-charts/

生成新的index.yaml

使用Helm生成新的index.yaml文件,通过将目录路径和远程仓库url传递给helm repo index命令:

$ helm repo index fantastic-charts/ --url https://fantastic-charts.storage.googleapis.com

$ helm repo index fantastic-charts/ --url https://fantastic-charts.storage.googleapis.com

这会生成新的index.yaml文件并放在fantastic-charts/目录。

同步本地和远程仓库

使用scripts/sysnc-repo.sh命令上传GSC目录中的内容并传入本地目录名和GCS名。

例如:

$ pwd

$ scripts/sync-repo.sh fantastic-charts/ fantastic-charts

复制代码
$ pwd
/Users/me/code/go/src/helm.sh/helm
$ scripts/sync-repo.sh fantastic-charts/ fantastic-charts
Getting ready to sync your local directory (fantastic-charts/) to a remote repository at gs://fantastic-charts
Verifying Prerequisites....
Thumbs up! Looks like you have gsutil. Let's continue.
Building synchronization state...
Starting synchronization
Would copy file://fantastic-charts/alpine-0.1.0.tgz to gs://fantastic-charts/alpine-0.1.0.tgz
Would copy file://fantastic-charts/index.yaml to gs://fantastic-charts/index.yaml
Are you sure you would like to continue with these changes?? [y/N]} y
Building synchronization state...
Starting synchronization
Copying file://fantastic-charts/alpine-0.1.0.tgz [Content-Type=application/x-tar]...
Uploading   gs://fantastic-charts/alpine-0.1.0.tgz:              740 B/740 B
Copying file://fantastic-charts/index.yaml [Content-Type=application/octet-stream]...
Uploading   gs://fantastic-charts/index.yaml:                    347 B/347 B
Congratulations your remote chart repository now matches the contents of fantastic-charts/

更新您的chart仓库

您需要保留chart仓库内容的本地副本或使用gsutil rsync拷贝远程chart仓库内容到本地目录。

例如:

$ gsutil rsync -d -n gs://bucket-name local-dir/ # the -n flag does a dry run

$ gsutil rsync -d gs://bucket-name local-dir/ # performs ths copy actions

复制代码
$ gsutil rsync -d -n gs://bucket-name local-dir/    # the -n flag does a dry run
Building synchronization state...
Starting synchronization
Would copy gs://bucket-name/alpine-0.1.0.tgz to file://local-dir/alpine-0.1.0.tgz
Would copy gs://bucket-name/index.yaml to file://local-dir/index.yaml

$ gsutil rsync -d gs://bucket-name local-dir/       # performs the copy actions
Building synchronization state...
Starting synchronization
Copying gs://bucket-name/alpine-0.1.0.tgz...
Downloading file://local-dir/alpine-0.1.0.tgz:                        740 B/740 B
Copying gs://bucket-name/index.yaml...
Downloading file://local-dir/index.yaml:                              346 B/346 B

帮助链接

gsutil rsync文档

https://cloud.google.com/storage/docs/gsutil/commands/rsync#description

Chart仓库指南

Helm | Chart仓库指南

Google Cloud Storage的 对象版本控制和并发控制

https://cloud.google.com/storage/docs/gsutil/addlhelp/ObjectVersioningandConcurrencyControl#overview


仅用于本人学习

来源:Helm | Docs

相关推荐
牛奶咖啡135 小时前
k8s容器编排技术实践——使用containerd作为容器运行时部署k8s集群
kubernetes·k8s的安装部署·开启系统的ipvs支持·安装containerd·containerd配置加速器·安装k8s的工具·安装calico网络插件
万里侯6 小时前
云原生数据备份与恢复:保障数据安全的最佳实践
微服务·容器·k8s
阿里云云原生6 小时前
阿里云 STAROps 全域智能运维平台发布!从“被动救火”到“主动自治”
云原生
2301_780789667 小时前
手游遇到攻击为什么要用SDK游戏盾手游遇到攻击为什么要用 SDK 游戏盾?
安全·web安全·游戏·架构·kubernetes·ddos
35岁程序员的自救之路7 小时前
AiBBS - 面向下一个十年的AI + 云原生社区系统
人工智能·云原生
珂玥c8 小时前
k8s集群ingress碎碎念
云原生·容器·kubernetes
佳杰云星8 小时前
如何给大模型集群选“大脑”?智算调度与管理平台 10 维选型指南(附选型评分表)
人工智能·kubernetes·大模型·云计算·gpu·算力调度·智算中心
比特森林探险记10 小时前
context 在 gRPC / Gin / K8s 中的实战
容器·kubernetes·gin
汪汪大队u11 小时前
基于 K8s 的物联网平台运维体系:Ansible+Zabbix 自动化监控与故障自愈(三)—— Zabbix Server 启动排错记
运维·kubernetes·ansible
平行云12 小时前
实时云渲染平台数据通道,支持3D应用文件上传下载分享无缝交互
linux·unity·云原生·ue5·gpu算力·实时云渲染·像素流送