# 下载 helm-push_0.10.1_linux_amd64.tar.gz
https://github.com/chartmuseum/helm-push/releases/download/v0.10.1/helm-push_0.10.1_linux_amd64.tar.gz
# 解压[root@k8s-master2 helm]# tar-zxf helm-push_0.10.1_linux_amd64.tar.gz
[root@k8s-master2 helm]# ll
total 23636
drwxr-xr-x. 2 root root 26 Dec 23 10:51 bin
-rw-r--r--. 1 root root 10481411 Dec 23 10:51 helm-push_0.10.1_linux_amd64.tar.gz
-rw-r--r--. 1 1001 docker 11357 Oct 12 22:09 LICENSE
-rw-r--r--. 1 1001 docker 407 Oct 12 22:09 plugin.yaml
# 安装[root@k8s-master2 helm]# helm plugin install.
sh: scripts/install_plugin.sh: No such file or directory
Error: plugin install hook for"cm-push" exited with error
# 测试[root@k8s-master2 helm]# helm cm-push --help
Helm plugin to push chart package to ChartMuseum
Examples:
$ helm cm-push mychart-0.1.0.tgz chartmuseum # push .tgz from "helm package"$ helm cm-push . chartmuseum # package and push chart directory$ helm cm-push .--version="1.2.3" chartmuseum # override version in Chart.yaml$ helm cm-push . https://my.chart.repo.com # push directly to chart repo URL
Usage:
helm cm-push [flags]
Flags:
--access-token string Send token in Authorization header [$HELM_REPO_ACCESS_TOKEN]-a, --app-version string Override app version pre-push
--auth-header string Alternative header to use for token auth [$HELM_REPO_AUTH_HEADER]--ca-file string Verify certificates of HTTPS-enabled servers using this CA bundle [$HELM_REPO_CA_FILE]--cert-file string Identify HTTPS client using this SSL certificate file [$HELM_REPO_CERT_FILE]--check-helm-version outputs either "2" or "3" indicating the current Helm major version
--context-path string ChartMuseum context path [$HELM_REPO_CONTEXT_PATH]--debug Enable verbose output
-d, --dependency-update update dependencies from "requirements.yaml" to dir"charts/" before packaging
-f, --force Force upload even if chart version exists
-h, --helphelp for helm
--home string Location of your Helm config. Overrides $HELM_HOME(default "/root/.helm")--host string Address of Tiller. Overrides $HELM_HOST--insecure Connect to server with an insecure way by skipping certificate verification [$HELM_REPO_INSECURE]--key-file string Identify HTTPS client using this SSL key file [$HELM_REPO_KEY_FILE]--keyring string location of a public keyring (default "/root/.gnupg/pubring.gpg")--kube-context string Name of the kubeconfig context to use
--kubeconfig string Absolute path of the kubeconfig file to be used
-p, --password string Override HTTP basic auth password [$HELM_REPO_PASSWORD]--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")-t, --timeout int The duration (in seconds) Helm will wait to get response from chartmuseum (default 30)-u, --username string Override HTTP basic auth username [$HELM_REPO_USERNAME]-v, --version string Override chart version pre-push
[root@k8s-master2 helm]# helm cm-push --help
Helm plugin to push chart package to ChartMuseum
Examples:
$ helm cm-push mychart-0.1.0.tgz chartmuseum # push .tgz from "helm package"$ helm cm-push . chartmuseum # package and push chart directory$ helm cm-push .--version="1.2.3" chartmuseum # override version in Chart.yaml$ helm cm-push . https://my.chart.repo.com # push directly to chart repo URL
Usage:
helm cm-push [flags]
Flags:
--access-token string Send token in Authorization header [$HELM_REPO_ACCESS_TOKEN]-a, --app-version string Override app version pre-push
--auth-header string Alternative header to use for token auth [$HELM_REPO_AUTH_HEADER]--ca-file string Verify certificates of HTTPS-enabled servers using this CA bundle [$HELM_REPO_CA_FILE]--cert-file string Identify HTTPS client using this SSL certificate file [$HELM_REPO_CERT_FILE]--check-helm-version outputs either "2" or "3" indicating the current Helm major version
--context-path string ChartMuseum context path [$HELM_REPO_CONTEXT_PATH]--debug Enable verbose output
-d, --dependency-update update dependencies from "requirements.yaml" to dir"charts/" before packaging
-f, --force Force upload even if chart version exists
-h, --helphelp for helm
--home string Location of your Helm config. Overrides $HELM_HOME(default "/root/.helm")--host string Address of Tiller. Overrides $HELM_HOST--insecure Connect to server with an insecure way by skipping certificate verification [$HELM_REPO_INSECURE]--key-file string Identify HTTPS client using this SSL key file [$HELM_REPO_KEY_FILE]--keyring string location of a public keyring (default "/root/.gnupg/pubring.gpg")--kube-context string Name of the kubeconfig context to use
--kubeconfig string Absolute path of the kubeconfig file to be used
-p, --password string Override HTTP basic auth password [$HELM_REPO_PASSWORD]--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")-t, --timeout int The duration (in seconds) Helm will wait to get response from chartmuseum (default 30)-u, --username string Override HTTP basic auth username [$HELM_REPO_USERNAME]-v, --version string Override chart version pre-push
# 常用命令[root@k8s-master2 harbor]# helm repo --help
This command consists of multiple subcommands to interact with chart repositories.
It can be used to add, remove, list, and index chart repositories.
Usage:
helm repo [command]
Available Commands:
add add a chart repository
index generate an index file given a directory containing packaged charts
list list chart repositories
remove remove one or more chart repositories
update update information of available charts locally from chart repositories
Flags:
-h, --helphelp for repo
Global Flags:
--debugenable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "/root/.config/helm/registry.json")--repository-cache string path to the file containing cached repository indexes (default "/root/.cache/helm/repository")--repository-config string path to the file containing repository names and URLs (default "/root/.config/helm/repositories.yaml")
Use "helm repo [command] --help"for more information about a command.
[root@k8s-master2 harbor]# helm repo add --username admin --password admin harborcloud http://172.51.216.88:8888/chartrepo/springcloud
"harborcloud" has been added to your repositories
[root@k8s-master2 harbor]# helm repo list
NAME URL
stable http://mirror.azure.cn/kubernetes/charts
aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
bitnami https://charts.bitnami.com/bitnami
ingress-nginx https://kubernetes.github.io/ingress-nginx
elastic https://helm.elastic.co
harborcloud http://172.51.216.88:8888/chartrepo/springcloud
[root@k8s-master2 harbor]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "harborcloud" chart repository
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "aliyun" chart repository
...Successfully got an update from the "elastic" chart repository
...Successfully got an update from the "bitnami" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
5.2.上传
1
2
3
4
5
6
# 参考 $ helm cm-push mychart-0.1.0.tgz chartmuseum # push .tgz from "helm package"$ helm cm-push . chartmuseum # package and push chart directory$ helm cm-push .--version="1.2.3" chartmuseum # override version in Chart.yaml$ helm cm-push . https://my.chart.repo.com # push directly to chart repo URL
# 上传[root@k8s-master2 harbor]# helm cm-push cloud/ harborcloud
Pushing cloud-1.0.0.tgz to harborcloud...
Done.
# 更新[root@k8s-master2 harbor]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "harborcloud" chart repository
...Successfully got an update from the "elastic" chart repository
...Successfully got an update from the "aliyun" chart repository
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "presslabs" chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
# 查询[root@k8s-master2 harbor]# helm search repo harborcloud/cloud
NAME CHART VERSION APP VERSION DESCRIPTION
harborcloud/cloud 1.0.0 1.0.1 A Helm chart for Kubernetes
# 获取[root@k8s-master2 harbor]# helm fetch harborcloud/cloud
[root@k8s-master2 harbor]# ll
total 8
drwxr-xr-x 4 root root 93 Dec 27 10:56 cloud
-rw-r--r-- 1 root root 2952 Dec 27 11:07 cloud-1.0.0.tgz
# 升级[root@k8s-master2 harbor]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "harborcloud" chart repository
...Successfully got an update from the "aliyun" chart repository
...Successfully got an update from the "elastic" chart repository
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "bitnami" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
[root@k8s-master2 harbor]# helm upgrade msa harborcloud/cloud --version 2.0.0 -ntest
Release "msa" has been upgraded. Happy Helming!
NAME: msa
LAST DEPLOYED: Thu Dec 23 15:24:31 2021
NAMESPACE: test
STATUS: deployed
REVISION: 2
TEST SUITE: None
[root@k8s-master2 harbor]# helm list -ntest
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
msa test 2 2021-12-23 15:24:31.198256379 +0800 CST deployed cloud-2.0.0 2.0.1