helm 2

部署

官方文档: https://helm.sh/docs/intro/install/

中文文档:

	https://whmzsu.github.io/helm-doc-zh-cn/

	https://www.hellodemos.com/hello-helm-primary/helm-primary-quickstart.html

安装软件包

ntpdate ntp1.aliyun.com
wget https://get.helm.sh/helm-v2.16.2-linux-amd64.tar.gz
tar -zxvf helm-v2.16.2-linux-amd64.tar.gz
cd linux-amd64/
cp helm /usr/local/bin/

创建admin账户tiller

  • 创建YAML文件 rbac-config.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 


初始化helm

helm init --service-account tiller --skip-refresh


会遇到问题是镜像无法创建tiller的镜像

kubectl get pod -n kube-system -owide


  • 查看pod状态, 关注最下面的events
kubectl describe pod tiller-deploy-58b7754b-zlkmr -n kube-system


  • 在node01节点下载 镜像 gcr.io/kubernetes-helm/tiller:v2.16.2
docker pull registry.cn-hangzhou.aliyuncs.com/kubeapps/gcr-tiller:v2.16.2
docker tag registry.cn-hangzhou.aliyuncs.com/kubeapps/gcr-tiller:v2.16.2 gcr.io/kubernetes-helm/tiller:v2.16.2
docker rmi registry.cn-hangzhou.aliyuncs.com/kubeapps/gcr-tiller:v2.16.2

  • 再次到master上查看, pod已经创建成功
kubectl get pod -n kube-system -owide


  • 查看helm的版本信息
helm version


  • helm使用

    打开 https://hub.helm.sh/


helm自定义模板


第一步: 创建文件夹

mkdir 
posted @ 2020-03-19 18:57  cjw1219  阅读(173)  评论(0编辑  收藏  举报