• kubernetes-安装Helm


    Helm是什么?

    Helm可以管理Kubernetes应用程序-Helm Charts帮助您定义,安装和升级最复杂的Kubernetes应用程序。

    下载Helm 在https://github.com/helm/helm/releases

    最新发布版本是这个,使用wget下载

    wget https://get.helm.sh/helm-v2.16.0-linux-amd64.tar.gz
    

     下的太慢了,我就直接用本机下载过来Xftp传上去了。

    然后执行:

    tar -zxvf helm-v2.16.0-linux-amd64.tar.gz
    mv linux-amd64/helm /usr/local/bin/helm

     基于角色的访问控制(RABC) :rabc-tiller.yml

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: tiller
      namespace: kube-system
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    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 apply -f rabc-tiller.yml
    

    查看helm版本信息:

    helm version
    
    Client: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"}
    Error: could not find tiller
    

    安装helm,  tiller使用阿里云源(Server/Client版本要一致):

    helm init --service-account tiller --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
    Creating /root/.helm Creating /root/.helm/repository Creating /root/.helm/repository/cache Creating /root/.helm/repository/local Creating /root/.helm/plugins Creating /root/.helm/starters Creating /root/.helm/cache/archive Creating /root/.helm/repository/repositories.yaml Adding stable repo with URL: https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts Adding local repo with URL: http://127.0.0.1:8879/charts $HELM_HOME has been configured at /root/.helm. Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster. Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy. To prevent this, run `helm init` with the --tiller-tls-verify flag. For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation

     再查看版本信息:

    helm version
    
    Client: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"}
    Server: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"}

    就安装成功了

    如果出现错误可使用以下命令:

    helm reset :  重置
    rm -rf /root/.helm  :  删除helm配置
    kubernetes删除helm和tiller相关配置:   
    kubectl delete deployment tiller-deploy -n kube-system
    kubectl delete service tiller-deploy -n kube-system
    
    如果pod删除不掉,可强制删除:
    
    kubectl delete pod <pod name> --namespace=<pod namespace> --grace-period=0 --force
    

      

     

  • 相关阅读:
    分享:新入职时,如何快速熟悉一个项目的代码
    Windows搭建Golang开发环境
    Web3.0应用程序架构
    重新整理汇编—————汇编的基础理论前置篇
    重新整理汇编—————寄存器的基本概念[二]
    分库分表理论基础
    MyCat应用实战
    Mycat理论基础与配置详解
    Sharding JDBC案例实战
    Bert不完全手册5. BERT推理提速?训练提速!内存压缩!Albert
  • 原文地址:https://www.cnblogs.com/zsifan/p/11815718.html
Copyright © 2020-2023  润新知