actualized for kubespray version 2.28.0

This commit is contained in:
2025-06-15 20:25:45 +03:00
parent c819d4f51f
commit c2df2abc78
366 changed files with 9939 additions and 40388 deletions

View File

@@ -1,14 +1,7 @@
---
- name: Cilium | Start Resources
kube:
name: "{{ item.item.name }}"
namespace: "kube-system"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.item.type }}"
filename: "{{ kube_config_dir }}/{{ item.item.name }}-{{ item.item.file }}"
state: "latest"
loop: "{{ cilium_node_manifests.results }}"
when: inventory_hostname == groups['kube_control_plane'][0] and not item is skipped
- name: Cilium | Install
command: "{{ bin_dir }}/cilium install --version {{ cilium_version }} -f {{ kube_config_dir }}/cilium-values.yaml"
when: inventory_hostname == groups['kube_control_plane'][0]
- name: Cilium | Wait for pods to run
command: "{{ kubectl }} -n kube-system get pods -l k8s-app=cilium -o jsonpath='{.items[?(@.status.containerStatuses[0].ready==false)].metadata.name}'" # noqa literal-compare
@@ -19,15 +12,218 @@
failed_when: false
when: inventory_hostname == groups['kube_control_plane'][0]
- name: Cilium | Hubble install
kube:
name: "{{ item.item.name }}"
namespace: "kube-system"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.item.type }}"
filename: "{{ kube_config_dir }}/addons/hubble/{{ item.item.name }}-{{ item.item.file }}"
state: "latest"
loop: "{{ cilium_hubble_manifests.results }}"
- name: Cilium | Wait for CiliumLoadBalancerIPPool CRD to be present
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumloadbalancerippools.cilium.io"
register: cillium_lbippool_crd_ready
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
failed_when: false
when:
- inventory_hostname == groups['kube_control_plane'][0] and not item is skipped
- cilium_enable_hubble and cilium_hubble_install
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_loadbalancer_ip_pools is defined and (cilium_loadbalancer_ip_pools|length>0)
- name: Cilium | Create CiliumLoadBalancerIPPool manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
with_items:
- {name: cilium, file: cilium-loadbalancer-ip-pool.yml, type: CiliumLoadBalancerIPPool}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_lbippool_crd_ready is defined and cillium_lbippool_crd_ready.rc is defined and cillium_lbippool_crd_ready.rc == 0
- cilium_loadbalancer_ip_pools is defined and (cilium_loadbalancer_ip_pools|length>0)
- name: Cilium | Apply CiliumLoadBalancerIPPool from cilium_loadbalancer_ip_pools
kube:
name: "{{ item.name }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.type }}"
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
state: "latest"
loop:
- {name: cilium, file: cilium-loadbalancer-ip-pool.yml, type: CiliumLoadBalancerIPPool}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_lbippool_crd_ready is defined and cillium_lbippool_crd_ready.rc is defined and cillium_lbippool_crd_ready.rc == 0
- cilium_loadbalancer_ip_pools is defined and (cilium_loadbalancer_ip_pools|length>0)
- name: Cilium | Wait for CiliumBGPPeeringPolicy CRD to be present
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgppeeringpolicies.cilium.io"
register: cillium_bgpppolicy_crd_ready
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
failed_when: false
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_peering_policies is defined and (cilium_bgp_peering_policies|length>0)
- name: Cilium | Create CiliumBGPPeeringPolicy manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
with_items:
- {name: cilium, file: cilium-bgp-peering-policy.yml, type: CiliumBGPPeeringPolicy}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgpppolicy_crd_ready is defined and cillium_bgpppolicy_crd_ready.rc is defined and cillium_bgpppolicy_crd_ready.rc == 0
- cilium_bgp_peering_policies is defined and (cilium_bgp_peering_policies|length>0)
- name: Cilium | Apply CiliumBGPPeeringPolicy from cilium_bgp_peering_policies
kube:
name: "{{ item.name }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.type }}"
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
state: "latest"
loop:
- {name: cilium, file: cilium-bgp-peering-policy.yml, type: CiliumBGPPeeringPolicy}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgpppolicy_crd_ready is defined and cillium_bgpppolicy_crd_ready.rc is defined and cillium_bgpppolicy_crd_ready.rc == 0
- cilium_bgp_peering_policies is defined and (cilium_bgp_peering_policies|length>0)
- name: Cilium | Wait for CiliumBGPClusterConfig CRD to be present
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgpclusterconfigs.cilium.io"
register: cillium_bgpcconfig_crd_ready
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
failed_when: false
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_cluster_configs is defined and (cilium_bgp_cluster_configs|length>0)
- name: Cilium | Create CiliumBGPClusterConfig manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
with_items:
- {name: cilium, file: cilium-bgp-cluster-config.yml, type: CiliumBGPClusterConfig}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgpcconfig_crd_ready is defined and cillium_bgpcconfig_crd_ready.rc is defined and cillium_bgpcconfig_crd_ready.rc == 0
- cilium_bgp_cluster_configs is defined and (cilium_bgp_cluster_configs|length>0)
- name: Cilium | Apply CiliumBGPClusterConfig from cilium_bgp_cluster_configs
kube:
name: "{{ item.name }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.type }}"
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
state: "latest"
loop:
- {name: cilium, file: cilium-bgp-cluster-config.yml, type: CiliumBGPClusterConfig}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgpcconfig_crd_ready is defined and cillium_bgpcconfig_crd_ready.rc is defined and cillium_bgpcconfig_crd_ready.rc == 0
- cilium_bgp_cluster_configs is defined and (cilium_bgp_cluster_configs|length>0)
- name: Cilium | Wait for CiliumBGPPeerConfig CRD to be present
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgppeerconfigs.cilium.io"
register: cillium_bgppconfig_crd_ready
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
failed_when: false
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_peer_configs is defined and (cilium_bgp_peer_configs|length>0)
- name: Cilium | Create CiliumBGPPeerConfig manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
with_items:
- {name: cilium, file: cilium-bgp-peer-config.yml, type: CiliumBGPPeerConfig}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgppconfig_crd_ready is defined and cillium_bgppconfig_crd_ready.rc is defined and cillium_bgppconfig_crd_ready.rc == 0
- cilium_bgp_peer_configs is defined and (cilium_bgp_peer_configs|length>0)
- name: Cilium | Apply CiliumBGPPeerConfig from cilium_bgp_peer_configs
kube:
name: "{{ item.name }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.type }}"
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
state: "latest"
loop:
- {name: cilium, file: cilium-bgp-peer-config.yml, type: CiliumBGPPeerConfig}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgppconfig_crd_ready is defined and cillium_bgppconfig_crd_ready.rc is defined and cillium_bgppconfig_crd_ready.rc == 0
- cilium_bgp_peer_configs is defined and (cilium_bgp_peer_configs|length>0)
- name: Cilium | Wait for CiliumBGPAdvertisement CRD to be present
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgpadvertisements.cilium.io"
register: cillium_bgpadvert_crd_ready
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
failed_when: false
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
- name: Cilium | Create CiliumBGPAdvertisement manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
with_items:
- {name: cilium, file: cilium-bgp-advertisement.yml, type: CiliumBGPAdvertisement}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgpadvert_crd_ready is defined and cillium_bgpadvert_crd_ready.rc is defined and cillium_bgpadvert_crd_ready.rc == 0
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
- name: Cilium | Apply CiliumBGPAdvertisement from cilium_bgp_advertisements
kube:
name: "{{ item.name }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.type }}"
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
state: "latest"
loop:
- {name: cilium, file: cilium-bgp-advertisement.yml, type: CiliumBGPAdvertisement}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cillium_bgpadvert_crd_ready is defined and cillium_bgpadvert_crd_ready.rc is defined and cillium_bgpadvert_crd_ready.rc == 0
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
- name: Cilium | Wait for CiliumBGPNodeConfigOverride CRD to be present
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgpnodeconfigoverrides.cilium.io"
register: cilium_bgp_node_config_crd_ready
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
failed_when: false
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
- name: Cilium | Create CiliumBGPNodeConfigOverride manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
with_items:
- {name: cilium, file: cilium-bgp-node-config-override.yml, type: CiliumBGPNodeConfigOverride}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_node_config_crd_ready is defined and cilium_bgp_node_config_crd_ready.rc is defined and cilium_bgp_node_config_crd_ready.rc == 0
- cilium_bgp_node_config_overrides is defined and (cilium_bgp_node_config_overrides|length>0)
- name: Cilium | Apply CiliumBGPNodeConfigOverride from cilium_bgp_node_config_overrides
kube:
name: "{{ item.name }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.type }}"
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
state: "latest"
loop:
- {name: cilium, file: cilium-bgp-node-config-override.yml, type: CiliumBGPNodeConfigOverride}
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_bgp_node_config_crd_ready is defined and cilium_bgp_node_config_crd_ready.rc is defined and cilium_bgp_node_config_crd_ready.rc == 0
- cilium_bgp_node_config_overrides is defined and (cilium_bgp_node_config_overrides|length>0)

