0

before helm2 init, I've run:

kubectl delete all --all -n tiller-ns
rm -rf -- ~/.helm

then I run this:

helm2 init --tiller-namespace tiller-ns --stable-repo-url https://charts.helm.sh/stable

out:

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://charts.helm.sh/stable
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://v2.helm.sh/docs/securing_installation/

then, check it:

helm2 version

out:

Client: &version.Version{SemVer:"v2.16.12", GitCommit:"47f0b88409e71fd9ca272abc7cd762a56a1c613e", GitTreeState:"clean"}
Error: could not find tiller

see the tiller pod:

kubectl get all -n tiller-ns

out:

NAME                                 READY   STATUS    RESTARTS   AGE
pod/tiller-deploy-86b4fc48c9-x6tk9   1/1     Running   0          2m24s

NAME                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)     AGE
service/tiller-deploy   ClusterIP   10.107.83.126   <none>        44134/TCP   2m24s

NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/tiller-deploy   1/1     1            1           2m24s

NAME                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/tiller-deploy-86b4fc48c9   1         1         1       2m24s

how about describe it?:

kubectl describe po tiller-deploy-86b4fc48c9-x6tk9 -n tiller-ns

out:

Name:         tiller-deploy-86b4fc48c9-x6tk9
Namespace:    tiller-ns
Priority:     0
Node:         node-04/192.168.3.144
Start Time:   Mon, 22 Nov 2021 18:57:44 +0800
Labels:       app=helm
              name=tiller
              pod-template-hash=86b4fc48c9
Annotations:  cni.projectcalico.org/podIP: 100.103.62.181/32
              cni.projectcalico.org/podIPs: 100.103.62.181/32
Status:       Running
IP:           100.103.62.181
IPs:
  IP:           100.103.62.181
Controlled By:  ReplicaSet/tiller-deploy-86b4fc48c9
Containers:
  tiller:
    Container ID:   docker://2eaac0dfcea9a77a591b0c612549265a59df126c855f65089e1ba3402305b518
    Image:          gcr.io/kubernetes-helm/tiller:v2.16.12
    Image ID:       docker://sha256:c11838703bf83ca52d95fe66b0db8d6a8797581fdd132925c27cbc9a70e1d9e1
    Ports:          44134/TCP, 44135/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Running
      Started:      Mon, 22 Nov 2021 18:57:48 +0800
    Ready:          True
    Restart Count:  0
    Liveness:       http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
    Readiness:      http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
    Environment:
      TILLER_NAMESPACE:    tiller-ns
      TILLER_HISTORY_MAX:  0
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-cppv9 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  default-token-cppv9:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-cppv9
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age    From               Message
  ----    ------     ----   ----               -------
  Normal  Scheduled  3m18s  default-scheduler  Successfully assigned tiller-ns/tiller-deploy-86b4fc48c9-x6tk9 to node-04
  Normal  Pulled     3m14s  kubelet            Container image "gcr.io/kubernetes-helm/tiller:v2.16.12" already present on machine
  Normal  Created    3m14s  kubelet            Created container tiller
  Normal  Started    3m13s  kubelet            Started container tiller

and logs ?

kubectl logs tiller-deploy-86b4fc48c9-x6tk9 -n tiller-ns

out:

[main] 2021/11/22 10:57:49 Starting Tiller v2.16.12 (tls=false)
[main] 2021/11/22 10:57:49 GRPC listening on :44134
[main] 2021/11/22 10:57:49 Probes listening on :44135
[main] 2021/11/22 10:57:49 Storage driver is ConfigMap
[main] 2021/11/22 10:57:49 Max history per release is 0

then I run again:

helm2 version

out:

Client: &version.Version{SemVer:"v2.16.12", GitCommit:"47f0b88409e71fd9ca272abc7cd762a56a1c613e", GitTreeState:"clean"}
Error: could not find tiller

what the hell ??

2 Answers2

1

If you're using the now-unsupported Helm 2, and you configure it for a non-default Tiller namespace, it doesn't remember that. You either need to include the --tiller-namespace option in every helm invocation, or set the $TILLER_NAMESPACE environment variable.

export TILLER_NAMESPACE=tiller-ns
helm2 version

(As of this writing, Helm 2 has been out of support for over a year, and several community charts have moved over to Helm-3-only syntax. You should upgrade if you can, though I acknowledge that changing deployment systems in a production environment is tricky. My experience has been that most charts written for Helm 2 work unmodified in Helm 3.)

David Maze
  • 130,717
  • 29
  • 175
  • 215
0

well, I've find the way to get it right:

helm2 version --tiller-namespace tiller-ns

out:

Client: &version.Version{SemVer:"v2.16.12", GitCommit:"47f0b88409e71fd9ca272abc7cd762a56a1c613e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.12", GitCommit:"47f0b88409e71fd9ca272abc7cd762a56a1c613e", GitTreeState:"clean"}

the way by: https://stackoverflow.com/a/51662259/15861205