我正在尝试使用Helm在群集上的Ubuntu 18.10主服务器上安装Traefik。
我能够使用snap install helm --classic
来安装Helm,但是当我不想使用helm init
命令来安装Tiller时,将显示以下输出信息:
helm init
Creating /home/user/.helm
Creating /home/user/.helm/repository
Creating /home/user/.helm/repository/cache
Creating /home/user/.helm/repository/local
Creating /home/user/.helm/plugins
Creating /home/user/.helm/starters
Creating /home/user/.helm/cache/archive
Creating /home/user/.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 /home/user/.helm.
Error: error installing: the server could not find the requested resource
我已经尝试通过官方GitHub的二进制文件安装头盔,但以相同的错误结束。
我还尝试通过运行:来手动安装Tiller:
helm init --dry-run --debug >> tiller.yml
但是当我执行kubectl apply -f tiller.yml
时,它说找不到扩展名/ v1beta1。
我的解决方案用完了,所以如果您有任何想法,我正在寻求您的帮助!
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: helm
name: tiller
name: tiller-deploy
namespace: kube-system
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: helm
name: tiller
spec:
automountServiceAccountToken: true
containers:
- env:
- name: TILLER_NAMESPACE
value: kube-system
- name: TILLER_HISTORY_MAX
value: "0"
image: gcr.io/kubernetes-helm/tiller:v2.14.3
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
httpGet:
path: /liveness
port: 44135
initialDelaySeconds: 1
timeoutSeconds: 1
name: tiller
ports:
- containerPort: 44134
name: tiller
- containerPort: 44135
name: http
readinessProbe:
httpGet:
path: /readiness
port: 44135
initialDelaySeconds: 1
timeoutSeconds: 1
resources: {}
status: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: helm
name: tiller
name: tiller-deploy
namespace: kube-system
spec:
ports:
- name: tiller
port: 44134
targetPort: tiller
selector:
app: helm
name: tiller
type: ClusterIP
status:
loadBalancer: {}
...
解决方法,使用命令:
helm init --service-accounter --output yaml | sed的s @ apiVersion:扩展程序/ v1beta1 @ apiVersion:apps / v1 @'| sed's @副本:1 @副本:1 \ n选择器:{“ matchLabels”:{“ app”:“ helm”,“ name”:“ tiller”}} @'| kubectl适用-f-
如果k8s版本为:1.16,则应降级为1.14。