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

@@ -2,22 +2,18 @@
role_name_check: 1
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: adduser-01
box: generic/ubuntu2004
cpus: 1
memory: 512
provider_options:
driver: kvm
- name: ubuntu20
cloud_image: ubuntu-2004
vm_cpu_cores: 1
vm_memory: 512
provisioner:
name: ansible
config_options:
defaults:
callbacks_enabled: profile_tasks
timeout: 120
playbooks:
create: ../../../../tests/cloud_playbooks/create-kubevirt.yml
verifier:
name: testinfra

View File

@@ -2,17 +2,11 @@
role_name_check: 1
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: bastion-01
box: generic/ubuntu2004
cpus: 1
memory: 512
provider_options:
driver: kvm
cloud_image: ubuntu-2004
vm_cpu_cores: 1
vm_memory: 512
provisioner:
name: ansible
config_options:
@@ -27,5 +21,7 @@ provisioner:
bastion:
hosts:
bastion-01:
playbooks:
create: ../../../../tests/cloud_playbooks/create-kubevirt.yml
verifier:
name: testinfra

View File

@@ -1,47 +0,0 @@
---
role_name_check: 1
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: ubuntu20
box: generic/ubuntu2004
cpus: 1
memory: 512
provider_options:
driver: kvm
- name: ubuntu22
box: generic/ubuntu2204
cpus: 1
memory: 1024
provider_options:
driver: kvm
- name: almalinux8
box: almalinux/8
cpus: 1
memory: 512
provider_options:
driver: kvm
- name: debian10
box: generic/debian10
cpus: 1
memory: 512
provider_options:
driver: kvm
provisioner:
name: ansible
config_options:
defaults:
callbacks_enabled: profile_tasks
timeout: 120
inventory:
group_vars:
all:
user:
name: foo
comment: My test comment
verifier:
name: testinfra

View File

@@ -1,64 +1,10 @@
---
- name: Fetch /etc/os-release
raw: cat /etc/os-release
register: os_release
changed_when: false
# This command should always run, even in check mode
check_mode: false
- name: Warn for usage of deprecated role
fail:
msg: bootstrap-os is deprecated, switch to bootstrap_os
ignore_errors: true # noqa ignore-errors
run_once: true
- name: Include distro specifics vars and tasks
vars:
os_release_dict: "{{ os_release.stdout_lines | select('regex', '^.+=.*$') | map('regex_replace', '\"', '') |
map('split', '=') | community.general.dict }}"
block:
- name: Include vars
include_vars: "{{ item }}"
tags:
- facts
with_first_found:
- &search
files:
- "{{ os_release_dict['ID'] }}-{{ os_release_dict['VARIANT_ID'] }}.yml"
- "{{ os_release_dict['ID'] }}.yml"
paths:
- vars/
skip: true
- name: Include tasks
include_tasks: "{{ included_tasks_file }}"
with_first_found:
- <<: *search
paths: []
loop_control:
loop_var: included_tasks_file
- name: Create remote_tmp for it is used by another module
file:
path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
state: directory
mode: "0700"
- name: Gather facts
setup:
gather_subset: '!all'
filter: ansible_*
- name: Assign inventory name to unconfigured hostnames (non-CoreOS, non-Flatcar, Suse and ClearLinux, non-Fedora)
hostname:
name: "{{ inventory_hostname }}"
when: override_system_hostname
- name: Install ceph-commmon package
package:
name:
- ceph-common
state: present
when: rbd_provisioner_enabled | default(false)
- name: Ensure bash_completion.d folder exists
file:
name: /etc/bash_completion.d/
state: directory
owner: root
group: root
mode: "0755"
- name: Compat for direct role import
import_role:
name: bootstrap_os

View File

@@ -2,11 +2,16 @@
## CentOS/RHEL/AlmaLinux specific variables
# Use the fastestmirror yum plugin
centos_fastestmirror_enabled: false
# Timeout (in seconds) for checking RHEL subscription status
rh_subscription_check_timeout: 180
## Flatcar Container Linux specific variables
# Disable locksmithd or leave it in its current state
coreos_locksmithd_disable: false
# Install epel repo on Centos/RHEL
epel_enabled: false
## Oracle Linux specific variables
# Install public repo on Oracle Linux
use_oracle_public_repo: true
@@ -14,6 +19,8 @@ use_oracle_public_repo: true
## Ubuntu specific variables
# Disable unattended-upgrades for Linux kernel and all packages start with linux- on Ubuntu
ubuntu_kernel_unattended_upgrades_disabled: false
# Stop unattended-upgrades if it is currently running on Ubuntu
ubuntu_stop_unattended_upgrades: false
fedora_coreos_packages:
- python
@@ -21,6 +28,7 @@ fedora_coreos_packages:
- ethtool # required in kubeadm preflight phase for verifying the environment
- ipset # required in kubeadm preflight phase for verifying the environment
- conntrack-tools # required by kube-proxy
- containernetworking-plugins # required by crio
## General
# Set the hostname to inventory_hostname

View File

@@ -0,0 +1,3 @@
---
dependencies:
- role: kubespray_defaults

View File

@@ -2,5 +2,6 @@
- name: Converge
hosts: all
gather_facts: false
become: true
roles:
- role: bootstrap-os
- role: bootstrap_os

View File

@@ -0,0 +1,37 @@
---
role_name_check: 1
dependency:
name: galaxy
platforms:
- name: ubuntu20
cloud_image: ubuntu-2004
vm_cpu_cores: 1
vm_memory: 512
- name: ubuntu22
cloud_image: ubuntu-2204
vm_cpu_cores: 1
vm_memory: 512
- name: almalinux9
cloud_image: almalinux-9
vm_cpu_cores: 1
vm_memory: 512
- name: debian12
cloud_image: debian-12
vm_cpu_cores: 1
vm_memory: 512
provisioner:
name: ansible
config_options:
defaults:
callbacks_enabled: profile_tasks
timeout: 120
inventory:
group_vars:
all:
user:
name: foo
comment: My test comment
playbooks:
create: ../../../../tests/cloud_playbooks/create-kubevirt.yml
verifier:
name: testinfra

View File

@@ -108,11 +108,3 @@
when:
- fastestmirror.stat.exists
- not centos_fastestmirror_enabled
# libselinux-python is required on SELinux enabled hosts
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
- name: Install libselinux python package
package:
name: "{{ ((ansible_distribution_major_version | int) < 8) | ternary('libselinux-python', 'python3-libselinux') }}"
state: present
become: true

View File

@@ -23,7 +23,7 @@
- name: Make interpreter discovery works on Flatcar
set_fact:
ansible_interpreter_python_fallback: "{{ ansible_interpreter_python_fallback + [ '/opt/bin/python' ] }}"
ansible_interpreter_python_fallback: "{{ (ansible_interpreter_python_fallback | default([])) + ['/opt/bin/python'] }}"
- name: Disable auto-upgrade
systemd_service:

View File

@@ -0,0 +1,62 @@
---
- name: Fetch /etc/os-release
raw: cat /etc/os-release
register: os_release
changed_when: false
# This command should always run, even in check mode
check_mode: false
- name: Include distro specifics vars and tasks
vars:
os_release_dict: "{{ os_release.stdout_lines | select('regex', '^.+=.*$') | map('regex_replace', '\"', '') |
map('split', '=') | community.general.dict }}"
block:
- name: Include vars
include_vars: "{{ item }}"
tags:
- facts
with_first_found:
- &search
files:
- "{{ os_release_dict['ID'] }}-{{ os_release_dict['VARIANT_ID'] }}.yml"
- "{{ os_release_dict['ID'] }}.yml"
paths:
- vars/
skip: true
- name: Include tasks
include_tasks: "{{ included_tasks_file }}"
with_first_found:
- <<: *search
paths: []
loop_control:
loop_var: included_tasks_file
- name: Install system packages
import_role:
name: system_packages
tags:
- system-packages
- name: Create remote_tmp for it is used by another module
file:
path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
state: directory
mode: "0700"
- name: Gather facts
setup:
gather_subset: '!all'
filter: ansible_*
- name: Assign inventory name to unconfigured hostnames (non-CoreOS, non-Flatcar, Suse and ClearLinux, non-Fedora)
hostname:
name: "{{ inventory_hostname }}"
when: override_system_hostname
- name: Ensure bash_completion.d folder exists
file:
name: /etc/bash_completion.d/
state: directory
owner: root
group: root
mode: "0755"

View File

@@ -28,6 +28,7 @@
register: rh_subscription_status
changed_when: "rh_subscription_status.rc != 0"
ignore_errors: true # noqa ignore-errors
timeout: "{{ rh_subscription_check_timeout }}"
become: true
- name: RHEL subscription Organization ID/Activation Key registration
@@ -92,11 +93,3 @@
when:
- fastestmirror.stat.exists
- not centos_fastestmirror_enabled
# libselinux-python is required on SELinux enabled hosts
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
- name: Install libselinux python package
package:
name: "{{ ((ansible_distribution_major_version | int) < 8) | ternary('libselinux-python', 'python3-libselinux') }}"
state: present
become: true

View File

@@ -19,3 +19,11 @@
when:
- ubuntu_kernel_unattended_upgrades_disabled
- unattended_upgrades_file_stat.stat.exists
- name: Stop unattended-upgrades service
service:
name: unattended-upgrades
state: stopped
enabled: false
become: true
when: ubuntu_stop_unattended_upgrades

View File

@@ -3,15 +3,3 @@
# manager controlled installs to direct download ones.
containerd_package: 'containerd.io'
yum_repo_dir: /etc/yum.repos.d
# Keep minimal repo information around for cleanup
containerd_repo_info:
repos:
# Ubuntu docker-ce repo
containerd_ubuntu_repo_base_url: "https://download.docker.com/linux/ubuntu"
containerd_ubuntu_repo_component: "stable"
# Debian docker-ce repo
containerd_debian_repo_base_url: "https://download.docker.com/linux/debian"
containerd_debian_repo_component: "stable"

View File

@@ -17,8 +17,8 @@ containerd_runc_runtime:
root: ""
base_runtime_spec: cri-base.json
options:
systemdCgroup: "{{ containerd_use_systemd_cgroup | ternary('true', 'false') }}"
binaryName: "{{ bin_dir }}/runc"
SystemdCgroup: "{{ containerd_use_systemd_cgroup | ternary('true', 'false') }}"
BinaryName: "{{ bin_dir }}/runc"
containerd_additional_runtimes: []
# Example for Kata Containers as additional runtime:
@@ -62,8 +62,10 @@ containerd_registries_mirrors:
- host: https://registry-1.docker.io
capabilities: ["pull", "resolve"]
skip_verify: false
# ca: ["/etc/certs/mirror.pem"]
# client: [["/etc/certs/client.pem", ""],["/etc/certs/client.cert", "/etc/certs/client.key"]]
containerd_max_container_log_line_size: -1
containerd_max_container_log_line_size: 16384
# If enabled it will allow non root users to use port numbers <1024
containerd_enable_unprivileged_ports: false
@@ -90,12 +92,9 @@ containerd_registry_auth: []
# Configure containerd service
containerd_limit_proc_num: "infinity"
containerd_limit_core: "infinity"
containerd_limit_open_file_num: "infinity"
containerd_limit_open_file_num: 1048576
containerd_limit_mem_lock: "infinity"
# If enabled it will use config_path and config to be put in {{ containerd_cfg_dir }}/certs.d/
containerd_use_config_path: false
# OS distributions that already support containerd
containerd_supported_distributions:
- "CentOS"
@@ -123,7 +122,7 @@ enable_cdi: false
# For containerd tracing configuration please check out the official documentation:
# https://github.com/containerd/containerd/blob/main/docs/tracing.md
containerd_tracing_enabled: false
containerd_tracing_endpoint: "0.0.0.0:4317"
containerd_tracing_endpoint: "[::]:4317"
containerd_tracing_protocol: "grpc"
containerd_tracing_sampling_ratio: 1.0
containerd_tracing_service_name: "containerd"

View File

