[kubernetes]helm安装

下载

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

原文地址:https://www.cnblogs.com/weifeng1463/p/10512387.html

时间: 2024-11-25 15:46:26

[kubernetes]helm安装的相关文章

helm安装及使用

helm简介 官网文档:https://helm.sh/ helm是kubernetes的包管理器,类似于linux系统下的apt-get或yum 安装 wget https://get.helm.sh/helm-v2.12.3-linux-amd64.tar.gz cp helm tiller /usr/local/bin helm version tiller -version 安装初始化: kubectl apply -f install/kubernetes/helm/helm-serv

K8s Helm安装配置入门

作为k8s现在主流的一种包部署方式,尽管不用,也需要进行一些了解.因为,它确实太流行了. 这一套太极拳打下来,感觉helm这种部署,目前还不太适合于我们公司的应用场景.它更适合需要手工编程各种yaml文件,使用模板减少工作量和出错. 而我们已实现了web方式的yaml文件编辑,使用Helm意义不大,只能起到优化yaml存储的作用,但同时会使我们的配置文件深度依赖helm. 一,Helm用途 Helm把Kubernetes资源(比如deployments.services或 ingress等) 打

国内不fq安装K8S三: 使用helm安装kubernet-dashboard

目录 3 使用helm安装kubernet-dashboard 3.1 Helm的安装 3.2 使用Helm部署Nginx Ingress 3.3 使用Helm部署dashboard 3.4 使用Helm部署metrics-server 国内不fq安装K8S一: 安装docker 国内不fq安装K8S二: 安装kubernet 国内不fq安装K8S三: 使用helm安装kubernet-dashboard 国内不fq安装K8S四: 安装过程中遇到的问题和解决方法 本文是按照"青蛙小白"

k8s Helm安装Prometheus Operator

Ubuntu 18 Kubernetes集群的安装和部署 以及Helm的安装完成了k8s的集群和helm的安装,今天我们来看看Prometheus的监控怎么搞.Prometheus Operator 是 CoreOS 开发的基于 Prometheus 的 Kubernete s监控方案,也可能是目前功能最全面的开源方案.更多信息可以查看https://github.com/coreos/prometheus-operator 创建命名空间 为方便管理,创建一个单独的 Namespace moni

Istio Helm 安装

一.参考官方文档 https://istio.io/docs/setup/kubernetes/#downloading-the-release # 安装前准备 https://istio.io/docs/setup/kubernetes/install/helm/ # 参考官方文档 helm 安装 二.Istio安装前准备 1. Go to the Istio release page to download the installation file corresponding to you

helm 安装EFK(Elasticsearch+Filebeat+Kibana)收集容器日志

官方地址:https://github.com/elastic/helm-charts 我用的是helm3安装 1.安装elasticsearch kubectl create ns logs helm repo add elastic https://helm.elastic.co helm pull elastic/elasticsearch tar zxf elasticsearch-7.6.0.tgz cd elasticsearch 编辑values.yaml文件 vim values

k8s中helm安装部署,升级和回滚(chart,helm,tiller,StorageClass)

一.Helm介绍 helm是基于kubernetes 的包管理器.它之于 kubernetes 就如 yum 之于 centos,pip 之于 python,npm 之于 javascript 那 helm 的引入对于管理集群有哪些帮助呢? 更方便地部署基础设施,如 gitlab,postgres,prometheus,grafana 等 更方便地部署自己的应用,为公司内部的项目配置 Chart,使用 helm 结合 CI,在 k8s 中部署应用一行命令般简单 1.Helm用途 Helm把Kub

Helm 安装 ElasticSearch & Kibana

Helm 安装 ElasticSearch & Kibana二.提前下载镜像下面是我们需要用到的两个主要镜像,提前将其下载避免下载过慢启动超时而导致失败. kibana 镜像: kibana:6.7.0elasticsearch 镜像: elasticsearch:6.7.0$ docker pull docker.elastic.co/kibana/kibana:6.7.0$ docker pull docker.elastic.co/elasticsearch/elasticsearch:6

k8s中Helm安装使用(15)

概念:helm把一系列复杂的有状态和无状态服务的部署封装起来(实际上就是对yaml文件的组织),然后你可以暴露出一些自定义参数信息供用户选择,这样部署就会变得简单很多.有点类似ansible,salt的yaml文件差不多.Helm相当于kubernetes环境下的yum包管理工具 组件:Helm :是一个命令行下的客户端工具 Tiller: 是 Helm 的服务端,部署在 Kubernetes 集群中 Chart Helm :的软件包,类似YUM 的 RPM 包 Repoistory Helm