Skip to content

Commit 0070f27

Browse files
committed
2 parents 85b7490 + 1e523a2 commit 0070f27

File tree

39 files changed

+533
-567
lines changed

39 files changed

+533
-567
lines changed

.gitlab-ci/kubevirt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ pr:
4040
- debian11-macvlan
4141
- debian12-cilium
4242
- fedora39-kube-router
43-
# FIXME: this test if broken (perma-failing)
4443
- openeuler24-calico
4544
- rockylinux9-cilium
4645
- ubuntu22-calico-all-in-one
@@ -53,6 +52,7 @@ pr:
5352
- ubuntu24-kube-router-svc-proxy
5453
- ubuntu24-ha-separate-etcd
5554
- flatcar4081-calico
55+
- fedora40-flannel-crio-collection-scale
5656

5757
# The ubuntu24-calico-all-in-one jobs are meant as early stages to prevent running the full CI if something is horribly broken
5858
ubuntu24-calico-all-in-one:

.gitlab-ci/vagrant.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ vagrant:
4040
when: on_success
4141
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PIPELINE_SCHEDULE_DESCRIPTION == "daily-ci"
4242
when: on_success
43+
- when: manual
44+
allow_failure: true
4345
parallel:
4446
matrix:
4547
- TESTCASE:

Vagrantfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# For help on using kubespray with vagrant, check out docs/developers/vagrant.md
55

66
require 'fileutils'
7+
require 'ipaddr'
8+
require 'socket'
79

810
Vagrant.require_version ">= 2.0.0"
911

@@ -99,6 +101,33 @@ $extra_vars ||= {}
99101

100102
host_vars = {}
101103

104+
def collect_networks(subnet, subnet_ipv6)
105+
Socket.getifaddrs.filter_map do |iface|
106+
next unless iface&.netmask&.ip_address && iface.addr
107+
108+
is_ipv6 = iface.addr.ipv6?
109+
ip = IPAddr.new(iface.addr.ip_address.split('%').first)
110+
ip_test = is_ipv6 ? IPAddr.new("#{subnet_ipv6}::0") : IPAddr.new("#{subnet}.0")
111+
112+
prefix = IPAddr.new(iface.netmask.ip_address).to_i.to_s(2).count('1')
113+
network = ip.mask(prefix)
114+
115+
[IPAddr.new("#{network}/#{prefix}"), ip_test]
116+
end
117+
end
118+
119+
def subnet_in_use?(network_ips)
120+
network_ips.any? { |net, test_ip| net.include?(test_ip) && test_ip != net }
121+
end
122+
123+
network_ips = collect_networks($subnet, $subnet_ipv6)
124+
125+
if subnet_in_use?(network_ips)
126+
puts "Invalid subnet provided, subnet is already in use: #{$subnet}.0"
127+
puts "Subnets in use: #{network_ips.inspect}"
128+
exit 1
129+
end
130+
102131
# throw error if os is not supported
103132
if ! SUPPORTED_OS.key?($os)
104133
puts "Unsupported OS: #{$os}"

docs/ansible/ansible.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ The following tags are defined in playbooks:
155155
| win_nodes | Running windows specific tasks |
156156
| youki | Configuring youki runtime |
157157

158-
Note: Use the ``bash scripts/gen_tags.sh`` command to generate a list of all
159-
tags found in the codebase. New tags will be listed with the empty "Used for"
160-
field.
161-
162158
## Example commands
163159

164160
Example command to filter and apply only DNS configuration tasks and skip

docs/ansible/ansible_collection.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
Kubespray can be installed as an [Ansible collection](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html).
44