@@ -5,5 +5,5 @@
vars:
container_manager: containerd
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: container-engine/containerd

View File

@@ -1,40 +1,30 @@
---
role_name_check: 1
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: ubuntu20
box: generic/ubuntu2004
cpus: 1
memory: 1024
groups:
- cloud_image: ubuntu-2004
name: ubuntu20
vm_cpu_cores: 1
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
- name: debian11
box: generic/debian11
cpus: 1
memory: 1024
groups:
- cloud_image: debian-11
name: debian11
vm_cpu_cores: 1
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
- name: almalinux8
box: almalinux/8
cpus: 1
memory: 1024
groups:
- cloud_image: almalinux-9
name: almalinux9
vm_cpu_cores: 1
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
provisioner:
name: ansible
env:
@@ -43,5 +33,7 @@ provisioner:
defaults:
callbacks_enabled: profile_tasks
timeout: 120
playbooks:
create: ../../../../../tests/cloud_playbooks/create-kubevirt.yml
verifier:
name: testinfra

View File

@@ -6,8 +6,9 @@
vars:
ignore_assert_errors: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- role: kubespray_defaults
- role: bootstrap_os
- role: network_facts
- role: kubernetes/preinstall
- role: adduser
user: "{{ addusers.kube }}"
@@ -25,5 +26,5 @@
ignore_assert_errors: true
kube_network_plugin: cni
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: network_plugin/cni

View File

@@ -1,31 +1,4 @@
---
- name: Fail containerd setup if distribution is not supported
fail:
msg: "{{ ansible_distribution }} is not supported by containerd."
when:
- not (allow_unsupported_distribution_setup | default(false)) and (ansible_distribution not in containerd_supported_distributions)
- name: Containerd | Remove any package manager controlled containerd package
package:
name: "{{ containerd_package }}"
state: absent
when:
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar"))
- name: Containerd | Remove containerd repository
file:
path: "{{ yum_repo_dir }}/containerd.repo"
state: absent
when:
- ansible_os_family in ['RedHat']
- name: Containerd | Remove containerd repository
apt_repository:
repo: "{{ item }}"
state: absent
with_items: "{{ containerd_repo_info.repos }}"
when: ansible_pkg_mgr == 'apt'
- name: Containerd | Download containerd
include_tasks: "../../../download/tasks/download_file.yml"
vars:
@@ -41,21 +14,6 @@
- --strip-components=1
notify: Restart containerd
- name: Containerd | Remove orphaned binary
file:
path: "/usr/bin/{{ item }}"
state: absent
when:
- containerd_bin_dir != "/usr/bin"
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar"))
ignore_errors: true # noqa ignore-errors
with_items:
- containerd
- containerd-shim
- containerd-shim-runc-v1
- containerd-shim-runc-v2
- ctr
- name: Containerd | Generate systemd service for containerd
template:
src: containerd.service.j2
@@ -108,14 +66,13 @@
- name: Containerd | Copy containerd config file
template:
src: config.toml.j2
src: "{{ 'config.toml.j2' if containerd_version is version('2.0.0', '>=') else 'config-v1.toml.j2' }}"
dest: "{{ containerd_cfg_dir }}/config.toml"
owner: "root"
mode: "0640"
notify: Restart containerd
- name: Containerd | Configure containerd registries
when: containerd_registries_mirrors is defined
block:
- name: Containerd | Create registry directories
file:

View File

@@ -1,22 +1,4 @@
---
- name: Containerd | Remove containerd repository for RedHat os family
file:
path: "{{ yum_repo_dir }}/containerd.repo"
state: absent
when:
- ansible_os_family in ['RedHat']
tags:
- reset_containerd
- name: Containerd | Remove containerd repository for Debian os family
apt_repository:
repo: "{{ item }}"
state: absent
with_items: "{{ containerd_repo_info.repos }}"
when: ansible_pkg_mgr == 'apt'
tags:
- reset_containerd
- name: Containerd | Stop containerd service
service:
name: containerd

View File

@@ -0,0 +1,102 @@
# This is for containerd v1 for compatibility
version = 2
root = "{{ containerd_storage_dir }}"
state = "{{ containerd_state_dir }}"
oom_score = {{ containerd_oom_score }}
{% if containerd_extra_args is defined %}
{{ containerd_extra_args }}
{% endif %}
[grpc]
max_recv_message_size = {{ containerd_grpc_max_recv_message_size }}
max_send_message_size = {{ containerd_grpc_max_send_message_size }}
[debug]
address = "{{ containerd_debug_address }}"
level = "{{ containerd_debug_level }}"
format = "{{ containerd_debug_format }}"
uid = {{ containerd_debug_uid }}
gid = {{ containerd_debug_gid }}
[metrics]
address = "{{ containerd_metrics_address }}"
grpc_histogram = {{ containerd_metrics_grpc_histogram | lower }}
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "{{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
max_container_log_line_size = {{ containerd_max_container_log_line_size }}
enable_unprivileged_ports = {{ containerd_enable_unprivileged_ports | lower }}
enable_unprivileged_icmp = {{ containerd_enable_unprivileged_icmp | lower }}
enable_selinux = {{ containerd_enable_selinux | lower }}
disable_apparmor = {{ containerd_disable_apparmor | lower }}
tolerate_missing_hugetlb_controller = {{ containerd_tolerate_missing_hugetlb_controller | lower }}
disable_hugetlb_controller = {{ containerd_disable_hugetlb_controller | lower }}
image_pull_progress_timeout = "{{ containerd_image_pull_progress_timeout }}"
{% if enable_cdi %}
enable_cdi = true
cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"]
{% endif %}
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "{{ containerd_default_runtime }}"
snapshotter = "{{ containerd_snapshotter }}"
discard_unpacked_layers = {{ containerd_discard_unpacked_layers | lower }}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
{% for runtime in [containerd_runc_runtime] + containerd_additional_runtimes %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}]
runtime_type = "{{ runtime.type }}"
runtime_engine = "{{ runtime.engine }}"
runtime_root = "{{ runtime.root }}"
{% if runtime.base_runtime_spec is defined %}
base_runtime_spec = "{{ containerd_cfg_dir }}/{{ runtime.base_runtime_spec }}"
{% endif %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}.options]
{% for key, value in runtime.options.items() %}
{% if value | string != "true" and value | string != "false" %}
{{ key }} = "{{ value }}"
{% else %}
{{ key }} = {{ value }}
{% endif %}
{% endfor %}
{% endfor %}
{% if kata_containers_enabled %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-qemu]
runtime_type = "io.containerd.kata-qemu.v2"
{% endif %}
{% if gvisor_enabled %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runsc]
runtime_type = "io.containerd.runsc.v1"
{% endif %}
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "{{ containerd_cfg_dir }}/certs.d"
{% for registry in containerd_registry_auth if registry['registry'] is defined %}
{% if (registry['username'] is defined and registry['password'] is defined) or registry['auth'] is defined %}
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ registry['registry'] }}".auth]
{% if registry['username'] is defined and registry['password'] is defined %}
password = "{{ registry['password'] }}"
username = "{{ registry['username'] }}"
{% else %}
auth = "{{ registry['auth'] }}"
{% endif %}
{% endif %}
{% endfor %}
{% if nri_enabled and containerd_version is version('1.7.0', '>=') %}
[plugins."io.containerd.nri.v1.nri"]
disable = false
{% endif %}
{% if containerd_tracing_enabled %}
[plugins."io.containerd.tracing.processor.v1.otlp"]
endpoint = "{{ containerd_tracing_endpoint }}"
protocol = "{{ containerd_tracing_protocol }}"
{% if containerd_tracing_protocol == "grpc" %}
insecure = false
{% endif %}
[plugins."io.containerd.internal.v1.tracing"]
sampling_ratio = {{ containerd_tracing_sampling_ratio }}
service_name = "{{ containerd_tracing_service_name }}"
{% endif %}

View File

@@ -1,4 +1,5 @@
version = 2
version = 3
root = "{{ containerd_storage_dir }}"
state = "{{ containerd_state_dir }}"
oom_score = {{ containerd_oom_score }}
@@ -23,8 +24,7 @@ oom_score = {{ containerd_oom_score }}
grpc_histogram = {{ containerd_metrics_grpc_histogram | lower }}
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "{{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
[plugins."io.containerd.cri.v1.runtime"]
max_container_log_line_size = {{ containerd_max_container_log_line_size }}
enable_unprivileged_ports = {{ containerd_enable_unprivileged_ports | lower }}
enable_unprivileged_icmp = {{ containerd_enable_unprivileged_icmp | lower }}
@@ -32,78 +32,52 @@ oom_score = {{ containerd_oom_score }}
disable_apparmor = {{ containerd_disable_apparmor | lower }}
tolerate_missing_hugetlb_controller = {{ containerd_tolerate_missing_hugetlb_controller | lower }}
disable_hugetlb_controller = {{ containerd_disable_hugetlb_controller | lower }}
image_pull_progress_timeout = "{{ containerd_image_pull_progress_timeout }}"
{% if enable_cdi %}
enable_cdi = true
cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"]
{% endif %}
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "{{ containerd_default_runtime }}"
snapshotter = "{{ containerd_snapshotter }}"
discard_unpacked_layers = {{ containerd_discard_unpacked_layers | lower }}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.cri.v1.runtime".containerd]
default_runtime_name = "{{ containerd_default_runtime }}"
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes]
{% for runtime in [containerd_runc_runtime] + containerd_additional_runtimes %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}]
runtime_type = "{{ runtime.type }}"
runtime_engine = "{{ runtime.engine }}"
runtime_root = "{{ runtime.root }}"
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes.{{ runtime.name }}]
runtime_type = "{{ runtime.type }}"
runtime_engine = "{{ runtime.engine }}"
runtime_root = "{{ runtime.root }}"
{% if runtime.base_runtime_spec is defined %}
base_runtime_spec = "{{ containerd_cfg_dir }}/{{ runtime.base_runtime_spec }}"
base_runtime_spec = "{{ containerd_cfg_dir }}/{{ runtime.base_runtime_spec }}"
{% endif %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}.options]
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes.{{ runtime.name }}.options]
{% for key, value in runtime.options.items() %}
{% if value | string != "true" and value | string != "false" %}
{{ key }} = "{{ value }}"
{{ key }} = "{{ value }}"
{% else %}
{{ key }} = {{ value }}
{{ key }} = {{ value }}
{% endif %}
{% endfor %}
{% endfor %}
{% if kata_containers_enabled %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-qemu]
runtime_type = "io.containerd.kata-qemu.v2"
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes.kata-qemu]
runtime_type = "io.containerd.kata-qemu.v2"
{% endif %}
{% if gvisor_enabled %}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runsc]
runtime_type = "io.containerd.runsc.v1"
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes.runsc]
runtime_type = "io.containerd.runsc.v1"
{% endif %}
[plugins."io.containerd.grpc.v1.cri".registry]
{% if containerd_use_config_path is defined and containerd_use_config_path|bool %}
config_path = "{{ containerd_cfg_dir }}/certs.d"
{% else %}
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
{% set insecure_registries_addr = [] %}
{% for registry in containerd_registries_mirrors %}
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry.prefix }}"]
{% set endpoint = [] %}
{% for mirror in registry.mirrors %}
{% if endpoint.append(mirror.host) %}{% endif %}
{% if mirror.skip_verify is defined and mirror.skip_verify|bool %}{% if insecure_registries_addr.append(mirror.host | urlsplit('netloc')) %}{% endif %}{% endif %}
{% endfor %}
endpoint = ["{{ ( endpoint | unique ) | join('","') }}"]
{% endfor %}
{% for addr in insecure_registries_addr | unique %}
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ addr }}".tls]
insecure_skip_verify = true
{% endfor %}
{% endif %}
{% for registry in containerd_registry_auth if registry['registry'] is defined %}
{% if (registry['username'] is defined and registry['password'] is defined) or registry['auth'] is defined %}
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ registry['registry'] }}".auth]
{% if registry['username'] is defined and registry['password'] is defined %}
password = "{{ registry['password'] }}"
username = "{{ registry['username'] }}"
{% else %}
auth = "{{ registry['auth'] }}"
{% endif %}
{% endif %}
{% endfor %}
{% if nri_enabled and containerd_version is version('1.7.0', '>=') %}
[plugins."io.containerd.cri.v1.images"]
snapshotter = "{{ containerd_snapshotter }}"
discard_unpacked_layers = {{ containerd_discard_unpacked_layers | lower }}
image_pull_progress_timeout = "{{ containerd_image_pull_progress_timeout }}"
[plugins."io.containerd.cri.v1.images".pinned_images]
sandbox = "{{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
[plugins."io.containerd.cri.v1.images".registry]
config_path = "{{ containerd_cfg_dir }}/certs.d"
[plugins."io.containerd.nri.v1.nri"]
disable = false
{% endif %}
disable = {{ 'false' if nri_enabled else 'true' }}
{% if containerd_tracing_enabled %}
[plugins."io.containerd.tracing.processor.v1.otlp"]

