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

bug: Configuring kube-vip flags fails, cannot unmarshal bool into Go struct field #315

Open
hackaholic opened this issue Mar 17, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@hackaholic
Copy link

Summary

Configuring kube-vip flags fails, cannot unmarshal bool into Go struct field

rke2_kubevip_args: []
- param: lb_enable
   value: true
- param: lb_port
   value: 6443

Below error:
this error from rke2-server

level=error msg="Failed to process config: failed to process /var/lib/rancher/rke2/server/manifests/kube-vip.yml: failed to create kube-system/kube-vip-ds apps/v1, Kind=DaemonSet for kube-system/kube-vip: DaemonSet in version "v1" cannot be handled as a DaemonSet: json: cannot unmarshal bool into Go struct field EnvVar.spec.template.spec.containers.env.value of type string"

Issue Type

Bug Report

Ansible Version

ansible [core 2.17.8]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/parallel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/parallel/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Steps to Reproduce

Configure kube-vip and pass extra parameter to kube-vip

rke2_kubevip_args: []
- param: lb_enable
   value: true
- param: lb_port
   value: 6443

Expected Results

The kube-vip.yml.j2 should render correctly.

Actual Results

The kube-vip.yml.j2 should render correctly.
@hackaholic hackaholic added the bug Something isn't working label Mar 17, 2025
@hackaholic
Copy link
Author

Fix: Update the template: https://github.com/lablabs/ansible-role-rke2/blob/main/templates/kube-vip/kube-vip.yml.j2

Line -> 69,70, add double quotes

{% for item in rke2_kubevip_args %}
        - name: {{ item.param }}
          value: {{ item.value }}
{% endfor %}

Below is changes need to be added

{% for item in rke2_kubevip_args %}
        - name:"{{ item.param }}"
          value: "{{ item.value }}"
{% endfor %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant