获取最新的稳定helm版本

时间:2018-04-06 06:35:28

标签: shell kubernetes-helm

是否有shell命令来获取最新的稳定helm版本。

对于kubernetes,我们有类似的东西

curl -LO https://storage.googleapis.com/kubernetes-release/release/ $(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl

5 个答案:

答案 0 :(得分:4)

尝试:

wget -qO- https://github.com/kubernetes/helm/releases | sed -n '/Latest release<\/a>/,$p' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' |head -1

结果:

v2.8.2

答案 1 :(得分:1)

对于那些没有wget的人:

HVER=$(curl -s https://github.com/kubernetes/helm/releases | sed -n '/Latest release<\/a>/,$p' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)

echo $HVER

结果(当前):

v2.9.1

要下载包含最新Helm可执行文件的gz,请执行以下操作:

Linux

curl -LO https://storage.googleapis.com/kubernetes-helm/helm-${HVER}-linux-amd64.tar.gz

OSX

curl -LO https://storage.googleapis.com/kubernetes-helm/helm-${HVER}-darwin-amd64.tar.gz

Windows(bash ell)

curl -LO https://storage.googleapis.com/kubernetes-helm/helm-${HVER}-windows-amd64.tar.gz

答案 2 :(得分:0)

如果您使用DockerfileLinux

RUN wget "https://storage.googleapis.com/kubernetes-helm/helm-$(wget -qO- https://github.com/kubernetes/helm/releases | sed -n '/Latest release<\/a>/,$p' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' |head -1)-linux-amd64.tar.gz"

答案 3 :(得分:0)

对于Linux,OSX和Windows目标:

HELM_INSTALL_DIR=[‘desired path’]
USE_SUDO=[‘true’|’false’]
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

其他安装选项:Helm Install Documentation

Recommend migration away from V2.x as soon as you can.

答案 4 :(得分:0)

我为v2做的方式:

curl -L0 "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar xzO linux-amd64/helm > /usr/local/bin/helm

对于v3:

curl -L0 "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar xzO linux-amd64/helm > /usr/local/bin/helm

别忘了之后chmod +x /usr/local/bin/helm