View File

@@ -15,7 +15,7 @@
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target
After=network.target local-fs.target dbus.service
[Service]
ExecStartPre=-/sbin/modprobe overlay

View File

@@ -4,4 +4,10 @@ server = "{{ item.server | default("https://" + item.prefix) }}"
capabilities = ["{{ ([ mirror.capabilities ] | flatten ) | join('","') }}"]
skip_verify = {{ mirror.skip_verify | default('false') | string | lower }}
override_path = {{ mirror.override_path | default('false') | string | lower }}
{% if mirror.ca is defined %}
ca = ["{{ ([ mirror.ca ] | flatten ) | join('","') }}"]
{% endif %}
{% if mirror.client is defined %}
client = [{% for pair in mirror.client %}["{{ pair[0] }}", "{{ pair[1] }}"]{% if not loop.last %},{% endif %}{% endfor %}]
{% endif %}
{% endfor %}

View File

@@ -1,7 +0,0 @@
---
containerd_repo_info:
repos:
- >
deb {{ containerd_debian_repo_base_url }}
{{ ansible_distribution_release | lower }}
{{ containerd_debian_repo_component }}

View File

@@ -1,7 +0,0 @@
---
containerd_repo_info:
repos:
- >
deb {{ containerd_ubuntu_repo_base_url }}
{{ ansible_distribution_release | lower }}
{{ containerd_ubuntu_repo_component }}

View File

@@ -0,0 +1,3 @@
---
# Default is "info" (like if not provided). Possible values are any log level string parseable by logrus
cri_dockerd_log_level: "info"

View File

@@ -5,5 +5,5 @@
vars:
container_manager: docker
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: container-engine/cri-dockerd

View File

@@ -1,28 +1,18 @@
---
role_name_check: 1
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: almalinux8
box: almalinux/8
cpus: 1
memory: 1024
nested: true
groups:
- name: almalinux9
cloud_image: almalinux-9
vm_cpu_cores: 1
vm_memory: 1024
node_groups:
- kube_control_plane
provider_options:
driver: kvm
- name: ubuntu20
box: generic/ubuntu2004
cpus: 1
memory: 1024
nested: true
groups:
cloud_image: ubuntu-2004
vm_cpu_cores: 1
vm_memory: 1024
node_groups:
- kube_control_plane
provider_options:
driver: kvm
provisioner:
name: ansible
env:
@@ -35,5 +25,7 @@ provisioner:
group_vars:
all:
become: true
playbooks:
create: ../../../../../tests/cloud_playbooks/create-kubevirt.yml
verifier:
name: testinfra

View File

@@ -3,8 +3,8 @@
hosts: all
become: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- role: kubespray_defaults
- role: bootstrap_os
- role: adduser
user: "{{ addusers.kube }}"
tasks:
@@ -20,7 +20,7 @@
container_manager: containerd
kube_network_plugin: cni
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: network_plugin/cni
tasks:
- name: Copy test container files

View File

@@ -7,7 +7,7 @@ Requires=cri-dockerd.socket
[Service]
Type=notify
ExecStart={{ bin_dir }}/cri-dockerd --container-runtime-endpoint {{ cri_socket }} --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin --network-plugin=cni --pod-cidr={{ kube_pods_subnet }} --pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_version }} {% if enable_dual_stack_networks %}--ipv6-dual-stack=True{% endif %}
ExecStart={{ bin_dir }}/cri-dockerd --container-runtime-endpoint {{ cri_socket }} --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin --network-plugin=cni --pod-cidr={{ kube_pods_subnets }} --pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_version }} --log-level {{ cri_dockerd_log_level }} {% if ipv6_stack %}--ipv6-dual-stack=True{% endif %}
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0

View File

@@ -2,6 +2,8 @@
crio_cgroup_manager: "{{ kubelet_cgroup_driver | default('systemd') }}"
crio_conmon: "{{ bin_dir }}/conmon"
crio_default_runtime: "crun"
crio_libexec_dir: "/usr/libexec/crio"
crio_enable_metrics: false
crio_log_level: "info"
crio_metrics_port: "9090"
@@ -35,14 +37,16 @@ crio_signature_policy: "{% if ansible_os_family == 'ClearLinux' %}/usr/share/def
crio_stream_port: "10010"
crio_required_version: "{{ kube_version | regex_replace('^v(?P<major>\\d+).(?P<minor>\\d+).(?P<patch>\\d+)$', '\\g<major>.\\g<minor>') }}"
crio_required_version: "{{ kube_version | regex_replace('^(?P<major>\\d+).(?P<minor>\\d+).(?P<patch>\\d+)$', '\\g<major>.\\g<minor>') }}"
crio_root: "/var/lib/containers/storage"
# The crio_runtimes variable defines a list of OCI compatible runtimes.
crio_runtimes:
- name: runc
path: "{{ bin_dir }}/runc"
- name: crun
path: "{{ crio_runtime_bin_dir }}/crun"
type: oci
root: /run/runc
root: /run/crun
# Kata Containers is an OCI runtime, where containers are run inside lightweight
# VMs. Kata provides additional isolation towards the host, minimizing the host attack
@@ -55,10 +59,16 @@ kata_runtimes:
root: /run/kata-containers
privileged_without_host_devices: true
runc_runtime:
name: runc
path: "{{ crio_runtime_bin_dir }}/runc"
type: oci
root: /run/runc
# crun is a fast and low-memory footprint OCI Container Runtime fully written in C.
crun_runtime:
name: crun
path: "{{ bin_dir }}/crun"
path: "{{ crio_runtime_bin_dir }}/crun"
type: oci
root: /run/crun
@@ -89,3 +99,15 @@ crio_man_files:
# If set to true, it will enable the CRIU support in cri-o
crio_criu_support_enabled: false
# Configure default_capabilities in crio.conf
crio_default_capabilities:
- CHOWN
- DAC_OVERRIDE
- FSETID
- FOWNER
- SETGID
- SETUID
- SETPCAP
- NET_BIND_SERVICE
- KILL

View File

@@ -1,5 +1,5 @@
---
dependencies:
- role: container-engine/runc
- role: container-engine/crun
- role: container-engine/crictl
- role: container-engine/skopeo

View File

@@ -5,5 +5,5 @@
vars:
container_manager: crio
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: container-engine/cri-o

View File

@@ -1,50 +1,38 @@
---
role_name_check: 1
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: ubuntu20
box: generic/ubuntu2004
cpus: 2
memory: 1024
groups:
cloud_image: ubuntu-2004
vm_cpu_cores: 2
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
- name: almalinux8
box: almalinux/8
cpus: 2
memory: 1024
groups:
- name: almalinux9
cloud_image: almalinux-9
vm_cpu_cores: 2
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
- name: fedora
box: fedora/38-cloud-base
cpus: 2
memory: 2048
groups:
cloud_image: fedora-39
vm_cpu_cores: 2
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
- name: debian10
box: generic/debian10
cpus: 2
memory: 1024
groups:
- name: debian12
cloud_image: debian-12
vm_cpu_cores: 2
vm_memory: 1024
node_groups:
- kube_control_plane
- kube_node
- k8s_cluster
provider_options:
driver: kvm
provisioner:
name: ansible
env:
@@ -53,5 +41,7 @@ provisioner:
defaults:
callbacks_enabled: profile_tasks
timeout: 120
playbooks:
create: ../../../../../tests/cloud_playbooks/create-kubevirt.yml
verifier:
name: testinfra

View File

@@ -6,8 +6,9 @@
vars:
ignore_assert_errors: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- role: kubespray_defaults
- role: bootstrap_os
- role: network_facts
- role: kubernetes/preinstall
- role: adduser
user: "{{ addusers.kube }}"
@@ -25,7 +26,7 @@
ignore_assert_errors: true
kube_network_plugin: cni
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: network_plugin/cni
tasks:
- name: Copy test container files

View File

@@ -21,7 +21,7 @@ def test_run(host):
assert "RuntimeName: cri-o" in cmd.stdout
def test_run_pod(host):
runtime = "runc"
runtime = "crun"
run_command = "/usr/local/bin/crictl run --with-pull --runtime {} /tmp/container.json /tmp/sandbox.json".format(runtime)
with host.sudo():

View File

@@ -1,8 +1,8 @@
---
- name: Cri-o | include vars/v1.28.yml
include_vars: v1.28.yml
when: crio_version is version("v1.29.0", operator="<")
- name: Cri-o | include vars/v1.29.yml
include_vars: v1.29.yml
when: crio_version is version("v1.29.0", operator=">=")
when: crio_version is version("1.29.0", operator=">=")
- name: Cri-o | include vars/v1.31.yml
include_vars: v1.31.yml
when: crio_version is version("1.31.0", operator=">=")

View File

@@ -36,11 +36,18 @@
when:
- kata_containers_enabled
- name: Cri-o | build a list of crio runtimes with crun runtime
## After CRI-O v1.31, crun is default runtime.
# - name: Cri-o | build a list of crio runtimes with crun runtime
# set_fact:
# crio_runtimes: "{{ crio_runtimes + [crun_runtime] }}"
# when:
# - crun_enabled
- name: Cri-o | build a list of crio runtimes with runc runtime
set_fact:
crio_runtimes: "{{ crio_runtimes + [crun_runtime] }}"
crio_runtimes: "{{ crio_runtimes + [runc_runtime] }}"
when:
- crun_enabled
- runc_enabled
- name: Cri-o | build a list of crio runtimes with youki runtime
set_fact:
@@ -82,6 +89,23 @@
- "{{ crio_bin_files }}"
notify: Restart crio
- name: Cri-o | create directory for libexec
file:
path: "{{ crio_libexec_dir }}"
state: directory
owner: root
mode: "0755"
- name: Cri-o | copy libexec
copy:
src: "{{ local_release_dir }}/cri-o/bin/{{ item }}"
dest: "{{ crio_libexec_dir }}/{{ item }}"
mode: "0755"
remote_src: true
with_items:
- "{{ crio_libexec_files }}"
notify: Restart crio
- name: Cri-o | copy service file
copy:
src: "{{ local_release_dir }}/cri-o/contrib/crio.service"
@@ -156,7 +180,7 @@
dest: /etc/containers/storage.conf
section: storage.options.overlay
option: mountopt
value: '{{ ''"nodev"'' if ansible_kernel is version_compare(("4.18" if ansible_os_family == "RedHat" else "4.19"), "<") else ''"nodev,metacopy=on"'' }}'
value: '{{ ''"nodev"'' if ansible_kernel is version(("4.18" if ansible_os_family == "RedHat" else "4.19"), "<") else ''"nodev,metacopy=on"'' }}'
mode: "0644"
- name: Cri-o | create directory registries configs

View File