5-
## Requirements
6-
7-
- An inventory file with the appropriate host groups. See the [README](../README.md#usage).
8-
- A `group_vars` directory. These group variables **need** to match the appropriate variable names under `inventory/local/group_vars`. See the [README](../README.md#usage).
9-
105
## Usage
116

12-
1. Add Kubespray to your requirements.yml file
7+
1. Set up an inventory with the appropriate host groups and required group vars.
8+
See also the documentation on [kubespray inventories](./inventory.md) and the
9+
general ["Getting started" documentation](../getting_started/getting-started.md#building-your-own-inventory).
10+
11+
2. Add Kubespray to your requirements.yml file
1312

1413
```yaml
1514
collections:
@@ -18,20 +17,20 @@ Kubespray can be installed as an [Ansible collection](https://docs.ansible.com/a
1817
version: master # use the appropriate tag or branch for the version you need
1918
```
2019
21-
2. Install your collection
20+
3. Install your collection
2221
2322
```ShellSession
2423
ansible-galaxy install -r requirements.yml
2524
```
2625

27-
3. Create a playbook to install your Kubernetes cluster
26+
4. Create a playbook to install your Kubernetes cluster
2827

2928
```yaml
3029
- name: Install Kubernetes
3130
ansible.builtin.import_playbook: kubernetes_sigs.kubespray.cluster
3231
```
3332
34-
4. Update INVENTORY and PLAYBOOK so that they point to your inventory file and the playbook you created above, and then install Kubespray
33+
5. Update INVENTORY and PLAYBOOK so that they point to your inventory file and the playbook you created above, and then install Kubespray
3534
3635
```ShellSession
3736
ansible-playbook -i INVENTORY --become --become-user=root PLAYBOOK

docs/developers/ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ amazon | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
2828
debian11 | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
2929
debian12 | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
3030
fedora39 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: |
31-
fedora40 | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
31+
fedora40 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: |
3232
flatcar4081 | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
3333
openeuler24 | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
3434
rockylinux9 | :x: | :x: | :x: | :x: | :x: | :x: | :x: |

inventory/sample/group_vars/k8s_cluster/k8s-net-calico.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@ calico_pool_blocksize: 26
2525
# add default ippool CIDR (must be inside kube_pods_subnet, defaults to kube_pods_subnet otherwise)
2626
# calico_pool_cidr: 1.2.3.4/5
2727

28-
# add default ippool CIDR to CNI config
29-
# calico_cni_pool: true
30-
3128
# Add default IPV6 IPPool CIDR. Must be inside kube_pods_subnet_ipv6. Defaults to kube_pods_subnet_ipv6 if not set.
3229
# calico_pool_cidr_ipv6: fd85:ee78:d8a6:8607::1:0000/112
3330

34-
# Add default IPV6 IPPool CIDR to CNI config
35-
# calico_cni_pool_ipv6: true
36-
3731
# Global as_num (/calico/bgp/v1/global/as_num)
3832
# global_as_num: "64512"
3933

inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ cilium_l2announcements: false
175175
### Buffer size of the channel to receive monitor events.
176176
# cilium_hubble_event_queue_size: 50
177177

178+
# Override the DNS suffix that Hubble-Relay uses to resolve its peer service.
179+
# It defaults to the inventory's `dns_domain`.
180+
# cilium_hubble_peer_service_cluster_domain: "{{ dns_domain }}"
181+
178182
# IP address management mode for v1.9+.
179183
# https://docs.cilium.io/en/v1.9/concepts/networking/ipam/
180184
# cilium_ipam_mode: kubernetes

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ansible==10.7.0
22
# Needed for community.crypto module
3-
cryptography==45.0.4
3+
cryptography==45.0.5
44
# Needed for jinja2 json_query templating
55
jmespath==1.0.1
66
# Needed for ansible.utils.ipaddr

roles/etcd/tasks/join_etcd-events_member.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
etcd_events_peer_addresses: >-
2020
{% for host in groups['etcd'] -%}
2121
{%- if hostvars[host]['etcd_events_member_in_cluster'].rc == 0 -%}
22-
{{ "etcd" + loop.index | string }}="https://{{ hostvars[host].etcd_events_access_address | default(hostvars[host]['main_ip']) | ansible.utils.ipwrap }}:2382",
22+
{{ "etcd" + loop.index | string }}=https://{{ hostvars[host].etcd_events_access_address | default(hostvars[host]['main_ip']) | ansible.utils.ipwrap }}:2382,
2323
{%- endif -%}
2424
{%- if loop.last -%}
2525
{{ etcd_member_name }}={{ etcd_events_peer_url }}

0 commit comments

Comments
 (0)