Pick kube-vip interface automatically by default (#238)

* Pick kube-vip interface automatically by default

* molecule: Fix ipv6 scenario

* Choose a more restrictive molecule timeout in CI
This commit is contained in:
Simon Leiner 2023-02-20 05:08:36 +01:00 committed by GitHub
parent 65bbc8e2ac
commit 7bc198ab26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -71,6 +71,7 @@ jobs:
- name: Test with molecule - name: Test with molecule
run: molecule test --scenario-name ${{ matrix.scenario }} run: molecule test --scenario-name ${{ matrix.scenario }}
timeout-minutes: 90
env: env:
ANSIBLE_K3S_LOG_DIR: ${{ runner.temp }}/logs/k3s-ansible/${{ matrix.scenario }} ANSIBLE_K3S_LOG_DIR: ${{ runner.temp }}/logs/k3s-ansible/${{ matrix.scenario }}
ANSIBLE_SSH_RETRIES: 4 ANSIBLE_SSH_RETRIES: 4

View File

@ -7,6 +7,11 @@
# See: https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant # noqa yaml[line-length] # See: https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant # noqa yaml[line-length]
flannel_iface: eth1 flannel_iface: eth1
# In this scenario, we have multiple interfaces that the VIP could be
# broadcasted on. Since we have assigned a dedicated private network
# here, let's make sure that it is used.
kube_vip_iface: eth1
# The test VMs might be a bit slow, so we give them more time to join the cluster: # The test VMs might be a bit slow, so we give them more time to join the cluster:
retry_count: 45 retry_count: 45

View File

@ -1,4 +1,9 @@
--- ---
# If you want to explicitly define an interface that ALL control nodes
# should use to propagate the VIP, define it here. Otherwise, kube-vip
# will determine the right interface automatically at runtime.
kube_vip_iface: null
server_init_args: >- server_init_args: >-
{% if groups['master'] | length > 1 %} {% if groups['master'] | length > 1 %}
{% if ansible_hostname == hostvars[groups['master'][0]]['ansible_hostname'] %} {% if ansible_hostname == hostvars[groups['master'][0]]['ansible_hostname'] %}

View File

@ -30,8 +30,10 @@ spec:
value: "true" value: "true"
- name: port - name: port
value: "6443" value: "6443"
{% if kube_vip_iface %}
- name: vip_interface - name: vip_interface
value: {{ flannel_iface }} value: {{ kube_vip_iface }}
{% endif %}
- name: vip_cidr - name: vip_cidr
value: "{{ apiserver_endpoint | ansible.utils.ipsubnet | ansible.utils.ipaddr('prefix') }}" value: "{{ apiserver_endpoint | ansible.utils.ipsubnet | ansible.utils.ipaddr('prefix') }}"
- name: cp_enable - name: cp_enable