为了账号安全,请及时绑定邮箱和手机立即绑定

在Kubernetes集群中安装Helm

标签:
Kubernetes

此文章只包含简单的信息记录, 不包含原理说明和详细的过程描述.

安装Kubernetes

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

为Helm创建客户端认证

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

cd /etc/kubernetes/pki/# 编译认证文件openssl genrsa -out helm.key 2048openssl 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 10000openssl x509  -noout -text -in ./helm.crt# 创建Helm contextkubectl 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 contextkubectl config use-context helm@kubernetes

为Helm设置服务端RBAC授权

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

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

安装Helm

# 切换至helm contextkubectl config use-context helm@kubernetes# 安装helm, 使用授权好的serviceaccounthelm 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


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
JAVA开发工程师
手记
粉丝
205
获赞与收藏
1007

关注作者,订阅最新文章

阅读免费教程

  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消