zoukankan      html  css  js  c++  java
  • 在Kubernetes集群中安装Helm及证书认证

    安装Kubernetes

    测试环境使用kubeadm安装kubernetes v1.6.3版本, 安装过程略过.

    为Helm创建客户端认证

    客户端认证是为了能够使用helm命令行调用Helm的服务端Tiller.

    cd /etc/kubernetes/pki/
    
    # 编译认证文件
    openssl genrsa -out helm.key 2048
    openssl req -new -key helm.key -subj "/CN=helm" -out helm.csr
    openssl x509 -req -in helm.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out helm.crt -days 10000
    openssl x509  -noout -text -in ./helm.crt
    
    # 创建Helm context
    kubectl config set-context helm@kubernetes --cluster=kubernetes --namespace=monitoring --user=helm
    # 设置helm用户的客户端认证
    kubectl config set-credentials helm --client-certificate=helm.crt --client-key=helm.key --embed-certs=true
    # 切换至helm context
    kubectl config use-context helm@kubernetes
    

    为Helm设置服务端RBAC授权

    服务端RBAC授权是为了让Tiller有权限在其他namesapce中创建资源.

    # 切换至admin context
    kubectl config use-context kubernetes-admin@kubernetes
    # 创建helm使用的serviceaccount
    kubectl create serviceaccount helm --namespace=kube-system
    # 创建角色绑定
    kubectl create clusterrolebinding helm-sa-admin --clusterrole=admin --serviceaccount=kube-system:helm --namespace=kube-system
    

    安装Helm

    # 切换至helm context
    kubectl config use-context helm@kubernetes
    # 安装helm, 使用授权好的serviceaccount
    helm init --service-account=helm
    

    使用helm安装prometheus

    kubectl create namespace monitoring
    helm install stable/prometheus --name=prometheu
    helm status prometheus




    链接:https://www.jianshu.com/p/XZ5PWC

  • 相关阅读:
    ixgb 中断
    libvirt
    docker 查看虚拟机xml
    什么是可串行化MVCC
    算法题:实现 strStr()函数
    Python库 numpy基础内容学习笔记
    python3.6+torch1.2实现Sentiment Analysis(数据集MR)
    人工智能能力提升指导总结
    深度学习入门篇01(Tensorflow-gpu的安装)
    走进PEP8——代码规范
  • 原文地址:https://www.cnblogs.com/cheyunhua/p/10019663.html
Copyright © 2011-2022 走看看