@@ -19,7 +19,7 @@
- name: CRI-O | Remove cri-o apt repo
apt_repository:
repo: "deb {{ crio_download_crio }}{{ crio_version }}/{{ crio_kubic_debian_repo_name }}/ /"
repo: "deb {{ crio_download_crio }}v{{ crio_version }}/{{ crio_kubic_debian_repo_name }}/ /"
state: absent
filename: devel-kubic-libcontainers-stable-cri-o
when: crio_kubic_debian_repo_name is defined
@@ -36,7 +36,7 @@
- name: CRI-O | Remove CRI-O kubic yum repo
yum_repository:
name: "devel_kubic_libcontainers_stable_cri-o_{{ crio_version }}"
name: "devel_kubic_libcontainers_stable_cri-o_v{{ crio_version }}"
state: absent
when:
- ansible_os_family == "RedHat"
@@ -88,3 +88,11 @@
with_items: "{{ crio_bin_files }}"
tags:
- reset_crio
- name: CRI-O | Remove CRI-O libexec
file:
name: "{{ item }}"
state: absent
with_items: "{{ crio_libexec_files }}"
tags:
- reset_crio

View File

@@ -17,7 +17,7 @@
# Path to the "root directory". CRI-O stores all of its data, including
# containers images, in this directory.
root = "/var/lib/containers/storage"
root = "{{ crio_root }}"
# Path to the "run directory". CRI-O stores all of its state in this directory.
# Read from /etc/containers/storage.conf first so unnecessary here
@@ -97,7 +97,7 @@ grpc_max_recv_msg_size = 16777216
# default_runtime is the _name_ of the OCI runtime to be used as the default.
# The name is matched against the runtimes map below.
default_runtime = "runc"
default_runtime = "{{ crio_default_runtime }}"
# If true, the runtime will not use pivot_root, but instead use MS_MOVE.
no_pivot = false
@@ -155,17 +155,9 @@ cgroup_manager = "{{ crio_cgroup_manager }}"
# only the capabilities defined in the containers json file by the user/kube
# will be added.
default_capabilities = [
"CHOWN",
"DAC_OVERRIDE",
"FSETID",
"FOWNER",
"NET_RAW",
"SETGID",
"SETUID",
"SETPCAP",
"NET_BIND_SERVICE",
"SYS_CHROOT",
"KILL",
{%- for item in crio_default_capabilities %}
"{{ item }}",
{%- endfor %}
]
# List of default sysctls. If it is empty or commented out, only the sysctls
@@ -382,7 +374,7 @@ enable_metrics = {{ crio_enable_metrics | bool | lower }}
# The port on which the metrics server will listen.
metrics_port = {{ crio_metrics_port }}
{% if nri_enabled and crio_version is version('v1.26.0', operator='>=') %}
{% if nri_enabled and crio_version is version('1.26.0', operator='>=') %}
[crio.nri]
enable_nri=true

View File

@@ -1,9 +0,0 @@
---
# cri-o binary files
crio_bin_files:
- conmon
- crio
- crio-status
- pinns
crio_status_command: crio-status

View File

@@ -1,5 +1,6 @@
---
crio_conmon: "{{ bin_dir }}/crio-conmon"
crio_runtime_bin_dir: "{{ bin_dir }}"
# cri-o binary files
crio_bin_files:

View File

@@ -0,0 +1,16 @@
---
crio_conmon: "{{ crio_libexec_dir }}/conmon"
crio_runtime_bin_dir: "{{ crio_libexec_dir }}"
# cri-o binary files
crio_bin_files:
- crio
- pinns
crio_libexec_files:
- conmon
- conmonrs
- crun
- runc
crio_status_command: crio status

View File

@@ -1,5 +1,5 @@
---
docker_version: '26.1'
docker_version: '28.0'
docker_cli_version: "{{ docker_version }}"
docker_package_info:
@@ -53,8 +53,8 @@ docker_fedora_repo_base_url: 'https://download.docker.com/linux/fedora/{{ ansibl
docker_fedora_repo_gpgkey: 'https://download.docker.com/linux/fedora/gpg'
# CentOS/RedHat docker-ce repo
docker_rh_repo_base_url: 'https://download.docker.com/linux/centos/{{ ansible_distribution_major_version }}/$basearch/stable'
docker_rh_repo_gpgkey: 'https://download.docker.com/linux/centos/gpg'
docker_rh_repo_base_url: 'https://download.docker.com/linux/rhel/{{ ansible_distribution_major_version }}/$basearch/stable'
docker_rh_repo_gpgkey: 'https://download.docker.com/linux/rhel/gpg'
# Ubuntu docker-ce repo
docker_ubuntu_repo_base_url: "https://download.docker.com/linux/ubuntu"

View File

@@ -50,7 +50,7 @@
apt_key:
id: "{{ item }}"
url: "{{ docker_repo_key_info.url }}"
keyring: "{{ docker_repo_key_keyring|default(omit) }}"
keyring: "{{ docker_repo_key_keyring | default(omit) }}"
state: present
register: keyserver_task_result
until: keyserver_task_result is succeeded

View File

@@ -10,12 +10,12 @@
- name: Add upstream dns servers
set_fact:
docker_dns_servers: "{{ docker_dns_servers + upstream_dns_servers | default([]) }}"
docker_dns_servers: "{{ docker_dns_servers + upstream_dns_servers }}"
when: dns_mode in ['coredns', 'coredns_dual']
- name: Add global searchdomains
set_fact:
docker_dns_search_domains: "{{ docker_dns_search_domains + searchdomains | default([]) }}"
docker_dns_search_domains: "{{ docker_dns_search_domains + searchdomains }}"
- name: Check system nameservers
shell: set -o pipefail && grep "^nameserver" /etc/resolv.conf | sed -r 's/^nameserver\s*([^#\s]+)\s*(#.*)?/\1/'

View File

@@ -25,8 +25,17 @@ containerd_versioned_pkg:
'1.6.28': "{{ containerd_package }}=1.6.28-2"
'1.6.31': "{{ containerd_package }}=1.6.31-1"
'1.6.32': "{{ containerd_package }}=1.6.32-1"
'stable': "{{ containerd_package }}=1.6.32-1"
'edge': "{{ containerd_package }}=1.6.32-1"
'1.6.33': "{{ containerd_package }}=1.6.33-1"
'1.7.18': "{{ containerd_package }}=1.7.18-1"
'1.7.19': "{{ containerd_package }}=1.7.19-1"
'1.7.20': "{{ containerd_package }}=1.7.20-1"
'1.7.21': "{{ containerd_package }}=1.7.21-1"
'1.7.22': "{{ containerd_package }}=1.7.22-1"
'1.7.23': "{{ containerd_package }}=1.7.23-1"
'1.7.24': "{{ containerd_package }}=1.7.24-1"
'1.7.25': "{{ containerd_package }}=1.7.25-1"
'stable': "{{ containerd_package }}=1.7.25-1"
'edge': "{{ containerd_package }}=1.7.25-1"
# https://download.docker.com/linux/debian/
docker_versioned_pkg:
@@ -38,9 +47,16 @@ docker_versioned_pkg:
'24.0': docker-ce=5:24.0.9-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'25.0': docker-ce=5:25.0.5-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'26.0': docker-ce=5:26.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce=5:26.1.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce=5:24.0.9-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce=5:24.0.9-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce=5:26.1.4-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.0': docker-ce=5:27.0.3-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.1': docker-ce=5:27.1.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.2': docker-ce=5:27.2.1-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.3': docker-ce=5:27.3.1-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.4': docker-ce=5:27.4.1-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.5': docker-ce=5:27.5.4-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'28.0': docker-ce=5:28.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce=5:28.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce=5:28.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
docker_cli_versioned_pkg:
'latest': docker-ce-cli
@@ -51,9 +67,16 @@ docker_cli_versioned_pkg:
'24.0': docker-ce-cli=5:24.0.9-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'25.0': docker-ce-cli=5:25.0.5-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'26.0': docker-ce-cli=5:26.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce-cli=5:26.1.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce-cli=5:26.1.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce-cli=5:26.1.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce-cli=5:26.1.4-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.0': docker-ce-cli=5:27.0.3-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.1': docker-ce-cli=5:27.1.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.2': docker-ce-cli=5:27.2.1-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.3': docker-ce-cli=5:27.3.1-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.4': docker-ce-cli=5:27.4.1-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'27.5': docker-ce-cli=5:27.5.4-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'28.0': docker-ce-cli=5:28.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce-cli=5:28.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce-cli=5:28.0.2-1~debian.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release | lower }}
docker_package_info:
pkgs:

View File

@@ -25,8 +25,17 @@ containerd_versioned_pkg:
'1.6.28': "{{ containerd_package }}-1.6.28-3.2.fc{{ ansible_distribution_major_version }}"
'1.6.31': "{{ containerd_package }}-1.6.31-3.1.fc{{ ansible_distribution_major_version }}"
'1.6.32': "{{ containerd_package }}-1.6.32-3.1.fc{{ ansible_distribution_major_version }}"
'stable': "{{ containerd_package }}-1.6.32-3.1.fc{{ ansible_distribution_major_version }}"
'edge': "{{ containerd_package }}-1.6.32-3.1.fc{{ ansible_distribution_major_version }}"
'1.6.33': "{{ containerd_package }}-1.6.33-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.18': "{{ containerd_package }}-1.7.18-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.19': "{{ containerd_package }}-1.7.19-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.20': "{{ containerd_package }}-1.7.20-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.21': "{{ containerd_package }}-1.7.21-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.22': "{{ containerd_package }}-1.7.22-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.23': "{{ containerd_package }}-1.7.23-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.24': "{{ containerd_package }}-1.7.24-3.1.fc{{ ansible_distribution_major_version }}"
'1.7.25': "{{ containerd_package }}-1.7.25-3.1.fc{{ ansible_distribution_major_version }}"
'stable': "{{ containerd_package }}-1.7.25-3.1.fc{{ ansible_distribution_major_version }}"
'edge': "{{ containerd_package }}-1.7.25-3.1.fc{{ ansible_distribution_major_version }}"
# https://docs.docker.com/install/linux/docker-ce/fedora/
# https://download.docker.com/linux/fedora/<fedora-version>/x86_64/stable/Packages/
@@ -37,9 +46,16 @@ docker_versioned_pkg:
'23.0': docker-ce-3:23.0.6-1.fc{{ ansible_distribution_major_version }}
'24.0': docker-ce-3:24.0.9-1.fc{{ ansible_distribution_major_version }}
'26.0': docker-ce-3:26.0.2-1.fc{{ ansible_distribution_major_version }}
'26.1': docker-ce-3:26.1.2-1.fc{{ ansible_distribution_major_version }}
'stable': docker-ce-3:26.1.2-1.fc{{ ansible_distribution_major_version }}
'edge': docker-ce-3:26.1.2-1.fc{{ ansible_distribution_major_version }}
'26.1': docker-ce-3:26.1.4-1.fc{{ ansible_distribution_major_version }}
'27.0': docker-ce-3:27.0.3-1.fc{{ ansible_distribution_major_version }}
'27.1': docker-ce-3:27.1.2-1.fc{{ ansible_distribution_major_version }}
'27.2': docker-ce-3:27.2.1-1.fc{{ ansible_distribution_major_version }}
'27.3': docker-ce-3:27.3.1-1.fc{{ ansible_distribution_major_version }}
'27.4': docker-ce-3:27.4.1-1.fc{{ ansible_distribution_major_version }}
'27.5': docker-ce-3:27.5.1-1.fc{{ ansible_distribution_major_version }}
'28.0': docker-ce-3:28.0.2-1.fc{{ ansible_distribution_major_version }}
'stable': docker-ce-3:28.0.2-1.fc{{ ansible_distribution_major_version }}
'edge': docker-ce-3:28.0.2-1.fc{{ ansible_distribution_major_version }}
docker_cli_versioned_pkg:
'latest': docker-ce-cli
@@ -48,9 +64,16 @@ docker_cli_versioned_pkg:
'23.0': docker-ce-cli-1:23.0.6-1.fc{{ ansible_distribution_major_version }}
'24.0': docker-ce-cli-1:24.0.9-1.fc{{ ansible_distribution_major_version }}
'26.0': docker-ce-cli-1:26.0.2-1.fc{{ ansible_distribution_major_version }}
'26.1': docker-ce-cli-1:26.0.2-1.fc{{ ansible_distribution_major_version }}
'stable': docker-ce-cli-1:26.0.2-1.fc{{ ansible_distribution_major_version }}
'edge': docker-ce-cli-1:26.0.2-1.fc{{ ansible_distribution_major_version }}
'26.1': docker-ce-cli-1:26.1.4-1.fc{{ ansible_distribution_major_version }}
'27.0': docker-ce-cli-1:27.0.3-1.fc{{ ansible_distribution_major_version }}
'27.1': docker-ce-cli-1:27.1.2-1.fc{{ ansible_distribution_major_version }}
'27.2': docker-ce-cli-1:27.2.1-1.fc{{ ansible_distribution_major_version }}
'27.3': docker-ce-cli-1:27.3.1-1.fc{{ ansible_distribution_major_version }}
'27.4': docker-ce-cli-1:27.4.1-1.fc{{ ansible_distribution_major_version }}
'27.5': docker-ce-cli-1:27.5.1-1.fc{{ ansible_distribution_major_version }}
'28.0': docker-ce-cli-1:28.0.2-1.fc{{ ansible_distribution_major_version }}
'stable': docker-ce-cli-1:28.0.2-1.fc{{ ansible_distribution_major_version }}
'edge': docker-ce-cli-1:28.0.2-1.fc{{ ansible_distribution_major_version }}
docker_package_info:
enablerepo: "docker-ce"

