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

MetalLB server tasks causing error when cilium is not being defined. #514

Closed
Rina-Y opened this issue May 14, 2024 · 2 comments
Closed

MetalLB server tasks causing error when cilium is not being defined. #514

Rina-Y opened this issue May 14, 2024 · 2 comments

Comments

@Rina-Y
Copy link
Contributor

Rina-Y commented May 14, 2024

I was running this collection via galaxy for a larger system I am setting up, and I had decided not to use cilium since it looks like it's still being worked on and went with the default flannel for now.

I only included the group_vars I needed, excluding all vars for cilium and calico. I received an error when it was trying to call the metallb tasks in both the k3s_server and k3s_server_post roles. I just quickly fixed it for myself in my collection copy, then have set up a pull request to fix it.

Here is the actual error:

FAILED! => {"msg": "The conditional check 'kube_vip_lb_ip_range is not defined and (not cilium_bgp or cilium_iface is not defined)' failed. The error was: error while evaluating conditional (kube_vip_lb_ip_range is not defined and (not cilium_bgp or cilium_iface is not defined)): 'cilium_bgp' is undefined. 'cilium_bgp' is undefined\n\nThe error appears to be in '~/.ansible/collections/ansible_collections/techno_tim/k3s_ansible/roles/k3s_server_post/tasks/main.yml': line 12, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Deploy metallb pool\n  ^ here\n"}

See #513 for the fix.

@Rina-Y
Copy link
Contributor Author

Rina-Y commented May 15, 2024

Additional Information:
My group_vars only included the variables that the sample said was necessary for an installation without using calico or cilium.

These are the included variables, but I used the sample values for timezone, token, and IPs.

---

k3s_version: v1.29.2+k3s1
system_timezone: "Your/Timezone"
systemd_dir: /etc/systemd/system
flannel_iface: "eth0"
apiserver_endpoint: "192.168.30.222"
k3s_token: "some-SUPER-DEDEUPER-secret-password"
k3s_node_ip: "{{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))]['ipv4']['address'] }}"
k3s_master_taint: "{{ true if groups['wvm'] | default([]) | length >= 1 else false }}"
extra_args: >-
  {{ '--flannel-iface=' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '' }}
  --node-ip={{ k3s_node_ip }}
extra_server_args: >-
  {{ extra_args }}
  {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }}
  {% if calico_iface is defined or cilium_iface is defined %}
  --flannel-backend=none
  --disable-network-policy
  --cluster-cidr={{ cluster_cidr | default('10.52.0.0/16') }}
  {% endif %}
  --tls-san {{ apiserver_endpoint }}
  --disable servicelb
  --disable traefik
extra_agent_args: >-
  {{ extra_args }}
kube_vip_tag_version: "v0.7.2"
metal_lb_type: "native"
metal_lb_mode: "layer2"
metal_lb_speaker_tag_version: "v0.14.3"
metal_lb_controller_tag_version: "v0.14.3"
metal_lb_ip_range: "192.168.30.80-192.168.30.90"
group_name_master: 'control'

@timothystewart6
Copy link
Contributor

closed by #513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants