下载

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. 2018-2019-2 网络对抗week1 Kali安装 20165333陈国超

    Kali安装 安装过程是按照网上的教程装的,链接点击[https://blog.csdn.net/KNIGH_YUN/article/details/79949512] 安装成功的截图 主要说一下安装 ...

  2. 安装 sshpass

    https://www.cnblogs.com/lemon-le/p/6495007.html ssh远程执行命令并自动退出 https://blog.csdn.net/mjj291268154/ar ...

  3. js随机生成颜色的方法

    function getRandomColor() { return '#' + (Math.random() * 0xffffff << 0).toString(16); }

  4. java:打印菱形图案(传参打印的自定义字符和行数)

    打印菱形图案: 代码实现: public class Hello { public static void main(String args[]) { LingXingPrint("#&qu ...

  5. Redis持久化(persistence)

    Redis 持久化 Redis 提供了多种不同级别的持久化方式: RDB 持久化可以在指定的时间间隔内生成数据集的时间点快照(point-in-time snapshot). AOF 持久化记录服务器 ...

  6. Spring Boot 项目实战(二)集成 Logback

    一.前言 上篇介绍了 Spring Boot Maven 多模块项目的搭建方法以及 MyBatis 的集成.通常在调试接口或者排查问题时我们主要借助于日志,一个设计合理的日志文件配置能大大降低我们的排 ...

  7. 利用zabbix监控oracle数据库

    一.概述 zabbix是一款非常强大,同时也是应用最为广泛的开源监控软件,本文将给大家介绍如何利用zabbix监控oracle数据库. 二.环境介绍 以下是我安装的环境,实际部署时并不需要跟我的环境一 ...

  8. CentOS 6.4在运行XFS时系统crash的bug分析

    最近有一台CentOS 6.4的服务器发生多次crash,kernel version 是Linux 2.6.32-431.29.2.el6.x86_64.从vmcore-dmesg日志内容及cras ...

  9. atomic 包、synchronized | Java 中线程安全

    相关阅读 彻底搞懂 CPU 中的内存结构 Java 内存模型 ,一篇就够了! 多线程实现原理 之前已经说过了,我们在保证线程安全的时候主要就是保证线程安全的 3 大特性,原子性.可见性.有序性.而在 ...

  10. 10.31 正睿停课训练 Day13

    目录 2018.10.31 正睿停课训练 Day13 A Poker(期望) B Label(高斯消元) C Coin(二分图染色 博弈) 考试代码 A(打表) B 2018.10.31 正睿停课训练 ...