View File

@@ -1,63 +0,0 @@
---
# containerd versions are only relevant for docker
containerd_versioned_pkg:
'latest': "{{ containerd_package }}"
'1.3.7': "{{ containerd_package }}-1.3.7-3.1.el7"
'1.3.9': "{{ containerd_package }}-1.3.9-3.1.el7"
'1.4.3': "{{ containerd_package }}-1.4.3-3.2.el7"
'1.4.4': "{{ containerd_package }}-1.4.4-3.1.el7"
'1.4.6': "{{ containerd_package }}-1.4.6-3.1.el7"
'1.4.9': "{{ containerd_package }}-1.4.9-3.1.el7"
'1.4.12': "{{ containerd_package }}-1.4.12-3.1.el7"
'1.6.4': "{{ containerd_package }}-1.6.4-3.1.el7"
'1.6.6': "{{ containerd_package }}-1.6.6-3.1.el7"
'1.6.7': "{{ containerd_package }}-1.6.7-3.1.el7"
'1.6.8': "{{ containerd_package }}-1.6.8-3.1.el7"
'1.6.9': "{{ containerd_package }}-1.6.9-3.1.el7"
'1.6.10': "{{ containerd_package }}-1.6.10-3.1.el7"
'1.6.11': "{{ containerd_package }}-1.6.11-3.1.el7"
'1.6.12': "{{ containerd_package }}-1.6.12-3.1.el7"
'1.6.13': "{{ containerd_package }}-1.6.13-3.1.el7"
'1.6.14': "{{ containerd_package }}-1.6.14-3.1.el7"
'1.6.15': "{{ containerd_package }}-1.6.15-3.1.el7"
'1.6.16': "{{ containerd_package }}-1.6.16-3.1.el7"
'1.6.18': "{{ containerd_package }}-1.6.18-3.1.el7"
'1.6.28': "{{ containerd_package }}-1.6.28-3.1.el7"
'1.6.31': "{{ containerd_package }}-1.6.31-3.1.el7"
'1.6.32': "{{ containerd_package }}-1.6.32-3.1.el7"
'stable': "{{ containerd_package }}-1.6.32-3.1.el7"
'edge': "{{ containerd_package }}-1.6.32-3.1.el7"
# https://docs.docker.com/engine/installation/linux/centos/#install-from-a-package
# https://download.docker.com/linux/centos/<centos_version>>/x86_64/stable/Packages/
# or do 'yum --showduplicates list docker-engine'
docker_versioned_pkg:
'latest': docker-ce
'18.09': docker-ce-18.09.9-3.el7
'19.03': docker-ce-19.03.15-3.el7
'20.10': docker-ce-20.10.20-3.el7
'23.0': docker-ce-23.0.6-1.el7
'24.0': docker-ce-24.0.9-1.el7
'26.0': docker-ce-26.0.2-1.el7
'26.1': docker-ce-26.1.2-1.el7
'stable': docker-ce-26.1.2-1.el7
'edge': docker-ce-26.1.2-1.el7
docker_cli_versioned_pkg:
'latest': docker-ce-cli
'18.09': docker-ce-cli-18.09.9-3.el7
'19.03': docker-ce-cli-19.03.15-3.el7
'20.10': docker-ce-cli-20.10.20-3.el7
'23.0': docker-ce-cli-23.0.6-1.el7
'24.0': docker-ce-cli-24.0.9-1.el7
'26.0': docker-ce-cli-26.0.2-1.el7
'26.1': docker-ce-cli-26.1.2-1.el7
'stable': docker-ce-cli-26.1.2-1.el7
'edge': docker-ce-cli-26.1.2-1.el7
docker_package_info:
enablerepo: "docker-ce"
pkgs:
- "{{ containerd_versioned_pkg[docker_containerd_version | string] }}"
- "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
- "{{ docker_versioned_pkg[docker_version | string] }}"

View File

@@ -25,11 +25,20 @@ containerd_versioned_pkg:
'1.6.28': "{{ containerd_package }}-1.6.28-3.1.el{{ ansible_distribution_major_version }}"
'1.6.31': "{{ containerd_package }}-1.6.31-3.1.el{{ ansible_distribution_major_version }}"
'1.6.32': "{{ containerd_package }}-1.6.32-3.1.el{{ ansible_distribution_major_version }}"
'stable': "{{ containerd_package }}-1.6.32-3.1.el{{ ansible_distribution_major_version }}"
'edge': "{{ containerd_package }}-1.6.32-3.1.el{{ ansible_distribution_major_version }}"
'1.6.33': "{{ containerd_package }}-1.6.33-3.1.el{{ ansible_distribution_major_version }}"
'1.7.18': "{{ containerd_package }}-1.7.18-3.1.el{{ ansible_distribution_major_version }}"
'1.7.19': "{{ containerd_package }}-1.7.19-3.1.el{{ ansible_distribution_major_version }}"
'1.7.20': "{{ containerd_package }}-1.7.20-3.1.el{{ ansible_distribution_major_version }}"
'1.7.21': "{{ containerd_package }}-1.7.21-3.1.el{{ ansible_distribution_major_version }}"
'1.7.22': "{{ containerd_package }}-1.7.22-3.1.el{{ ansible_distribution_major_version }}"
'1.7.23': "{{ containerd_package }}-1.7.23-3.1.el{{ ansible_distribution_major_version }}"
'1.7.24': "{{ containerd_package }}-1.7.24-3.1.el{{ ansible_distribution_major_version }}"
'1.7.25': "{{ containerd_package }}-1.7.25-3.1.el{{ ansible_distribution_major_version }}"
'stable': "{{ containerd_package }}-1.7.25-3.1.el{{ ansible_distribution_major_version }}"
'edge': "{{ containerd_package }}-1.7.25-3.1.el{{ ansible_distribution_major_version }}"
# https://docs.docker.com/engine/installation/linux/centos/#install-from-a-package
# https://download.docker.com/linux/centos/<centos_version>>/x86_64/stable/Packages/
# https://docs.docker.com/engine/installation/linux/rhel/#install-from-a-package
# https://download.docker.com/linux/rhel/<rhel_version>>/x86_64/stable/Packages/
# or do 'yum --showduplicates list docker-engine'
docker_versioned_pkg:
'latest': docker-ce
@@ -39,9 +48,16 @@ docker_versioned_pkg:
'23.0': docker-ce-3:23.0.6-1.el{{ ansible_distribution_major_version }}
'24.0': docker-ce-3:24.0.9-1.el{{ ansible_distribution_major_version }}
'26.0': docker-ce-3:26.0.2-1.el{{ ansible_distribution_major_version }}
'26.1': docker-ce-3:26.1.2-1.el{{ ansible_distribution_major_version }}
'stable': docker-ce-3:26.1.2-1.el{{ ansible_distribution_major_version }}
'edge': docker-ce-3:26.1.2-1.el{{ ansible_distribution_major_version }}
'26.1': docker-ce-3:26.1.4-1.el{{ ansible_distribution_major_version }}
'27.0': docker-ce-3:27.0.3-1.el{{ ansible_distribution_major_version }}
'27.1': docker-ce-3:27.1.3-1.el{{ ansible_distribution_major_version }}
'27.2': docker-ce-3:27.2.3-1.el{{ ansible_distribution_major_version }}
'27.3': docker-ce-3:27.3.3-1.el{{ ansible_distribution_major_version }}
'27.4': docker-ce-3:27.4.3-1.el{{ ansible_distribution_major_version }}
'27.5': docker-ce-3:27.5.3-1.el{{ ansible_distribution_major_version }}
'28.0': docker-ce-3:28.0.2-1.el{{ ansible_distribution_major_version }}
'stable': docker-ce-3:28.0.2-1.el{{ ansible_distribution_major_version }}
'edge': docker-ce-3:28.0.2-1.el{{ ansible_distribution_major_version }}
docker_cli_versioned_pkg:
'latest': docker-ce-cli
@@ -51,9 +67,16 @@ docker_cli_versioned_pkg:
'23.0': docker-ce-cli-1:23.0.6-1.el{{ ansible_distribution_major_version }}
'24.0': docker-ce-cli-1:24.0.9-1.el{{ ansible_distribution_major_version }}
'26.0': docker-ce-cli-1:26.0.2-1.el{{ ansible_distribution_major_version }}
'26.1': docker-ce-cli-1:26.1.2-1.el{{ ansible_distribution_major_version }}
'stable': docker-ce-cli-1:26.1.2-1.el{{ ansible_distribution_major_version }}
'edge': docker-ce-cli-1:26.1.2-1.el{{ ansible_distribution_major_version }}
'26.1': docker-ce-cli-1:26.1.4-1.el{{ ansible_distribution_major_version }}
'27.0': docker-ce-cli-1:27.0.3-1.el{{ ansible_distribution_major_version }}
'27.1': docker-ce-cli-1:27.1.3-1.el{{ ansible_distribution_major_version }}
'27.2': docker-ce-cli-1:27.2.3-1.el{{ ansible_distribution_major_version }}
'27.3': docker-ce-cli-1:27.3.3-1.el{{ ansible_distribution_major_version }}
'27.4': docker-ce-cli-1:27.4.3-1.el{{ ansible_distribution_major_version }}
'27.5': docker-ce-cli-1:27.5.3-1.el{{ ansible_distribution_major_version }}
'28.0': docker-ce-cli-1:28.0.2-1.el{{ ansible_distribution_major_version }}
'stable': docker-ce-cli-1:28.0.2-1.el{{ ansible_distribution_major_version }}
'edge': docker-ce-cli-1:28.0.2-1.el{{ ansible_distribution_major_version }}
docker_package_info:
enablerepo: "docker-ce"

View File

