赞
踩
https://github.com/helm/helm/blob/master/docs/rbac.md
vi /root/helm/rbac.yaml
内容
# 创建sa账号 apiVersion: v1 kind: ServiceAccount metadata: # sa账号 name: tiller # 名称空间 namespace: kube-system --- # 对sa账号做rbac授权 apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: tiller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: # sa账号设置 - kind: ServiceAccount name: tiller namespace: kube-system
kubectl apply -f /root/helm/rbac.yaml
# 查看
kubectl get sa -n kube-system | grep tiller
把下面的tar.gz包传到master节点和各个node节点,并安装
mkdir -p /root/helm
cd /root/helm
docker load -i tiler_2_13_1.tar.gz
# 删除
rm -rf tiler_2_13_1.tar.gz
vi /root/helm/tiller.yaml
内容
apiVersion: v1 kind: Service metadata: creationTimestamp: null # Service 标签为 app: helm和name: tiller labels: app: helm name: tiller # Service 名称为tiller-deploy name: tiller-deploy # 名称空间是kube-system namespace: kube-system spec: # service的端口 ports: #端口名称 - name: tiller #端口 port: 44134 #目标端口44134 targetPort: tiller # 匹配的pod标签 selector: app: helm name: tiller type: ClusterIP status: loadBalancer: {} --- apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null # 设置Deployment标签 labels: app: helm name: tiller # 设置Deployment名称 name: tiller-deploy namespace: kube-system spec: # 匹配的模板标签 selector: matchLabels: app: helm name: tiller # 副本数 replicas: 1 strategy: {} # 定义模板 template: metadata: creationTimestamp: null # 模板标签 labels: app: helm name: tiller spec: # 将sa账号默认挂载到 Pod 中 automountServiceAccountToken: true # sa账号 serviceAccount: tiller # 定义容器 containers: # 环境变量 - env: - name: TILLER_NAMESPACE value: kube-system - name: TILLER_HISTORY_MAX value: "0" # 镜像地址 image: gcr.io/kubernetes-helm/tiller:v2.13.1 imagePullPolicy: IfNotPresent # 存好检查 livenessProbe: httpGet: path: /liveness port: 44135 initialDelaySeconds: 1 timeoutSeconds: 1 name: tiller ports: - containerPort: 44134 name: tiller - containerPort: 44135 name: http # 健康检查 readinessProbe: httpGet: path: /readiness port: 44135 initialDelaySeconds: 1 timeoutSeconds: 1 resources: {} status: {}
kubectl apply -f /root/helm/tiller.yaml
# 查看
kubectl get svc -n kube-system
kubectl get pods -n kube-system
通过上面几步helm服务端旧部属好了
helm version
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。