下载

HELM_VERSION=${K8S_VERSION:-"2.11.0"}
HELM="helm-v${HELM_VERSION}-linux-amd64" curl -L https://storage.googleapis.com/kubernetes-helm/$HELM.tar.gz -o $HELM.tar.gz tar -xvzf $HELM.tar.gz -C /tmp mv /tmp/linux-amd64/helm /usr/local/bin/helm

2、验证安装

helm version
[apps@mvxl1484 ~]$ helm version
Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
Error: could not find tiller

  

3、安装tiller。首先搜索tiller

docker search tiller

[apps@mvxl1484 k8s]$ docker search tiller
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
sapcc/tiller Mirror of https://gcr.io/kubernetes-helm/t... 5
jessestuart/tiller Nightly multi-architecture (amd64, arm64, ... 4 [OK]
ist0ne/tiller https://gcr.io/kubernetes-helm/tiller 3 [OK]
timotto/rpi-tiller k8s.io/tiller for Raspberry Pi 1
itinerisltd/tiller 1
rancher/tiller 1
luxas/tiller 1
ibmcom/tiller Docker Image for IBM Cloud private-CE (Com... 1
ansibleplaybookbundle/tiller-apb An APB that deploys tiller for use with helm. 0 [OK]
pcanham/tiller tiller image for Raspberry Pi for testing ... 0
kubeapps/tiller-proxy 0
appscode/tiller 0
jmgao1983/tiller from gcr.io/kubernetes-helm/tiller 0 [OK]
anjia0532/tiller 0
4admin2root/tiller gcr.io/kubernetes-helm/tiller 0 [OK]
ibmcom/tiller-ppc64le Docker Image for IBM Cloud Private-CE (Com... 0
szgrgo/helm-with-tiller Use helm and tiller together 0 [OK]
关注第一行:Mirror of https://gcr.io/kubernetes-helm/t... 因为gcr.io库的封锁,用这个镜像。

  

4、编辑安装的yaml:

cat 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-system
[root@compass-user-hd-master3]:~#

  

5、执行命令:

kubectl apply -f tiller.yaml

  

6、再次验证:

[apps@mvxl1484 k8s]$ helm version
Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
Error: could not find a ready tiller pod

  

7、代表tiller的pod已经存在,但是没有运行起来。执行命令:

[apps@mvxl1484 k8s]$ kubectl get pod --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
3d
kube-system kubernetes-dashboard-58f5cb49c-zf7cn 1/1 Running 0 2d
kube-system tiller-deploy-9bdb7c6bc-28rv6 0/1 ImagePullBackOff 0 42s

  

8、查看错误描述:

[apps@mvxl1484 k8s]$ kubectl describe pod tiller-deploy-9bdb7c6bc-28rv6 -n kube-system
Name: tiller-deploy-9bdb7c6bc-28rv6
Namespace: kube-system
Node: mvxl2655/10.16.91.120
Start Time: Thu, 22 Nov 2018 18:00:01 +0800
Labels: app=helm
name=tiller
pod-template-hash=568637267
Annotations: <none>
Status: Pending
IP: 10.16.3.18
Controlled By: ReplicaSet/tiller-deploy-9bdb7c6bc
Containers:
tiller:
Container ID:
Image: gcr.io/kubernetes-helm/tiller:v2.11.0
Image ID:
Ports: 44134/TCP, 44135/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Liveness: http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
Readiness: http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
Environment:
TILLER_NAMESPACE: kube-system
TILLER_HISTORY_MAX: 0
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from tiller-token-ls9t2 (ro)
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
tiller-token-ls9t2:
Type: Secret (a volume populated by a Secret)
SecretName: tiller-token-ls9t2
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 1m default-scheduler Successfully assigned tiller-deploy-9bdb7c6bc-28rv6 to mvxl2655
Normal SuccessfulMountVolume 1m kubelet, mvxl2655 MountVolume.SetUp succeeded for volume "tiller-token-ls9t2"
Normal Pulling 1m (x2 over 1m) kubelet, mvxl2655 pulling image "gcr.io/kubernetes-helm/tiller:v2.11.0"
Warning Failed 55s (x2 over 1m) kubelet, mvxl2655 Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.11.0": rpc error: code = Unknown desc = Error response from daemon: Get https://gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Warning Failed 55s (x2 over 1m) kubelet, mvxl2655 Error: ErrImagePull
Warning Failed 50s (x5 over 1m) kubelet, mvxl2655 Error: ImagePullBackOff
Normal SandboxChanged 49s (x7 over 1m) kubelet, mvxl2655 Pod sandbox changed, it will be killed and re-created.
Normal BackOff 47s (x6 over 1m) kubelet, mvxl2655 Back-off pulling image "gcr.io/kubernetes-helm/tiller:v2.11.0"
最后一行代表镜像拉取失败:Back-off pulling image "gcr.io/kubernetes-helm/tiller:v2.11.0"

  

9、为此要使用之前搜索到的镜像,编辑deploy,更改镜像地址:

[apps@mvxl1484 k8s]$ 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
imagePullPolicy: IfNotPresent
将 image gcr.io/kubernetes-helm/tiller:v2.11.0 替换成 image: sapcc/tiller:v2.11.0

  

10:、保存后,kubernetes会自动生效,再次查看pod,已经处于running状态了。

[apps@mvxl1484 k8s]$ kubectl get pod -n kube-system
tiller-deploy-6b84d85487-4h272 1/1 Running 0 45s

  

11、验证helm

[apps@mvxl1484 k8s]$ helm version
Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b

 

  • 问题解决
  • unable to do port forwarding: socat not found.
[root@k8s-master hello-svc]# helm version
Client: &version.Version{SemVer:"v2.8.1", GitCommit:"6af75a8fd72e2aa18a2b278cfe5c7a1c5feca7f2", GitTreeState:"clean"}
E0224 14:13:16.077226 7416 portforward.go:331] an error occurred forwarding 37271 -> 44134: error forwarding port 44134 to pod 76a7312e49220a229e443546a4b32d3e0406f09fd9b3646b3d30f6833e121375, uid : unable to do port forwarding: socat not found.
Error: cannot connect to Tiller

解决办法在k8s  所有node节点上安装socat

yum install socat -y

[kubernetes]helm安装的更多相关文章

  1. kubernetes包管理工具Helm安装

    helm官方建议使用tls,首先生成证书. openssl genrsa -out ca.key.pem openssl req -key ca.key.pem -new -x509 -days -s ...

  2. kubernetes实战(十):k8s使用Helm安装harbor

    1.基本概念 对于复杂的应用中间件,需要设置镜像运行的需求.环境变量,并且需要定制存储.网络等设置,最后设计和编写Deployment.Configmap.Service及Ingress等相关yaml ...

  3. kubernetes实战篇之helm安装

    系列目录 Helm是kubernetes的应用包管理工具,是CNCF孵化器下的一个项目,主要用来管理 Charts.类似于 Ubuntu 中的 APT 或 CentOS 中的 YUM.它提供了一种简单 ...

  4. Helm 安装部署Kubernetes的dashboard

    Kubernetes Dashboard 是 k8s集群的一个 WEB UI管理工具,代码托管在 github 上,地址:https://github.com/kubernetes/dashboard ...

  5. [转帖]Kubernetes中安装Helm及使用

    Kubernetes中安装Helm及使用 2018年07月02日 17:41:09 灬勿忘丶心安 阅读数 3699更多 分类专栏: K8S   版权声明:本文为博主原创文章,遵循CC 4.0 BY-S ...

  6. helm安装kubernetes的插件istio

    1.安装istio 要使用Helm自定义Istio安装,请使用--set <key>=<value>Helm命令中的选项覆盖一个或多个值 怎么使用选项配置请查看官网https: ...

  7. kubernetes系列(十六) - Helm安装和入门

    1. helm简介 1.1 为什么需要helm 1.2 helm中几个概念 1.3 helm用途 2. helm安装 3. helm的基本使用 3.1 安装chart仓库里面的chart 3.2 创建 ...

  8. kubernetes系列(十七) - 通过helm安装dashboard详细教程

    1. 前提条件 2. 配置https证书为secret 3. dashboard安装 3.1 helm拉取dashboard的chart 3.2 配置dashboard的chart包配置 3.3 he ...

  9. kubernetes(k8s) helm安装kafka、zookeeper

    通过helm在k8s上部署kafka.zookeeper 通过helm方法安装 k8s上安装kafka,可以使用helm,将kafka作为一个应用安装.当然这首先要你的k8s支持使用helm安装.he ...

随机推荐

  1. VMvare虚拟机如何删除安装的ubuntu操作系统

    VMvare虚拟机如何删除安装的ubuntu操作系统呢??? 这个问题其实在我刚开始接触虚拟机和ubuntu操作系统的时候对于如何删除操作系统是一件很苦恼的事情,因为按照书本的步骤,根本看不懂如何操作 ...

  2. Python list 函数

    list 修改列表元素: 下标直接修改  list[下标]=值 列表添加元素: list.append(值)末尾追加 列表插入元素: list.insert(下标,元素) 列表删除元素: del li ...

  3. AOJ 2224 Save your cats (Kruskal)

    题意:给出一个图,去除每条边的花费为边的长度,求用最少的花费去除部分边使得图中无圈. 思路:先将所有的边长加起来,然后减去最大生成树,即得出最小需要破坏的篱笆长度. #include <cstd ...

  4. js后退

    history.back(-1):直接返回当前页的上一页,数据全部消息,是个新页面 history.go(-1):也是返回当前页的上一页,不过表单里的数据全部还在 history.back(0) 刷新 ...

  5. Win10 下 hadoop3.0.0 单机部署

    前言 因近期要做 hadoop 有关的项目,需配置 hadoop 环境,简单起见就准备进行单机部署,方便开发调试.顺便记录下采坑步骤,方便碰到同样问题的朋友们. 安装步骤 一.下载 hadoop-XX ...

  6. C# 使用 iTextSharp 将 PDF 转换成 TXT 文本

    var pdfReader = new PdfReader("xxx.pdf"); StreamWriter output = new StreamWriter(new FileS ...

  7. 洛谷.4180.[模板]次小生成树Tree(Kruskal LCA 倍增)

    题目链接 构建完MST后,枚举非树边(u,v,w),在树上u->v的路径中找一条权值最大的边(权为maxn),替换掉它 这样在 w=maxn 时显然不能满足严格次小.但是这个w可以替换掉树上严格 ...

  8. C/C++ 下的void main()

    很多人甚至市面上的一些书籍,都使用了void main( ),其实这是错误的.C/C++ 中从来没有定义过void main( ).C++之 父 Bjarne Stroustrup在他的主页上的 FA ...

  9. JavaScript简易教程

    这是我所知道的最完整最简洁的JavaScript基础教程. 这篇文章带你尽快走进JavaScript的世界——前提是你有一些编程经验的话.本文试图描述这门语言的最小子集.我给这个子集起名叫做“Java ...

  10. 20172302 《Java软件结构与数据结构》第八周学习总结

    2018年学习总结博客总目录:第一周 第二周 第三周 第四周 第五周 第六周 第七周 第八周 教材学习内容总结 第十二章 优先队列与堆 1.堆(heap)是具有两个附加属性的一棵二叉树: (1)它是一 ...