@@ -2,13 +2,6 @@
# containerd versions are only relevant for docker
containerd_versioned_pkg:
'latest': "{{ containerd_package }}"
'1.3.7': "{{ containerd_package }}=1.3.7-1"
'1.3.9': "{{ containerd_package }}=1.3.9-1"
'1.4.3': "{{ containerd_package }}=1.4.3-2"
'1.4.4': "{{ containerd_package }}=1.4.4-1"
'1.4.6': "{{ containerd_package }}=1.4.6-1"
'1.4.9': "{{ containerd_package }}=1.4.9-1"
'1.4.12': "{{ containerd_package }}=1.4.12-1"
'1.6.4': "{{ containerd_package }}=1.6.4-1"
'1.6.6': "{{ containerd_package }}=1.6.6-1"
'1.6.7': "{{ containerd_package }}=1.6.7-1"
@@ -25,8 +18,17 @@ containerd_versioned_pkg:
'1.6.28': "{{ containerd_package }}=1.6.28-2"
'1.6.31': "{{ containerd_package }}=1.6.31-1"
'1.6.32': "{{ containerd_package }}=1.6.32-1"
'stable': "{{ containerd_package }}=1.6.32-1"
'edge': "{{ containerd_package }}=1.6.32-1"
'1.6.33': "{{ containerd_package }}=1.6.33-1"
'1.7.18': "{{ containerd_package }}=1.7.18-1"
'1.7.19': "{{ containerd_package }}=1.7.19-1"
'1.7.20': "{{ containerd_package }}=1.7.20-1"
'1.7.21': "{{ containerd_package }}=1.7.21-1"
'1.7.22': "{{ containerd_package }}=1.7.22-1"
'1.7.23': "{{ containerd_package }}=1.7.23-1"
'1.7.24': "{{ containerd_package }}=1.7.24-1"
'1.7.25': "{{ containerd_package }}=1.7.25-1"
'stable': "{{ containerd_package }}=1.7.25-1"
'edge': "{{ containerd_package }}=1.7.25-1"
# https://download.docker.com/linux/ubuntu/
docker_versioned_pkg:
@@ -37,9 +39,16 @@ docker_versioned_pkg:
'23.0': docker-ce=5:23.0.6-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'24.0': docker-ce=5:24.0.9-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'26.0': docker-ce=5:26.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce=5:26.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce=5:26.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce=5:26.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce=5:26.1.4-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.0': docker-ce=5:27.0.3-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.1': docker-ce=5:27.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.2': docker-ce=5:27.2.1-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.3': docker-ce=5:27.3.1-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.4': docker-ce=5:27.4.1-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.5': docker-ce=5:27.5.4-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'28.0': docker-ce=5:28.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce=5:28.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce=5:28.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
docker_cli_versioned_pkg:
'latest': docker-ce-cli
@@ -49,9 +58,16 @@ docker_cli_versioned_pkg:
'23.0': docker-ce-cli=5:23.0.6-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'24.0': docker-ce-cli=5:24.0.9-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'26.0': docker-ce-cli=5:26.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce-cli=5:26.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce-cli=5:26.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce-cli=5:26.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'26.1': docker-ce-cli=5:26.1.4-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.0': docker-ce-cli=5:27.0.3-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.1': docker-ce-cli=5:27.1.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.2': docker-ce-cli=5:27.2.1-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.3': docker-ce-cli=5:27.3.1-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.4': docker-ce-cli=5:27.4.1-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'27.5': docker-ce-cli=5:27.5.4-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'28.0': docker-ce-cli=5:28.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'stable': docker-ce-cli=5:28.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
'edge': docker-ce-cli=5:28.0.2-1~ubuntu.{{ ansible_distribution_version }}~{{ ansible_distribution_release | lower }}
docker_package_info:
pkgs:

View File

@@ -6,6 +6,6 @@
gvisor_enabled: true
container_manager: containerd
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: container-engine/containerd
- role: container-engine/gvisor

View File

@@ -14,8 +14,8 @@ platforms:
- kube_control_plane
provider_options:
driver: kvm
- name: almalinux8
box: almalinux/8
- name: almalinux9
box: almalinux/9
cpus: 1
memory: 1024
nested: true

View File

@@ -3,8 +3,8 @@
hosts: all
become: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- role: kubespray_defaults
- role: bootstrap_os
- role: adduser
user: "{{ addusers.kube }}"
tasks:
@@ -20,7 +20,7 @@
container_manager: containerd
kube_network_plugin: cni
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: network_plugin/cni
- role: container-engine/crictl
tasks:

View File

@@ -1,6 +0,0 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- pasqualet
reviewers:
- pasqualet

View File

@@ -6,6 +6,6 @@
kata_containers_enabled: true
container_manager: containerd
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: container-engine/containerd
- role: container-engine/kata-containers

View File

@@ -3,8 +3,8 @@
hosts: all
become: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- role: kubespray_defaults
- role: bootstrap_os
- role: adduser
user: "{{ addusers.kube }}"
tasks:
@@ -20,7 +20,7 @@
container_manager: containerd
kube_network_plugin: cni
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: network_plugin/cni
- role: container-engine/crictl
tasks:

View File

@@ -84,7 +84,7 @@
block:
- name: Drain node
include_role:
name: remove-node/pre-remove
name: remove_node/pre_remove
apply:
tags:
- pre-remove
@@ -111,7 +111,7 @@
block:
- name: Drain node
include_role:
name: remove-node/pre-remove
name: remove_node/pre_remove
apply:
tags:
- pre-remove
@@ -137,7 +137,7 @@
block:
- name: Drain node
include_role:
name: remove-node/pre-remove
name: remove_node/pre_remove
apply:
tags:
- pre-remove

View File

@@ -6,6 +6,6 @@
youki_enabled: true
container_manager: crio
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: container-engine/cri-o
- role: container-engine/youki

View File

@@ -14,8 +14,8 @@ platforms:
- kube_control_plane
provider_options:
driver: kvm
- name: almalinux8
box: almalinux/8
- name: almalinux9
box: almalinux/9
cpus: 1
memory: 1024
nested: true

View File

@@ -3,8 +3,8 @@
hosts: all
become: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- role: kubespray_defaults
- role: bootstrap_os
- role: adduser
user: "{{ addusers.kube }}"
tasks:
@@ -20,7 +20,7 @@
container_manager: crio
kube_network_plugin: cni
roles:
- role: kubespray-defaults
- role: kubespray_defaults
- role: network_plugin/cni
- role: container-engine/crictl
tasks:

View File

@@ -6,7 +6,7 @@
- name: Youki | Copy youki binary from download dir
copy:
src: "{{ local_release_dir }}/youki_{{ youki_version | regex_replace('\\.', '_') }}_linux/youki-{{ youki_version }}/youki"
src: "{{ local_release_dir }}/youki"
dest: "{{ youki_bin_dir }}/youki"
mode: "0755"
remote_src: true

View File

@@ -7,7 +7,8 @@
set_fact:
download_force_cache: "{{ true if download_run_once else download_force_cache }}"
- name: Download_file | Show url of file to dowload
- name: Download_file | Show url of file to download
when: unsafe_show_logs | bool
debug:
msg: "{{ download.url }}"
run_once: "{{ download_run_once }}"
@@ -61,7 +62,7 @@
dest: "{{ file_path_cached if download_force_cache else download.dest }}"
owner: "{{ omit if download_localhost else (download.owner | default(omit)) }}"
mode: "{{ omit if download_localhost else (download.mode | default(omit)) }}"
checksum: "{{ 'sha256:' + download.sha256 if download.sha256 else omit }}"
checksum: "{{ download.checksum }}"
validate_certs: "{{ download_validate_certs }}"
url_username: "{{ download.username | default(omit) }}"
url_password: "{{ download.password | default(omit) }}"

View File

@@ -5,7 +5,7 @@
dest: "{{ download.dest | dirname }}"
owner: "{{ download.owner | default(omit) }}"
mode: "{{ download.mode | default(omit) }}"
copy: false
remote_src: true
extra_opts: "{{ download.unarchive_extra_opts | default(omit) }}"
when:
- download.unarchive | default(false)

View File

@@ -11,7 +11,7 @@
include_tasks: prep_kubeadm_images.yml
when:
- not skip_downloads | default(false)
- inventory_hostname in groups['kube_control_plane']
- ('kube_control_plane' in group_names)
tags:
- download
- upload

View File

@@ -7,14 +7,6 @@
- not skip_downloads | default(false)
- downloads.kubeadm.enabled
- name: Prep_kubeadm_images | Create kubeadm config
template:
src: "kubeadm-images.yaml.j2"
dest: "{{ kube_config_dir }}/kubeadm-images.yaml"
mode: "0644"
when:
- not skip_kubeadm_images | default(false)
- name: Prep_kubeadm_images | Copy kubeadm binary from download dir to system path
copy:
src: "{{ downloads.kubeadm.dest }}"
@@ -22,11 +14,14 @@
mode: "0755"
remote_src: true
- name: Prep_kubeadm_images | Set kubeadm binary permissions
file:
path: "{{ bin_dir }}/kubeadm"
mode: "0755"
state: file
- name: Prep_kubeadm_images | Create kubeadm config
template:
src: "kubeadm-images.yaml.j2"
dest: "{{ kube_config_dir }}/kubeadm-images.yaml"
mode: "0644"
validate: "{{ kubeadm_config_validate_enabled | ternary(bin_dir + '/kubeadm config validate --config %s', omit) }}"
when:
- not skip_kubeadm_images | default(false)
- name: Prep_kubeadm_images | Generate list of required images
shell: "set -o pipefail && {{ bin_dir }}/kubeadm config images list --config={{ kube_config_dir }}/kubeadm-images.yaml | grep -Ev 'coredns|pause'"
@@ -49,7 +44,8 @@
container: true
repo: "{{ item | regex_replace('^(.*):.*$', '\\1') }}"
tag: "{{ item | regex_replace('^.*:(.*)$', '\\1') }}"
groups: k8s_cluster
groups:
- k8s_cluster
loop: "{{ kubeadm_images_list | flatten(levels=1) }}"
register: kubeadm_images_cooked
run_once: true

View File

@@ -1,12 +1,12 @@
apiVersion: kubeadm.k8s.io/v1beta3
apiVersion: kubeadm.k8s.io/{{ kubeadm_config_api_version }}
kind: InitConfiguration
nodeRegistration:
criSocket: {{ cri_socket }}
---
apiVersion: kubeadm.k8s.io/v1beta3
apiVersion: kubeadm.k8s.io/{{ kubeadm_config_api_version }}
kind: ClusterConfiguration
imageRepository: {{ kube_image_repo }}
kubernetesVersion: {{ kube_version }}
kubernetesVersion: v{{ kube_version }}
etcd:
{% if etcd_deployment_type == "kubeadm" %}
local:

View File

@@ -34,8 +34,6 @@ etcd_script_dir: "{{ bin_dir }}/etcd-scripts"
etcd_heartbeat_interval: "250"
etcd_election_timeout: "5000"
# etcd_snapshot_count: "10000"
etcd_metrics: "basic"
# Define in inventory to set a separate port for etcd to expose metrics on

View File

@@ -2,30 +2,29 @@
- name: Backup etcd
import_tasks: backup.yml
- name: Etcd | reload systemd
- name: Restart etcd
systemd_service:
daemon_reload: true
listen:
- Restart etcd
- Restart etcd-events
- name: Reload etcd
service:
name: etcd
state: restarted
when: is_etcd_master
listen: Restart etcd
daemon_reload: true
when: ('etcd' in group_names)
throttle: "{{ groups['etcd'] | length // 2 }}"
# Etcd cluster MUST have an odd number of members
# Truncated integer division by 2 will always return (majority - 1) which
# means the cluster will keep quorum and stay available
- name: Reload etcd-events
service:
- name: Restart etcd-events
systemd_service:
name: etcd-events
state: restarted
when: is_etcd_master
listen: Restart etcd-events
daemon_reload: true
# TODO: this seems odd. etcd-events should be a different group possibly ?
when: ('etcd' in group_names)
throttle: "{{ groups['etcd'] | length // 2 }}"
- name: Wait for etcd up
uri:
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
url: "https://{% if 'etcd' in group_names %}{{ etcd_address | ansible.utils.ipwrap }}{% else %}127.0.0.1{% endif %}:2379/health"
validate_certs: false
client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
@@ -40,7 +39,7 @@
- name: Wait for etcd-events up
uri:
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2383/health"
url: "https://{% if 'etcd' in group_names %}{{ etcd_address | ansible.utils.ipwrap }}{% else %}127.0.0.1{% endif %}:2383/health"
validate_certs: false
client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"

View File

