New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible helm completely broken, should not advertised be in the documentation and should not be in ansible contrib. #37148

Closed
honkycat opened this Issue Mar 7, 2018 · 12 comments

Comments

Projects
None yet
9 participants
@honkycat

honkycat commented Mar 7, 2018

ISSUE TYPE
  • Bug Report
  • Documentation Report
COMPONENT NAME

ansible helm

ANSIBLE VERSION
ansible 2.4.3.0
  config file = /home/cresten/.ansible.cfg
  configured module search path = [u'/home/cresten/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/cresten/.local/lib/python2.7/site-packages/ansible
  executable location = /home/cresten/.local/bin/ansible
  python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]

OS / ENVIRONMENT

Pop!_OS

SUMMARY

The ansible helm module doesn't work in any capacity, and is so broken that I do not see any possible use case.

In my opinion, it is misleading to feature the helm module in the Ansible documentation, and then it being so broken that when someone tries to use it, they are left holding the bag.

The code quality is so bad on the helm module that it fails to do even the most basic of operations: install helm charts

Example issue:

#32911

A 403 being returned when attempting to read a chart is not properly handled, but rather, throws an internal error:

#33545

In order to use the helm module you need to expose your tiller to the outside world, which is both insecure and completely unnecessary:

#32513

This module does not work. It does not implement even basic helm features, and when it attempts to do so, it fails to get them working.

This whole module is extremely sloppy and shouldn't be advertised as a feature.

STEPS TO REPRODUCE

Attempt to use the helm module in any capacity.

EXPECTED RESULTS

It implements the features it claims to.

ACTUAL RESULTS

It fails to execute even the most basic of operations: Installing helm charts.

@honkycat honkycat changed the title from Ansible Helm completely broken, should not advertised in the documentation and should not be in ansible contrib. to Ansible helm completely broken, should not advertised in the documentation and should not be in ansible contrib. Mar 7, 2018

@honkycat honkycat changed the title from Ansible helm completely broken, should not advertised in the documentation and should not be in ansible contrib. to Ansible helm completely broken, should not advertised be in the documentation and should not be in ansible contrib. Mar 7, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Mar 7, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Mar 7, 2018

@flaper87

This comment has been minimized.

Contributor

flaper87 commented Mar 8, 2018

FWIW, I agree! When this module was originally proposed, I had more time to work on it and maintain it. Things have changed and I've been trying to find folks interested in helping out with it.

So far I've only found angry users and it's unfair to them to keep it around in this state so I would be in favor of removing it unless someone wants to maintain it.

@honkycat would you be willing to help?

@honkycat

This comment has been minimized.

honkycat commented Mar 8, 2018

@flaper87 Yes, absolutely, this is something I'm completely capable of helping with and I'd love to contribute.

I'll take a look at fixing #32513 tonight.

@abadger

This comment has been minimized.

Member

abadger commented Mar 9, 2018

@honkycat Cool. You can add your github IRC nick to the .github/BOTMETA.yml file when you add a PR for the helm module as well. (That will get you notified of new tickets and PRs against the helm module and a few additional commands you can use with the bot to approve and merge PRs).

@flaper87

This comment has been minimized.

Contributor

flaper87 commented Mar 10, 2018

@honkycat thanks a lot. I look forward to your contributions. 🤘👐

@honkycat

This comment has been minimized.

honkycat commented Mar 15, 2018

Ahhh, actually I take it back @flaper87 Helm is just not a good tool to use in kubernetes development. It's under-powered templating engine prevents you from writing decent abstractions to kubernetes resources. How many times am I going to have to copy and paste:

