1、这里尝试安装2.13.1版本的,其中分为客户端和服务器,先对客户端进行安装 1)安装客户端:
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.13.1-linux-amd64.tar.gz tar -zxvf helm-v2.13.1-linux-amd64.tar.gz cd linux-amd64/ cp helm /usr/local/bin/如果上面这个安装包的链接下载速度慢,可以自己去gitee克隆,然后下载下来使用。 2)验证客户端的安装
helm version显示结果如下:
[apps@mvxl1484 ~]$ helm version Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"} Error: could not find tiller这个错误是因为还没有安装服务器所导致。接下来就配置服务器: 3)首先在docker里面搜索tiller
docker search tiller显示结果如下: 注意Mirror of https://gcr.io/kubernetes-helm/t… 这一行,我们用这个镜像 4)创建一个yaml文件,并编辑
vim tiller.yaml插入如下内容
--- apiVersion: v1 kind: ServiceAccount metadata: name: tiller namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: tiller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: tiller namespace: kube-system5)执行命令
kubectl apply -f tiller.yaml6)初始化服务器
helm init --service-account tiller --skip-refresh7)使用命令查看pod
kubectl get pod --all-namespaces关注这个pod,显示镜像拉取失败状态,然后跟换镜像 8)编辑文件
kubectl edit deploy tiller-deploy -n kube-system apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: deployment.kubernetes.io/revision: "2" creationTimestamp: 2018-11-22T10:00:00Z generation: 2 labels: app: helm name: tiller name: tiller-deploy namespace: kube-system resourceVersion: "398202" selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/tiller-deploy uid: 5fd7370d-ee3d-11e8-a632-0050568a39f2 spec: replicas: 1 selector: matchLabels: app: helm name: tiller strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate 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: sapcc/tiller:v2.11.0 # 这里换成刚才通过docker搜索出来镜像 imagePullPolicy: IfNotPresent9)保存后再次查看pod的状态
kubectl get pod --all-namespaces显示正常 10)再次验证
helm version