@@ -21,7 +21,7 @@
get_checksum: true
get_mime: false
register: etcd_member_certs
when: inventory_hostname in groups['etcd']
when: ('etcd' in group_names)
with_items:
- ca.pem
- member-{{ inventory_hostname }}.pem
@@ -33,7 +33,7 @@
stat:
path: "{{ etcd_cert_dir }}/{{ item }}"
register: etcd_node_certs
when: inventory_hostname in groups['k8s_cluster']
when: ('k8s_cluster' in group_names)
with_items:
- ca.pem
- node-{{ inventory_hostname }}.pem
@@ -84,7 +84,7 @@
{% if not loop.last %}{{ ',' }}{% endif %}
{% endfor %}]
when:
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
- force_etcd_cert_refresh or not item in etcdcert_master.files | map(attribute='path') | list
@@ -99,7 +99,7 @@
set_fact:
etcd_member_requires_sync: true
when:
- inventory_hostname in groups['etcd']
- ('etcd' in group_names)
- (not etcd_member_certs.results[0].stat.exists | default(false)) or
(not etcd_member_certs.results[1].stat.exists | default(false)) or
(not etcd_member_certs.results[2].stat.exists | default(false)) or
@@ -115,7 +115,7 @@
set_fact:
kubernetes_host_requires_sync: true
when:
- inventory_hostname in groups['k8s_cluster'] and
- ('k8s_cluster' in group_names) and
inventory_hostname not in groups['etcd']
- (not etcd_node_certs.results[0].stat.exists | default(false)) or
(not etcd_node_certs.results[1].stat.exists | default(false)) or

View File

@@ -9,7 +9,7 @@
check_mode: false
run_once: true
when:
- is_etcd_master
- ('etcd' in group_names)
- etcd_cluster_setup
tags:
- facts
@@ -30,7 +30,7 @@
check_mode: false
run_once: true
when:
- is_etcd_master
- ('etcd' in group_names)
- etcd_events_cluster_setup
tags:
- facts
@@ -43,7 +43,7 @@
- name: Configure | Refresh etcd config
include_tasks: refresh_config.yml
when: is_etcd_master
when: ('etcd' in group_names)
- name: Configure | Copy etcd.service systemd file
template:
@@ -54,7 +54,9 @@
# FIXME: check that systemd version >= 250 (factory-reset.target was introduced in that release)
# Remove once we drop support for systemd < 250
validate: "sh -c '[ -f /usr/bin/systemd/system/factory-reset.target ] || exit 0 && systemd-analyze verify %s:etcd-{{ etcd_deployment_type }}.service'"
when: is_etcd_master and etcd_cluster_setup
when:
- ('etcd' in group_names)
- etcd_cluster_setup
- name: Configure | Copy etcd-events.service systemd file
template:
@@ -65,12 +67,14 @@
validate: "sh -c '[ -f /usr/bin/systemd/system/factory-reset.target ] || exit 0 && systemd-analyze verify %s:etcd-events-{{ etcd_deployment_type }}.service'"
# FIXME: check that systemd version >= 250 (factory-reset.target was introduced in that release)
# Remove once we drop support for systemd < 250
when: is_etcd_master and etcd_events_cluster_setup
when:
- ('etcd' in group_names)
- etcd_events_cluster_setup
- name: Configure | reload systemd
systemd_service:
daemon_reload: true
when: is_etcd_master
when: ('etcd' in group_names)
# when scaling new etcd will fail to start
- name: Configure | Ensure etcd is running
@@ -79,7 +83,9 @@
state: started
enabled: true
ignore_errors: "{{ etcd_cluster_is_healthy.rc == 0 }}" # noqa ignore-errors
when: is_etcd_master and etcd_cluster_setup
when:
- ('etcd' in group_names)
- etcd_cluster_setup
# when scaling new etcd will fail to start
- name: Configure | Ensure etcd-events is running
@@ -88,7 +94,9 @@
state: started
enabled: true
ignore_errors: "{{ etcd_events_cluster_is_healthy.rc != 0 }}" # noqa ignore-errors
when: is_etcd_master and etcd_events_cluster_setup
when:
- ('etcd' in group_names)
- etcd_events_cluster_setup
- name: Configure | Wait for etcd cluster to be healthy
shell: "set -o pipefail && {{ bin_dir }}/etcdctl endpoint --cluster status && {{ bin_dir }}/etcdctl endpoint --cluster health 2>&1 | grep -v 'Error: unhealthy cluster' >/dev/null"
@@ -102,7 +110,7 @@
check_mode: false
run_once: true
when:
- is_etcd_master
- ('etcd' in group_names)
- etcd_cluster_setup
tags:
- facts
@@ -125,7 +133,7 @@
check_mode: false
run_once: true
when:
- is_etcd_master
- ('etcd' in group_names)
- etcd_events_cluster_setup
tags:
- facts
@@ -137,12 +145,14 @@
ETCDCTL_ENDPOINTS: "{{ etcd_events_access_addresses }}"
- name: Configure | Check if member is in etcd cluster
shell: "{{ bin_dir }}/etcdctl member list | grep -w -q {{ etcd_access_address }}"
shell: "{{ bin_dir }}/etcdctl member list | grep -w -q {{ etcd_access_address | replace('[', '') | replace(']', '') }}"
register: etcd_member_in_cluster
ignore_errors: true # noqa ignore-errors
changed_when: false
check_mode: false
when: is_etcd_master and etcd_cluster_setup
when:
- ('etcd' in group_names)
- etcd_cluster_setup
tags:
- facts
environment:
@@ -153,12 +163,14 @@
ETCDCTL_ENDPOINTS: "{{ etcd_access_addresses }}"
- name: Configure | Check if member is in etcd-events cluster
shell: "{{ bin_dir }}/etcdctl member list | grep -w -q {{ etcd_access_address }}"
shell: "{{ bin_dir }}/etcdctl member list | grep -w -q {{ etcd_access_address | replace('[', '') | replace(']', '') }}"
register: etcd_events_member_in_cluster
ignore_errors: true # noqa ignore-errors
changed_when: false
check_mode: false
when: is_etcd_master and etcd_events_cluster_setup
when:
- ('etcd' in group_names)
- etcd_events_cluster_setup
tags:
- facts
environment:

View File

@@ -35,7 +35,6 @@
mode: "0700"
run_once: true
when:
- gen_certs | default(false)
- inventory_hostname == groups['etcd'][0]
- name: Gen_certs | run cert generation script for etcd and kube control plane nodes
@@ -55,7 +54,7 @@
run_once: true
delegate_to: "{{ groups['etcd'][0] }}"
when:
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
- gen_certs | default(false)
notify: Set etcd_secret_changed
@@ -79,7 +78,7 @@
{% endfor %}]"
delegate_to: "{{ groups['etcd'][0] }}"
when:
- inventory_hostname in groups['etcd']
- ('etcd' in group_names)
- sync_certs | default(false)
- inventory_hostname != groups['etcd'][0]
notify: Set etcd_secret_changed
@@ -93,7 +92,7 @@
mode: "0640"
with_items: "{{ etcd_master_certs.results }}"
when:
- inventory_hostname in groups['etcd']
- ('etcd' in group_names)
- sync_certs | default(false)
- inventory_hostname != groups['etcd'][0]
loop_control:
@@ -110,9 +109,9 @@
{% endfor %}]"
delegate_to: "{{ groups['etcd'][0] }}"
when:
- inventory_hostname in groups['etcd']
- ('etcd' in group_names)
- inventory_hostname != groups['etcd'][0]
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
notify: Set etcd_secret_changed
@@ -125,9 +124,9 @@
mode: "0640"
with_items: "{{ etcd_master_node_certs.results }}"
when:
- inventory_hostname in groups['etcd']
- ('etcd' in group_names)
- inventory_hostname != groups['etcd'][0]
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
loop_control:
label: "{{ item.item }}"
@@ -135,15 +134,15 @@
- name: Gen_certs | Generate etcd certs
include_tasks: gen_nodes_certs_script.yml
when:
- inventory_hostname in groups['kube_control_plane'] and
- ('kube_control_plane' in group_names) and
sync_certs | default(false) and inventory_hostname not in groups['etcd']
- name: Gen_certs | Generate etcd certs on nodes if needed
include_tasks: gen_nodes_certs_script.yml
when:
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
- inventory_hostname in groups['k8s_cluster'] and
- ('k8s_cluster' in group_names) and
sync_certs | default(false) and inventory_hostname not in groups['etcd']
- name: Gen_certs | check certificate permissions
@@ -154,3 +153,25 @@
owner: "{{ etcd_owner }}"
mode: "{{ etcd_cert_dir_mode }}"
recurse: true
# This is a hack around the fact kubeadm expect the same certs path on all kube_control_plane
# TODO: fix certs generation to have the same file everywhere
# OR work with kubeadm on node-specific config
- name: Gen_certs | Pretend all control plane have all certs (with symlinks)
file:
state: link
src: "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}{{ item[0] }}.pem"
dest: "{{ etcd_cert_dir }}/node-{{ item[1] }}{{ item[0] }}.pem"
mode: "0640"
loop: "{{ suffixes | product(groups['kube_control_plane']) }}"
vars:
suffixes:
- ''
- '-key'
when:
- ('kube_control_plane' in group_names)
- item[1] != inventory_hostname
register: symlink_created
failed_when:
- symlink_created is failed
- ('refusing to convert from file to symlink' not in symlink_created.msg)

View File

@@ -3,6 +3,7 @@
command: "{{ bin_dir }}/etcd --version"
register: etcd_current_host_version
# There's a chance this play could run before etcd is installed at all
# TODO: figure out whether this happens. "A chance" is not enough information
ignore_errors: true
when: etcd_cluster_setup
@@ -11,18 +12,18 @@
notify: Restart etcd
when:
- etcd_cluster_setup
- etcd_version.lstrip('v') not in etcd_current_host_version.stdout | default('')
- etcd_version not in etcd_current_host_version.stdout | default('')
- name: Restart etcd-events if necessary
command: /bin/true
notify: Restart etcd-events
when:
- etcd_events_cluster_setup
- etcd_version.lstrip('v') not in etcd_current_host_version.stdout | default('')
- etcd_version not in etcd_current_host_version.stdout | default('')
- name: Install | Copy etcd binary from download dir
copy:
src: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
src: "{{ local_release_dir }}/etcd-v{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
dest: "{{ bin_dir }}/{{ item }}"
mode: "0755"
remote_src: true

View File

@@ -19,7 +19,7 @@
etcd_events_peer_addresses: >-
{% for host in groups['etcd'] -%}
{%- if hostvars[host]['etcd_events_member_in_cluster'].rc == 0 -%}
{{ "etcd" + loop.index | string }}=https://{{ hostvars[host].etcd_events_access_address | default(hostvars[host].ip | default(fallback_ips[host])) }}:2382,
{{ "etcd" + loop.index | string }}="https://{{ hostvars[host].etcd_events_access_address | default(hostvars[host]['main_ip']) | ansible.utils.ipwrap }}:2382",
{%- endif -%}
{%- if loop.last -%}
{{ etcd_member_name }}={{ etcd_events_peer_url }}

View File

@@ -20,7 +20,7 @@
etcd_peer_addresses: >-
{% for host in groups['etcd'] -%}
{%- if hostvars[host]['etcd_member_in_cluster'].rc == 0 -%}
{{ "etcd" + loop.index | string }}=https://{{ hostvars[host].etcd_access_address | default(hostvars[host].ip | default(fallback_ips[host])) }}:2380,
{{ "etcd" + loop.index | string }}="https://{{ hostvars[host].etcd_access_address | default(hostvars[host]['main_ip']) | ansible.utils.ipwrap }}:2380",
{%- endif -%}
{%- if loop.last -%}
{{ etcd_member_name }}={{ etcd_peer_url }}

View File

