在 mac osx 和 Tiller 上安装 Helm 2.9

Installing Helm 2.9 on mac osx and Tiller

我正在尝试在本地 minikube 上安装旧版本的 helm 和 tiller,并不断收到 Error: error installing: the server could not find the requested resource 错误消息 - 不知道如何解决该问题;

我执行的步骤:

$ brew unlink kubernetes-helm
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/78d64252f30a12b6f4b3ce29686ab5e262eea812/Formula/kubernetes-helm.rb
$ brew switch kubernetes-helm 2.9.1

我收到的错误信息是:

MacBook-Pro% helm init
Creating /Users/rwalas/.helm
Creating /Users/rwalas/.helm/repository
Creating /Users/rwalas/.helm/repository/cache
Creating /Users/rwalas/.helm/repository/local
Creating /Users/rwalas/.helm/plugins
Creating /Users/rwalas/.helm/starters
Creating /Users/rwalas/.helm/cache/archive
Creating /Users/rwalas/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /Users/rwalas/.helm.
Error: error installing: the server could not find the requested resource

** 更新

这个错误报告有点帮助,但问题仍然存在:https://github.com/helm/helm/issues/6374

当前的解决方法似乎是这样的:

helm init --output yaml > tiller.yaml 并更新 tiller.yaml:

改为apps/v1 添加选择器字段

---
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: helm
    name: tiller
  name: tiller-deploy
  namespace: kube-system
spec:
  replicas: 1
  strategy: {}
  selector:
    matchLabels:
      app: helm
      name: tiller

和:


已解决:

这些步骤最终帮助了我,我建议所有想使用旧版本 helm 的人

# 1. Check which binary you would like: https://github.com/helm/helm/releases and copy address
wget -c https://get.helm.sh/helm-v3.0.2-darwin-amd64.tar.gz
tar -zxvf helm-v3.0.2-darwin-amd64.tar.gz
rm -rf ~/.helm
mv <directory_of_download>/Darwin-AMD64<or whatever other name it was named>/helm /usr/local/bin/helm

有两点需要考虑:

  1. 检查您想要的二进制文件:https://github.com/helm/helm/releases 并复制地址 wget -c https://get.helm.sh/helm-v3.0.2-darwin-amd64.tar.gz tar -zxvf helm-v3.0.2-darwin-amd64.tar.gz rm -rf ~/.helm mv <directory_of_download>/Darwin-AMD64<or whatever other name it was named>/helm /usr/local/bin/helm

  2. 最新版本的 K8s 在安装 Helm 时遇到了一些问题。在启动 minikube 时尝试使用 K8s 的 1.15.4 版本,因为这是一个已批准的解决方法。 minikube delete 而不是 minikube start --kubernetes-version=1.15.4。在 helm init 之后。