-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add kube-vip as a service load balancer #432
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
95e5284
add kube-vip as a service load balancer
gereonvey 278d9fe
Merge branch 'master' into kube-vip
gereonvey 0c266f0
mend contract
gereonvey 17d405b
fix for multiple IP ranges with kube-vip lb
gereonvey 91b2d1e
simplify configuration
gereonvey 11105f6
add molecule scenario kube-vip
gereonvey b428cc0
Merge branch 'techno-tim:master' into kube-vip
gereonvey ba3101a
Merge branch 'master' into kube-vip
timothystewart6 d4f7ebc
fix pre-commit errors
gereonvey ee0d5c5
enable molecule scenario kube-vip in CI
gereonvey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ jobs: | |
- ipv6 | ||
- single_node | ||
- calico | ||
- kube-vip | ||
fail-fast: false | ||
env: | ||
PYTHON_VERSION: "3.11" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
platforms: | ||
- name: control1 | ||
box: generic/ubuntu2204 | ||
memory: 4096 | ||
cpus: 4 | ||
config_options: | ||
# We currently can not use public-key based authentication on Ubuntu 22.04, | ||
# see: https://github.com/chef/bento/issues/1405 | ||
ssh.username: "vagrant" | ||
ssh.password: "vagrant" | ||
groups: | ||
- k3s_cluster | ||
- master | ||
interfaces: | ||
- network_name: private_network | ||
ip: 192.168.30.62 | ||
provisioner: | ||
name: ansible | ||
env: | ||
ANSIBLE_VERBOSITY: 1 | ||
playbooks: | ||
converge: ../resources/converge.yml | ||
side_effect: ../resources/reset.yml | ||
verify: ../resources/verify.yml | ||
inventory: | ||
links: | ||
group_vars: ../../inventory/sample/group_vars | ||
scenario: | ||
test_sequence: | ||
- dependency | ||
- cleanup | ||
- destroy | ||
- syntax | ||
- create | ||
- prepare | ||
- converge | ||
# idempotence is not possible with the playbook in its current form. | ||
- verify | ||
# We are repurposing side_effect here to test the reset playbook. | ||
# This is why we do not run it before verify (which tests the cluster), | ||
# but after the verify step. | ||
- side_effect | ||
- cleanup | ||
- destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
- name: Apply overrides | ||
hosts: all | ||
tasks: | ||
- name: Override host variables | ||
ansible.builtin.set_fact: | ||
# See: | ||
# https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant | ||
flannel_iface: eth1 | ||
|
||
# The test VMs might be a bit slow, so we give them more time to join the cluster: | ||
retry_count: 45 | ||
|
||
# Make sure that our IP ranges do not collide with those of the other scenarios | ||
apiserver_endpoint: "192.168.30.225" | ||
# Use kube-vip instead of MetalLB | ||
kube_vip_lb_ip_range: "192.168.30.110-192.168.30.119" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: Create manifests directory on first master | ||
file: | ||
path: /var/lib/rancher/k3s/server/manifests | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
when: ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] | ||
|
||
- name: Download vip cloud provider manifest to first master | ||
ansible.builtin.get_url: | ||
url: "https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/{{ kube_vip_cloud_provider_tag_version | default('main') }}/manifest/kube-vip-cloud-controller.yaml" # noqa yaml[line-length] | ||
dest: "/var/lib/rancher/k3s/server/manifests/kube-vip-cloud-controller.yaml" | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
when: ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] | ||
|
||
- name: Copy kubevip configMap manifest to first master | ||
template: | ||
src: "kubevip.yaml.j2" | ||
dest: "/var/lib/rancher/k3s/server/manifests/kubevip.yaml" | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
when: ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kubevip | ||
namespace: kube-system | ||
data: | ||
{% if kube_vip_lb_ip_range is string %} | ||
{# kube_vip_lb_ip_range was used in the legacy way: single string instead of a list #} | ||
{# => transform to list with single element #} | ||
{% set kube_vip_lb_ip_range = [kube_vip_lb_ip_range] %} | ||
{% endif %} | ||
range-global: {{ kube_vip_lb_ip_range | join(',') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may need to add
metal_lb_ip_range: ""
to unset this since the default is set.