View File

@@ -18,13 +18,13 @@
when:
- cilium_ipsec_enabled is defined
- cilium_ipsec_enabled
- kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin == 'cilium' or cilium_deploy_additionally
- name: Stop if kernel version is too low for Cilium Wireguard encryption
assert:
that: ansible_kernel.split('-')[0] is version('5.6.0', '>=')
when:
- kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin == 'cilium' or cilium_deploy_additionally
- cilium_encryption_enabled
- cilium_encryption_type == "wireguard"
- not ignore_assert_errors
@@ -48,9 +48,9 @@
msg: "cilium_encryption_type must be either 'ipsec' or 'wireguard'"
when: cilium_encryption_enabled
- name: Stop if cilium_version is < v1.10.0
- name: Stop if cilium_version is < {{ cilium_min_version_required }}
assert:
that: cilium_version | regex_replace('v') is version(cilium_min_version_required, '>=')
that: cilium_version is version(cilium_min_version_required, '>=')
msg: "cilium_version is too low. Minimum version {{ cilium_min_version_required }}"
# TODO: Clean this task up when we drop backward compatibility support for `cilium_ipsec_enabled`

View File

@@ -30,58 +30,6 @@
when:
- cilium_identity_allocation_mode == "kvstore"
- name: Cilium | Create hubble dir
file:
path: "{{ kube_config_dir }}/addons/hubble"
state: directory
owner: root
group: root
mode: "0755"
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_hubble_install
- name: Cilium | Create Cilium node manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
mode: "0644"
loop:
- {name: cilium, file: config.yml, type: cm}
- {name: cilium-operator, file: crb.yml, type: clusterrolebinding}
- {name: cilium-operator, file: cr.yml, type: clusterrole}
- {name: cilium, file: crb.yml, type: clusterrolebinding}
- {name: cilium, file: cr.yml, type: clusterrole}
- {name: cilium, file: secret.yml, type: secret, when: "{{ cilium_encryption_enabled and cilium_encryption_type == 'ipsec' }}"}
- {name: cilium, file: ds.yml, type: ds}
- {name: cilium-operator, file: deploy.yml, type: deploy}
- {name: cilium-operator, file: sa.yml, type: sa}
- {name: cilium, file: sa.yml, type: sa}
register: cilium_node_manifests
when:
- inventory_hostname in groups['kube_control_plane']
- item.when | default(True) | bool
- name: Cilium | Create Cilium Hubble manifests
template:
src: "{{ item.name }}/{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/addons/hubble/{{ item.name }}-{{ item.file }}"
mode: "0644"
loop:
- {name: hubble, file: config.yml, type: cm}
- {name: hubble, file: crb.yml, type: clusterrolebinding}
- {name: hubble, file: cr.yml, type: clusterrole}
- {name: hubble, file: cronjob.yml, type: cronjob, when: "{{ cilium_hubble_tls_generate }}"}
- {name: hubble, file: deploy.yml, type: deploy}
- {name: hubble, file: job.yml, type: job, when: "{{ cilium_hubble_tls_generate }}"}
- {name: hubble, file: sa.yml, type: sa}
- {name: hubble, file: service.yml, type: service}
register: cilium_hubble_manifests
when:
- inventory_hostname == groups['kube_control_plane'][0]
- cilium_enable_hubble and cilium_hubble_install
- item.when | default(True) | bool
- name: Cilium | Enable portmap addon
template:
src: 000-cilium-portmap.conflist.j2
@@ -89,6 +37,14 @@
mode: "0644"
when: cilium_enable_portmap
- name: Cilium | Render values
template:
src: values.yaml.j2
dest: "{{ kube_config_dir }}/cilium-values.yaml"
mode: "0644"
when:
- inventory_hostname == groups['kube_control_plane'][0]
- name: Cilium | Copy Ciliumcli binary from download dir
copy:
src: "{{ local_release_dir }}/cilium"