@@ -9,23 +9,23 @@
- name: Generate etcd certs
include_tasks: "gen_certs_script.yml"
when:
- cert_management | d('script') == "script"
- cert_management == "script"
tags:
- etcd-secrets
- name: Trust etcd CA
include_tasks: upd_ca_trust.yml
when:
- inventory_hostname in groups['etcd'] | union(groups['kube_control_plane']) | unique | sort
- ('etcd' in group_names) or ('kube_control_plane' in group_names)
tags:
- etcd-secrets
- name: Trust etcd CA on nodes if needed
include_tasks: upd_ca_trust.yml
when:
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
- inventory_hostname in groups['k8s_cluster']
- ('k8s_cluster' in group_names)
tags:
- etcd-secrets
@@ -35,22 +35,24 @@
changed_when: false
check_mode: false
when:
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
- inventory_hostname in groups['k8s_cluster']
- ('k8s_cluster' in group_names)
tags:
- master
- master # master tag is deprecated and replaced by control-plane
- control-plane
- network
- name: Set etcd_client_cert_serial
set_fact:
etcd_client_cert_serial: "{{ etcd_client_cert_serial_result.stdout.split('=')[1] }}"
when:
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
- kube_network_plugin != "calico" or calico_datastore == "etcd"
- inventory_hostname in groups['k8s_cluster']
- ('k8s_cluster' in group_names)
tags:
- master
- master # master tag is deprecated and replaced by control-plane
- control-plane
- network
- name: Install etcdctl and etcdutl binary
@@ -61,36 +63,42 @@
- etcdutl
- upgrade
when:
- inventory_hostname in groups['etcd']
- ('etcd' in group_names)
- etcd_cluster_setup
- name: Install etcd
include_tasks: "install_{{ etcd_deployment_type }}.yml"
when: is_etcd_master
when: ('etcd' in group_names)
tags:
- upgrade
- name: Configure etcd
include_tasks: configure.yml
when: is_etcd_master
when: ('etcd' in group_names)
- name: Refresh etcd config
include_tasks: refresh_config.yml
when: is_etcd_master
when: ('etcd' in group_names)
- name: Restart etcd if certs changed
command: /bin/true
notify: Restart etcd
when: is_etcd_master and etcd_cluster_setup and etcd_secret_changed | default(false)
when:
- ('etcd' in group_names)
- etcd_cluster_setup
- etcd_secret_changed | default(false)
- name: Restart etcd-events if certs changed
command: /bin/true
notify: Restart etcd
when: is_etcd_master and etcd_events_cluster_setup and etcd_secret_changed | default(false)
when:
- ('etcd' in group_names)
- etcd_events_cluster_setup
- etcd_secret_changed | default(false)
# After etcd cluster is assembled, make sure that
# initial state of the cluster is in `existing`
# state instead of `new`.
- name: Refresh etcd config again for idempotency
include_tasks: refresh_config.yml
when: is_etcd_master
when: ('etcd' in group_names)

View File

@@ -5,7 +5,9 @@
dest: /etc/etcd.env
mode: "0640"
notify: Restart etcd
when: is_etcd_master and etcd_cluster_setup
when:
- ('etcd' in group_names)
- etcd_cluster_setup
- name: Refresh config | Create etcd-events config file
template:
@@ -13,4 +15,6 @@
dest: /etc/etcd-events.env
mode: "0640"
notify: Restart etcd-events
when: is_etcd_master and etcd_events_cluster_setup
when:
- ('etcd' in group_names)
- etcd_events_cluster_setup

View File

@@ -4,11 +4,11 @@ ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_events_peer_url }}
ETCD_INITIAL_CLUSTER_STATE={% if etcd_events_cluster_is_healthy.rc == 0 | bool %}existing{% else %}new{% endif %}
ETCD_METRICS={{ etcd_metrics }}
ETCD_LISTEN_CLIENT_URLS=https://{{ etcd_address }}:2383,https://127.0.0.1:2383
ETCD_LISTEN_CLIENT_URLS=https://{{ etcd_address | ansible.utils.ipwrap }}:2383,https://127.0.0.1:2383
ETCD_ELECTION_TIMEOUT={{ etcd_election_timeout }}
ETCD_HEARTBEAT_INTERVAL={{ etcd_heartbeat_interval }}
ETCD_INITIAL_CLUSTER_TOKEN=k8s_events_etcd
ETCD_LISTEN_PEER_URLS=https://{{ etcd_address }}:2382
ETCD_LISTEN_PEER_URLS=https://{{ etcd_address | ansible.utils.ipwrap }}:2382
ETCD_NAME={{ etcd_member_name }}-events
ETCD_PROXY=off
ETCD_INITIAL_CLUSTER={{ etcd_events_peer_addresses }}

View File

@@ -8,13 +8,13 @@ ETCD_METRICS={{ etcd_metrics }}
{% if etcd_listen_metrics_urls is defined %}
ETCD_LISTEN_METRICS_URLS={{ etcd_listen_metrics_urls }}
{% elif etcd_metrics_port is defined %}
ETCD_LISTEN_METRICS_URLS=http://{{ etcd_address }}:{{ etcd_metrics_port }},http://127.0.0.1:{{ etcd_metrics_port }}
ETCD_LISTEN_METRICS_URLS=http://{{ etcd_address | ansible.utils.ipwrap }}:{{ etcd_metrics_port }},http://127.0.0.1:{{ etcd_metrics_port }}
{% endif %}
ETCD_LISTEN_CLIENT_URLS=https://{{ etcd_address }}:2379,https://127.0.0.1:2379
ETCD_LISTEN_CLIENT_URLS=https://{{ etcd_address | ansible.utils.ipwrap }}:2379,https://127.0.0.1:2379
ETCD_ELECTION_TIMEOUT={{ etcd_election_timeout }}
ETCD_HEARTBEAT_INTERVAL={{ etcd_heartbeat_interval }}
ETCD_INITIAL_CLUSTER_TOKEN=k8s_etcd
ETCD_LISTEN_PEER_URLS=https://{{ etcd_address }}:2380
ETCD_LISTEN_PEER_URLS=https://{{ etcd_address | ansible.utils.ipwrap }}:2380
ETCD_NAME={{ etcd_member_name }}
ETCD_PROXY=off
ETCD_INITIAL_CLUSTER={{ etcd_peer_addresses }}

View File

@@ -42,9 +42,16 @@ DNS.{{ counter["dns"] }} = {{ etcd_alt_name }}{{ increment(counter, 'dns') }}
{% if hostvars[host]['access_ip'] is defined %}
IP.{{ counter["ip"] }} = {{ hostvars[host]['access_ip'] }}{{ increment(counter, 'ip') }}
{% endif %}
IP.{{ counter["ip"] }} = {{ hostvars[host]['ip'] | default(fallback_ips[host]) }}{{ increment(counter, 'ip') }}
{% if hostvars[host]['access_ip6'] is defined %}
IP.{{ counter["ip"] }} = {{ hostvars[host]['access_ip6'] }}{{ increment(counter, 'ip') }}
{% endif %}
{% if ipv6_stack %}
IP.{{ counter["ip"] }} = {{ hostvars[host]['ip6'] | default(hostvars[host]['fallback_ip6']) }}{{ increment(counter, 'ip') }}
{% endif %}
IP.{{ counter["ip"] }} = {{ hostvars[host]['main_ip'] }}{{ increment(counter, 'ip') }}
{% endfor %}
{% for cert_alt_ip in etcd_cert_alt_ips %}
IP.{{ counter["ip"] }} = {{ cert_alt_ip }}{{ increment(counter, 'ip') }}
{% endfor %}
IP.{{ counter["ip"] }} = 127.0.0.1
IP.{{ counter["ip"] }} = 127.0.0.1{{ increment(counter, 'ip') }}
IP.{{ counter["ip"] }} = ::1

View File

@@ -6,5 +6,5 @@ cert_files:
- "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem"
- "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
node:
- "{{ etcd_cert_dir}}/node-{{ inventory_hostname }}.pem"
- "{{ etcd_cert_dir}}/node-{{ inventory_hostname }}-key.pem"
- "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem"
- "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}-key.pem"

View File

@@ -29,7 +29,7 @@
- name: Copy etcdctl and etcdutl binary from download dir
copy:
src: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
src: "{{ local_release_dir }}/etcd-v{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
dest: "{{ bin_dir }}/{{ item }}"
mode: "0755"
remote_src: true

View File

@@ -46,6 +46,9 @@ argument_specs:
default: true
wait_timeout:
type: str
atomic:
type: bool
default: true
repositories:
type: list
@@ -91,3 +94,6 @@ argument_specs:
wait_timeout:
type: str
default: "5m"
atomic:
type: bool
default: true

View File

@@ -20,7 +20,7 @@ coredns_default_zone_cache_block: |
coredns_pod_disruption_budget: false
# value for coredns pdb
coredns_pod_disruption_budget_max_unavailable: "30%"
deploy_coredns: true
# coredns_additional_configs adds any extra configuration to coredns
# coredns_additional_configs: |
# whoami
@@ -55,11 +55,17 @@ nodelocaldns_ds_nodeselector: "kubernetes.io/os: linux"
nodelocaldns_prometheus_port: 9253
nodelocaldns_secondary_prometheus_port: 9255
# nodelocaldns_additional_configs adds any extra configuration to coredns
# nodelocaldns_additional_configs: |
# whoami
# local
# Limits for dns-autoscaler
dns_autoscaler_cpu_requests: 20m
dns_autoscaler_memory_requests: 10Mi
dns_autoscaler_deployment_nodeselector: "kubernetes.io/os: linux"
# dns_autoscaler_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}]
dns_autoscaler_affinity: {}
# etcd metrics
# etcd_metrics_service_labels:

View File

@@ -1,50 +0,0 @@
---
- name: Kubernetes Apps | Lay Down CoreDNS templates
template:
src: "{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.file }}"
mode: "0644"
loop:
- { name: coredns, file: coredns-clusterrole.yml, type: clusterrole }
- { name: coredns, file: coredns-clusterrolebinding.yml, type: clusterrolebinding }
- { name: coredns, file: coredns-config.yml, type: configmap }
- { name: coredns, file: coredns-deployment.yml, type: deployment }
- { name: coredns, file: coredns-sa.yml, type: sa }
- { name: coredns, file: coredns-svc.yml, type: svc }
- { name: dns-autoscaler, file: dns-autoscaler.yml, type: deployment }
- { name: dns-autoscaler, file: dns-autoscaler-clusterrole.yml, type: clusterrole }
- { name: dns-autoscaler, file: dns-autoscaler-clusterrolebinding.yml, type: clusterrolebinding }
- { name: coredns, file: coredns-poddisruptionbudget.yml, type: poddisruptionbudget, condition: coredns_pod_disruption_budget }
- { name: dns-autoscaler, file: dns-autoscaler-sa.yml, type: sa }
register: coredns_manifests
vars:
clusterIP: "{{ skydns_server }}"
when:
- dns_mode in ['coredns', 'coredns_dual']
- inventory_hostname == groups['kube_control_plane'][0]
- enable_dns_autoscaler or item.name != 'dns-autoscaler'
- item.condition | default(True)
tags:
- coredns
- name: Kubernetes Apps | Lay Down Secondary CoreDNS Template
template:
src: "{{ item.src }}.j2"
dest: "{{ kube_config_dir }}/{{ item.file }}"
mode: "0644"
with_items:
- { name: coredns, src: coredns-deployment.yml, file: coredns-deployment-secondary.yml, type: deployment }
- { name: coredns, src: coredns-svc.yml, file: coredns-svc-secondary.yml, type: svc }
- { name: dns-autoscaler, src: dns-autoscaler.yml, file: coredns-autoscaler-secondary.yml, type: deployment }
- { name: coredns, src: coredns-poddisruptionbudget.yml, file: coredns-poddisruptionbudget-secondary.yml, type: poddisruptionbudget, condition: coredns_pod_disruption_budget }
register: coredns_secondary_manifests
vars:
clusterIP: "{{ skydns_server_secondary }}"
coredns_ordinal_suffix: "-secondary"
when:
- dns_mode == 'coredns_dual'
- inventory_hostname == groups['kube_control_plane'][0]
- enable_dns_autoscaler or item.name != 'dns-autoscaler'
- item.condition | default(True)
tags:
- coredns

Some files were not shown because too many files have changed in this diff Show More