metadata:
  name: {{ template "application.fullname" . }}
  labels:
    app: {{ template "application.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"

I recently ported all of my helm charts to Ansible.k8s_raw and i'm MUCH happier.

@honkycat honkycat closed this Mar 15, 2018

@jlegrone

This comment has been minimized.

@maver1ck maver1ck referenced this issue Jul 13, 2018

Closed

Support for helm deployed apps on k8s cluster. #661

3 of 5 tasks complete
@geerlingguy

This comment has been minimized.

Contributor

geerlingguy commented Sep 5, 2018

So... uh... is the module actually maintained/meant to be used now? Or should it be removed from Ansible until there's a reliable maintainer for the module? It's not clear from this issue if anyone ever picked up the mantle.

@geerlingguy

This comment has been minimized.

Contributor

geerlingguy commented Sep 5, 2018

Putting a few notes here, just in case I pop into this issue again while debugging in the future.

Firstly, to be able to use the helm module at all, I needed to add the following dependencies:

- name: Ensure Pip and dev dependencies are installed.
  package:
    name:
      - python-pip
      - python-dev
      - libgit2-dev
    state: present

- name: Ensure pyhelm and dependencies are installed.
  pip:
    name:
      - pygit2==0.24
      - pyhelm
    state: present

(Note the specific version of pygit2... for some reason you can't install the latest version due to some incompatibility that will kill the pyhelm installation.)

Then when using the module, you must supply a source and version when creating a chart, they are not optional (though it would be nice to have them optional).

And the errors you get when you miss something aren't super user-friendly, e.g.:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'version'
fatal: [master]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_mtWGBo/ansible_module_helm.py\", line 190, in <module>\n    main()\n  File \"/tmp/ansible_mtWGBo/ansible_module_helm.py\", line 178, in main\n    rst = install(module, tserver)\n  File \"/tmp/ansible_mtWGBo/ansible_module_helm.py\", line 109, in install\n    chartb = chartbuilder.ChartBuilder(chart)\n  File \"/usr/local/lib/python2.7/dist-packages/pyhelm/chartbuilder.py\", line 47, in __init__\n    self.source_directory = self.source_clone()\n  File \"/usr/local/lib/python2.7/dist-packages/pyhelm/chartbuilder.py\", line 80, in source_clone\n    self.chart.version)\nKeyError: 'version'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

It may be simpler to just use command and pass things off to helm directly currently.

(Though I'm partially with @honkycat in the slight disdain for Helm, philosophically... I don't know if I'm a fan of it yet, as it's usually caused more pain and grief than solved issues I've had with deploying my own manifests... Might eat my words someday, but right now I lean towards not using Helm.)

As if to confirm the fragility... if I forget to add the explicit host as well, I get an error like:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, Connect Failed)>
fatal: [master]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_PTJWXJ/ansible_module_helm.py\", line 190, in <module>\n    main()\n  File \"/tmp/ansible_PTJWXJ/ansible_module_helm.py\", line 178, in main\n    rst = install(module, tserver)\n  File \"/tmp/ansible_PTJWXJ/ansible_module_helm.py\", line 110, in install\n    r_matches = (x for x in tserver.list_releases()\n  File \"/usr/local/lib/python2.7/dist-packages/pyhelm/tiller.py\", line 68, in list_releases\n    for y in release_list:\n  File \"/usr/local/lib/python2.7/dist-packages/grpc/_channel.py\", line 367, in next\n    return self._next()\n  File \"/usr/local/lib/python2.7/dist-packages/grpc/_channel.py\", line 358, in _next\n    raise self\ngrpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, Connect Failed)>\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
@webknjaz

This comment has been minimized.

Member

webknjaz commented Sep 21, 2018

@geerlingguy it looks like nobody picked it up by now: https://github.com/ansible/ansible/blob/devel/.github/BOTMETA.yml#L114-L119

Do you want to maintain it?

@medined

This comment has been minimized.

medined commented Nov 18, 2018

I spend quite a bit of time today trying to install a chart via the helm module. I think pyhelm is being installed correctly with the following Ansible playbook. However, the Helm module can't find it.

You'll notice some funkiness with the requests module. I don't know if I've handled the situation correctly, but pyhelm does seem to be installed so I'm going with the hack. If there is a better process please let me know.

Here is my playbook:

---
- hosts: nodes
  gather_facts: no

  tasks:

  - name: Ensure EPEL is enabled
    yum:
      name: epel-release
      state: present
    become: True

  - name: upgrade all packages
    yum:
      name: "*"
      state: latest
    become: True

  - name: Ensure Pip and dev dependencies are installed.
    package:
      name:
        - gcc
        - libgit2-devel-0.26.8
        - python-devel
        - python-pip
      state: present
    become: True

  - name: force upgrade of pip itself.
    pip:
      name: pip
      state: latest
    become: True

  - name: Ensure pygit2 is installed.
    pip:
      name:
        - pygit2==0.26
      state: present

  - name: Ensure pyhelm is installed.
    pip:
      name:
        - pyhelm
      extra_args: --ignore-installed requests
      state: present

  - name: Install older version of requests for pyhelm
    pip:
      name:
        - requests==2.14.2
      state: present

  - name: Ensure pyhelm is installed.
    pip:
      name:
        - pyhelm
      state: present

  - name: Install helm chart
    helm:
      host: localhost
      chart:
        name: memcached
        version: 0.4.0
        source:
          type: repo
          location: https://kubernetes-charts.storage.googleapis.com
      state: present
      name: my-memcached
      namespace: default

Everything works until the last step. Then I see the following message:

FAILED! => {"changed": false, "msg": "Could not import the pyhelm python module. Please install `pyhelm` package."}

Running pip install pyhelm on the node shows that it is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment