Skip to content
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

set_values not being deployed with helm #732

Closed
vivian-rook opened this issue May 29, 2024 · 5 comments
Closed

set_values not being deployed with helm #732

vivian-rook opened this issue May 29, 2024 · 5 comments

Comments

@vivian-rook
Copy link

SUMMARY

Addition of set_values to helm not detected

ISSUE TYPE
  • Bug Report
COMPONENT NAME

kubernetes.core.helm

ANSIBLE VERSION
$ ansible --version
ansible [core 2.16.7]
  config file = None
  configured module search path = ['/home/rook/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rook/paws/.venv/deploy/lib/python3.11/site-packages/ansible
  ansible collection location = /home/rook/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rook/paws/.venv/deploy/bin/ansible
  python version = 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (/home/rook/paws/.venv/deploy/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
$ ansible-galaxy collection list community.general

# /home/rook/paws/.venv/deploy/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 8.6.1
CONFIGURATION
CONFIG_FILE() = /home/rook/paws/ansible/ansible.cfg
DEFAULT_STDOUT_CALLBACK(/home/rook/paws/ansible/ansible.cfg) = debug
EDITOR(env: EDITOR) = vim

OS / ENVIRONMENT

Debian 12

STEPS TO REPRODUCE

Deploy ingress-nginx first without set_values:

    - name: Deploy ingress-nginx
      kubernetes.core.helm:
        name: ingress-nginx
        chart_ref: ingress-nginx
        chart_repo_url: https://kubernetes.github.io/ingress-nginx
        chart_version: 4.10.1
        release_namespace: ingress-nginx
        create_namespace: true

Deploy again with set_values:

    - name: Deploy ingress-nginx
      kubernetes.core.helm:
        name: ingress-nginx
        chart_ref: ingress-nginx
        chart_repo_url: https://kubernetes.github.io/ingress-nginx
        chart_version: 4.10.1
        release_namespace: ingress-nginx
        create_namespace: true
        set_values:
          - value: controller.service.type=NodePort
            value_type: string
          - value: controller.service.enableHttps=false
            value_type: string
          - value: controller.service.nodePorts.http=30001
            value_type: string
          - value: controller.config.proxy-body-size=4m
            value_type: string
          - value: controller.config.allow-snippet-annotations=true
            value_type: string

EXPECTED RESULTS

set values are deployed. NodePort used, port 30001 set, etc.

ACTUAL RESULTS

set values are not deployed. ingress-nginx remains on default with load balancer rather than NodePort
Seen with kubectl get all -n ingress-nginx

Of note. This does seem to work if the set_values are set and deploy to a newly deploy k8s cluster. But does not seem to work as an update to an existing deployment. Also the set_values can be removed from an existing deployment, but then will not be added back if added back to the playbook.

@gravesm
Copy link
Member

gravesm commented May 29, 2024

I'm not able to reproduce this problem. What version of the collection are you using? You provided the version for community.general, not kubernetes.core.

@vivian-rook
Copy link
Author

How do I get the version of kubernetes.core?

@gravesm
Copy link
Member

gravesm commented May 29, 2024

$ ansible-galaxy collection list kubernetes.core

@vivian-rook
Copy link
Author

$ ansible-galaxy collection list kubernetes.core

# /home/rook/paws/.venv/deploy/lib/python3.11/site-packages/ansible_collections
Collection      Version
--------------- -------
kubernetes.core 2.4.2  

@gravesm
Copy link
Member

gravesm commented May 30, 2024

This was fixed in version 3.0.1. You can also use force: true in your second deploy task, but I would just recommend upgrading to the latest version (4.0.0). There have been a number of bugfixes to the helm module since 2.4.2.

@gravesm gravesm closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants