您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
58、 Helm 及其它功能性组件 - Helm(1](tiller)
发布时间:2023-01-14 13:19:04编辑:雪饮阅读()
Step1
创建目录
mkdir /usr/local/install-k8s/helm
拿到这个资源
https://storage.googleapis.com/kubernetes-helm/helm-v2.13.1-linux-amd64.tar.gz
放到目录/usr/local/install-k8s/helm中
这里再熟悉一个命令,就是回到上次工作目录
[root@k8s-master01 helm]# cd !$
然后咱们重新回到咱们的主线,接着是解压这个helm-v2.13.1-linux-amd64.tar.gz
[root@k8s-master01 helm]# tar -zxvf helm-v2.13.1-linux-amd64.tar.gz
linux-amd64/
linux-amd64/LICENSE
linux-amd64/tiller
linux-amd64/helm
linux-amd64/README.md
cp -a 保留原文件属性的前提下复制文件
那么接下来我们将可执行文件放到对应目录
[root@k8s-master01 helm]# cp -a linux-amd64/helm /usr/local/bin/
赋权
[root@k8s-master01 helm]# chmod a+x /usr/local/bin/helm
Step2
各节点提前加载所需依赖的一个可能大多数情况下无法正常docker pull的镜像(该镜像如果你docker不出现网络问题能正常pull下来则无需了)
我这里该镜像来自于老师的资料
E:\10、Kubernetes - Helm 及其它功能性组件\鸿鹄论坛_10、Kubernetes - Helm 及其它功能性组件\2、资料
中的镜像文件.zip.001进行分卷解压后的完整路径为
E:\10、Kubernetes - Helm 及其它功能性组件\鸿鹄论坛_10、Kubernetes - Helm 及其它功能性组件\2、资料\镜像文件.zip\Images\helm\ helm-tiller.tar
文件
[root@k8s-node01 ~]# docker load -i helm-tiller.tar
3fc64803ca2d: Loading layer [==================================================>] 4.463MB/4.463MB
79395a173ae6: Loading layer [==================================================>] 6.006MB/6.006MB
c33cd2d4c63e: Loading layer [==================================================>] 37.16MB/37.16MB
d727bd750bf2: Loading layer [==================================================>] 36.89MB/36.89MB
Loaded image: gcr.io/kubernetes-helm/tiller:v2.13.1
然后重回master节点咱们创建yaml模板如:
[root@k8s-master01 helm]# cat rbac.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
然后创建ServiceAccount和ClusterRoleBinding
[root@k8s-master01 helm]# kubectl create -f rbac.yaml
serviceaccount/tiller created
clusterrolebinding.rbac.authorization.k8s.io/tiller created
然后初始化哈
[root@k8s-master01 helm]# helm init --service-account tiller --skip-refresh
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-charts.storage.googleapis.com
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
Happy Helming!
这样就没有问题咯
[root@k8s-master01 helm]# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-699cc4c4cb-5gzzv 1/1 Running 3 5d22h
coredns-699cc4c4cb-nd7nb 1/1 Running 3 5d23h
etcd-k8s-master01 1/1 Running 28 31d
kube-apiserver-k8s-master01 1/1 Running 30 31d
kube-controller-manager-k8s-master01 1/1 Running 32 31d
kube-flannel-ds-amd64-v8bkz 1/1 Running 2 5d22h
kube-flannel-ds-amd64-w2qp2 1/1 Running 3 5d22h
kube-flannel-ds-amd64-xsq8h 1/1 Running 25 17d
kube-proxy-4lwzp 1/1 Running 27 31d
kube-proxy-m6bsz 1/1 Running 25 31d
kube-proxy-xqhhg 1/1 Running 25 31d
kube-scheduler-k8s-master01 1/1 Running 32 31d
tiller-deploy-58565b5464-64scg 1/1 Running 0 37s
Step3
Hai。。。然后咱们给master节点也上传刚才的那个helm-tiller.tar的镜像到master的这个目录
/usr/local/install-k8s/helm
[root@k8s-master01 helm]# ls
helm-tiller.tar helm-v2.13.1-linux-amd64.tar.gz linux-amd64 rbac.yaml
当然了,这一步骤就目前来看好像是非必。
因为这里老师好像只是为了整理到一个文件夹里面,看起来整齐点
然后查看下helm版本哈
[root@k8s-master01 helm]# helm version
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
这样就是没问题了哈
关键字词:Helm,helm