helm常用命令

2019/08/01 CICD

helm常用命令

Helm作为kubernetes中的一个子项目,旨在解决kubernetes复杂编排文件的整理,管理作用,单位为版本应用。

基本操作:

​ 1、替换源:

helm repo remove stable
helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo update
helm search --后面不加搜索内容就会是查询出全部 

​ 2、添加本地仓库

nohup helm serve --address 127.0.0.1:8879 --repo-path //root/.helm/repository  >/usr/helm/logs.txt  2>&1 &
helm repo add local http://127.0.0.1:8879
helm repo list 

​ 3、本地仓库增加软件包(jenkins举个栗子)

cp -r jenkins HelmRepo地址
cd HelmRepo地址
helm package jenkins --save=false  
cd HelmRepo地址
helm repo index --url=HelmRepoUrl .    
helm repo update
helm search jenkins 

​ 4、从远端仓库拉取应用

helm search wordpress --repo repoUrl (不写默认)
helm fetch stable/wordpress --repo repoUrl(从哪个仓库拉取)
helm 

5、release(安装)应用&删除应用

#安装应用 生成实例(release)
helm install local-repo/wordpress -n releaseName 
#卸载应用 删除实例
helm delete releaseName
#查看所有的实例
helm list

6、获取chart的内容

#只会获取到chart.yaml文件内容和values.yaml内容
helm inspect chartName (如:local/tdo)

7、应用更新

# 强制更新实例内容
helm upgrade releaseName chartName --force --set values.kye = 

8、运行测试

 helm install --dry-run --debug .

9、应用打包

helm package .

10、安装状态

helm status release-name

命令合集

Available Commands:
  completion  Generate autocompletions script for the specified shell (bash or zsh)
  create      create a new chart with the given name
  delete      given a release name, delete the release from Kubernetes
  dependency  manage a chart's dependencies
  fetch       download a chart from a repository and (optionally) unpack it in local directory
  get         download a named release
  help        Help about any command
  history     fetch release history
  home        displays the location of HELM_HOME
  init        initialize Helm on both client and server
  inspect     inspect a chart
  install     install a chart archive
  lint        examines a chart for possible issues
  list        list releases
  package     package a chart directory into a chart archive
  plugin      add, list, or remove Helm plugins
  repo        add, list, remove, update, and index chart repositories
  reset       uninstalls Tiller from a cluster
  rollback    roll back a release to a previous revision
  search      search for a keyword in charts
  serve       start a local http web server
  status      displays the status of the named release
  template    locally render templates
  test        test a release
  upgrade     upgrade a release
  verify      verify that a chart at the given path has been signed and is valid
  version     print the client/server version information

Flags:
      --debug                           enable verbose output
  -h, --help                            help for helm
      --home string                     location of your Helm config. Overrides $HELM_HOME (default "/root/.helm")
      --host string                     address of Tiller. Overrides $HELM_HOST
      --kube-context string             name of the kubeconfig context to use
      --kubeconfig string               absolute path to the kubeconfig file to use
      --tiller-connection-timeout int   the duration (in seconds) Helm will wait to establish a connection to tiller (default 300)
      --tiller-namespace string         namespace of Tiller (default "kube-system")

Search

    欢迎添加我的个人微信号

    个人微信哦

    Table of Contents