CentOS7下安装helm

1、先下载2.11.0版本

记住就下这个版本,其他版本要确认你有相应的镜像源,否则装不上

wget https://get.helm.sh/helm-v2.11.0-linux-amd64.tar.gz
tar -xf helm-v2.15.2-linux-amd64.tar.gz
cd linux-amd64/
cp helm /usr/local/bin/

配置sa以及绑定集群
vi 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
kubectl create -f rbac-config.yaml
serviceaccount/tiller created
clusterrolebinding.rbac.authorization.k8s.io/tiller created

2、下载镜像

docker pull fishead/gcr.io.kubernetes-helm.tiller:v2.11.0

下载完查看一下

docker images|grep till

镜像源没问题开始安装

3、初始化创建服务端

./helm init --service-account tiller --tiller-image fishead/gcr.io.kubernetes-helm.tiller:v2.11.0 --skip-refresh

执行完后查看pod

kubectl get pods -n kube-system

也可以用

helm version

正常如下,否则会报错

[root@master1 linux-amd64]# helm version
Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

4、出错

你可能会看到下面的界面

NAME                             READY   STATUS             RESTARTS   AGE
tiller-deploy-6f6fd74b68-qvlzx   0/1     ImagePullBackOff   0          8m43s

编辑下配置文件

kubectl edit deployment tiller-deploy -n kube-system
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "2"
  creationTimestamp: 2018-11-16T08:03:53Z
  generation: 2
  labels:
    app: helm
    name: tiller
  name: tiller-deploy
  namespace: kube-system
  resourceVersion: "133136"
  selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/tiller-deploy
  uid: 291c2a71-e976-11e8-b6eb-8cec4b591b6a
spec:
  progressDeadlineSeconds: 2147483647
  replicas: 1
  revisionHistoryLimit: 10
  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: gcr.io/kubernetes-helm/tiller:v2.11.0
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /liveness
            port: 44135
            scheme: HTTP
          initialDelaySeconds: 1
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        name: tiller
        ports:
        - containerPort: 44134
          name: tiller
          protocol: TCP
        - containerPort: 44135

编辑下配置文件,看看镜像对不对,应该是镜像 fishead/gcr.io.kubernetes-helm.tiller

image: gcr.io/kubernetes-helm/tiller:v2.11.0

如果还是有问题,删除tiller,检查版本,检查每一步,重新上述步骤
删除tiller用下面的语句

helm reset -f

你可能感兴趣的:(技术)