helm 命令学习
helm 命令学习
# helm search
helm search 是一个强大的搜索命令,可以根据关键字从两种源中搜索,其采用字符串模糊匹配算法,只需输入部分名子即可搜索。
命令 | 用途 | 备注 |
---|---|---|
helm search hub | 从 Artifact Hub 中搜索 | 需联网使用 |
helm repo hub | 从本地repo(通过 helm repo add 命令添加)中搜索 | 无需联网使用 |
# helm install
helm install 用来将 Charts 安装到 kubernetes 集群中,每次安装都会生成一个 release,通过 helm list 命令可以查看当前所有的 release.
helm install 执行时会按顺序安装如下资源:
- Namespace
- NetworkPolicy
- ResourceQuota
- LimitRange
- PodSecurityPolicy
- PodDisruptionBudget
- ServiceAccount
- Secret
- SecretList
- ConfigMap
- StorageClass
- PersistentVolume
- PersistentVolumeClaim
- CustomResourceDefinition
- ClusterRole
- ClusterRoleList
- ClusterRoleBinding
- ClusterRoleBindingList
- Role
- RoleList
- RoleBinding
- RoleBindingList
- Service
- DaemonSet
- Pod
- ReplicationController
- ReplicaSet
- Deployment
- HorizontalPodAutoscaler
- StatefulSet
- Job
- CronJob
- Ingress
- APIService
helm install 是一个异步过程,他不会等待所有资源都安装成功才退出,可以使用 helm status ${release_name}
查看 release 的状态,或者重新读取配置信息。
# helm upgrade
helm upgrade 可用来升级 Chart 版本,或者更新 release 配置。 helm 会尝试执行最小侵入式升级,即执行增量更新。
# helm rollback
helm rollback 用于将 release 回滚到指定版本。
# helm uninstall
helm uninstall 用于卸载一个 release,如果想要保留删除记录,可使用 helm uninstall --keep-history
,随后可以使用 helm list --uninstalled
查看已删除的 release.
# helm create
helm create 用于生成一个chart,用于可以基于它快速创建一个自定义 chart。
$ helm create deis-workflow
Creating deis-workflow
编辑 chart 之后,可执行 helm lint
验证语法是否正确。
# helm package
helm package 用于打包自定义 chart.
$ helm package deis-workflow
deis-workflow-0.1.0.tgz
随后可以安装改 chart:
$ helm install deis-workflow ./deis-workflow-0.1.0.tgz
...
上次更新: 2023/12/08, 06:34:37