In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to use helm to install tiller in kunernets. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Helm installation reference:
Helm consists of client command helm command line tool and server tiller. The installation of Helm is very simple. Download the helm command line tool to the / usr/local/bin of the master node node1, where version 2.9.1 is downloaded:
Wget https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gztar-zxvf helm-v2.11.0-linux-amd64.tar.gzcd linux-amd64/cp helm / usr/local/bin/
In order to install the server-side tiller, you also need to configure the kubectl tool and the kubeconfig file on this machine to ensure that the kubectl tool can access apiserver on this machine and use it properly. The node1 node here and kubectl are configured.
Because Kubernetes APIServer turns on RBAC access control, you need to create a service account: tiller that tiller uses and assign the appropriate role to it. For more information, see the Role-based Access Control in the helm document. For simplicity's sake, directly assign cluster-admin the cluster's built-in ClusterRole to it. Create a rbac-config.yaml file:
ApiVersion: v1kind: ServiceAccountmetadata: name: tiller namespace: kube-system---apiVersion: rbac.authorization.k8s.io/v1beta1kind: ClusterRoleBindingmetadata: name: tillerroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-adminsubjects:-kind: ServiceAccount name: tiller namespace: kube-systemkubectl create-f rbac-config.yamlserviceaccount/tiller createdclusterrolebinding.rbac.authorization.k8s.io/tiller created
Install tiller
Helm init-service-account tiller-skip-refresh
problem
At this point, there is a problem, which is different from that written by the bloggers referred to before. Because I am using a domestic docker source, the gcr.io/kubernetes-helm/tiller image cannot be accessed, so when I check the pod
Kubectl get pods-n kube-system shows: NAME READY STATUS RESTARTS AGEtiller-deploy-6f6fd74b68-rkk5w 0ram 1 ImagePullBackOff 0 14h
Pod is not in the right state. As a rookie in the beginning, he began to find a solution.
Solution idea 1: view the events of pod
Kubectl describe pod tiller-deploy-6f6fd74b68-rkk5w-n kube-system
Display
Events: Type Reason Age From Message-Warning Failed 52m (x3472 over 14h) kubelet, test1 Error: ImagePullBackOff Normal BackOff 2m6s (x3686 over 14h) kubelet, test1 Back-off pulling image "gcr.io/kubernetes-helm/tiller:v2.11.0"
Obviously failed to get the gcr.io/kubernetes-helm/tiller:v2.11.0 image
2. Pull the image manually
Docker search kubernetes-helm/tiller
Cockpit/kubernetes This container provides a version of cockpit... 41 [OK] fluent/fluentd-kubernetes-daemonset Fluentd Daemonset for Kubernetes 24 [OK] lachlanevenson/k8s-helm Helm client (https://github.com/kubernetes/h … 17 dtzar/helm-kubectl helm and kubectl running on top of alpline w... 16 [OK] jessestuart/tiller Nightly multi-architecture (amd64, arm64, ar... [OK] hypnoglow/kubernetes-helm Image providing kubernetes kubectl and helm... 3 [OK] linkyard/docker-helm Docker image containing kubernetes helm and... 3 [OK] jimmysong/kubernetes-helm-tiller 2 ibmcom/tiller Docker Image for IBM Cloud private-CE (Commu … 1 zhaosijun/kubernetes-helm-tiller mirror from gcr.io/kubernetes-helm/tiller:v2... 1 [OK] zlabjp/kubernetes-resource A Concourse resource for controlling the Kub... 1 thebeefcake/concourse-helm-resource concourse resource for managing helm deploym... 1 [OK] timotto/rpi-tiller k8s.io/tiller for Raspberry Pi 1 fishead/gcr.io.kubernetes-helm.tiller mirror of gcr.io/kubernetes-helm/tiller 1 [OK] victoru/concourse-helm-resource concourse resource for managing helm deploym... 0 [OK] bitnami/helm-crd-controller Kubernetes controller for HelmRelease CRD 0 [OK] z772458549/kubernetes-helm-tiller kubernetes-helm-tiller 0 [OK] mnsplatform/concourse -helm-resource Concourse resource for helm deployments 0 croesus/kubernetes-helm-tiller kubernetes-helm-tiller 0 [OK]
There are so many images. Look at the description. I like it.
Fishead/gcr.io.kubernetes-helm.tiller mirror of gcr.io/kubernetes-helm/tiller 1 [OK]
It means that the image of fishead/gcr.io.kubernetes-helm.tiller is based on
Made from mirror of gcr.io/kubernetes-helm/tiller Build
Next, go to dockerhub to confirm.
Dockerhub.jpg
Sure enough, it's the image we need, and then check the version:
Tag.jpg
Download the image:
Docker pull fishead/gcr.io.kubernetes-helm.tiller:v2.11.0
Change to tag
Docker tag fishead/gcr.io.kubernetes-helm.tiller:v2.11.0 gcr.io/kubernetes-helm/tiller:v2.11.0
View local image
Images.jpg
3. Redeploy
Mengxin has struggled with this step for a long time. Referring to the online method, I have tried it.
Delete tiller
Helm reset-f
Initialize, redeploy tiller
Helm init-service-account tiller--tiller-image gcr.io/kubernetes-helm/tiller:v2.11.0-skip-refresh
Check pod, or error status
Kubectl get pods-n kube-system
NAME READY STATUS RESTARTS AGEtiller-deploy-6f6fd74b68-qvlzx 0/1 ImagePullBackOff 0 8m43s
Ah, it's broken. Why does it still show that it failed to pull the image? (; '⌒')
Calm down and think about it. Is it written in the configuration file that you always get the warehouse image?
Edit the configuration file
Kubectl edit deployment tiller-deploy-n kube-system
ApiVersion: extensions/v1beta1kind: Deploymentmetadata: annotations: deployment.kubernetes.io/revision: "2" creationTimestamp: 2018-11-16T08:03:53Z generation: 2 labels: app: helm name: tiller name: tiller-deploy namespace: kube-system resourceVersion: "133136" selfLink: / apis/extensions/v1beta1/namespaces/kube-system/deployments/tiller-deploy uid: 291c2a71-e976-11e8-b6eb-8cec4b591b6aspec: progressDeadlineSeconds: 2147483647 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: App: helm name: tiller strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: metadata: creationTimestamp: null labels: app: helm name: tiller spec: automountServiceAccountToken: true containers:-env:-name: TILLER_NAMESPACE value: kube-system-name: TILLER_HISTORY_MAX value: "0" Image: gcr.io/kubernetes-helm/tiller:v2.11.0 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 httpGet: path: / liveness port: 44135 scheme: HTTP initialDelaySeconds: 1 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 name: tiller ports:-containerPort: 44134 Name: tiller protocol: TCP-containerPort: 44135
Sure enough, the image pull strategy has been found:
ImagePullPolicy: IfNotPresent
Let's see what the official website says.
Https://kubernetes.io/docs/concepts/containers/images/By default, the kubelet will try to pull each image from the specified registry. However, if the imagePullPolicy property of the container is set to IfNotPresent or Never, then a local image is used (preferentially or exclusively, respectively). # by default, the image will be pulled according to the image address in the configuration file. If set to IfNotPresent and Never, the local image will be used. IfNotPresent: if a local image exists, the local image is preferred. Never: directly stop pulling the image and use the local one. If the local image does not exist, an exception will be reported.
According to reason, there is no problem with my configuration. Why not retrieve the local image first? is that why I downloaded it later? Anyway, I'll change it to never first.
ImagePullPolicy:Never
Save and view the pod status
Tiller-deploy-f844bd879-p6m8x 1/1 Running 0 62s
After reading the above, do you have any further understanding of how to use helm to install tiller in kunernets? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.