update to latest 2.26.0 kubespray version and add dns zones settings to coredns

This commit is contained in:
2024-12-14 21:56:19 +03:00
parent be9c8a28fd
commit 4294f52703
368 changed files with 37761 additions and 2942 deletions

View File

@@ -1,6 +1,6 @@
---
- name: CRI-O | reload systemd
systemd:
systemd_service:
daemon_reload: true
listen: Restart crio
@@ -8,5 +8,5 @@
service:
name: crio
state: restarted
enabled: yes
enabled: true
listen: Restart crio

View File

@@ -1,7 +1,7 @@
---
- name: Prepare
hosts: all
gather_facts: False
gather_facts: false
become: true
vars:
ignore_assert_errors: true
@@ -19,7 +19,7 @@
- name: Prepare CNI
hosts: all
gather_facts: False
gather_facts: false
become: true
vars:
ignore_assert_errors: true
@@ -33,7 +33,7 @@
src: "{{ item }}"
dest: "/tmp/{{ item }}"
owner: root
mode: 0644
mode: "0644"
with_items:
- container.json
- sandbox.json
@@ -42,12 +42,12 @@
path: /etc/cni/net.d
state: directory
owner: "{{ kube_owner }}"
mode: 0755
mode: "0755"
- name: Setup CNI
copy:
src: "{{ item }}"
dest: "/etc/cni/net.d/{{ item }}"
owner: root
mode: 0644
mode: "0644"
with_items:
- 10-mynet.conf

View File

@@ -5,9 +5,9 @@
- name: Cri-o | check if fedora coreos
stat:
path: /run/ostree-booted
get_attributes: no
get_checksum: no
get_mime: no
get_attributes: false
get_checksum: false
get_mime: false
register: ostree
- name: Cri-o | set is_ostree
@@ -56,27 +56,27 @@
file:
path: "{{ item }}"
state: directory
mode: 0755
mode: "0755"
- name: Cri-o | install cri-o config
template:
src: crio.conf.j2
dest: /etc/crio/crio.conf
mode: 0644
mode: "0644"
register: config_install
- name: Cri-o | install config.json
template:
src: config.json.j2
dest: /etc/crio/config.json
mode: 0644
mode: "0644"
register: reg_auth_install
- name: Cri-o | copy binaries
copy:
src: "{{ local_release_dir }}/cri-o/bin/{{ item }}"
dest: "{{ bin_dir }}/{{ item }}"
mode: 0755
mode: "0755"
remote_src: true
with_items:
- "{{ crio_bin_files }}"
@@ -86,10 +86,24 @@
copy:
src: "{{ local_release_dir }}/cri-o/contrib/crio.service"
dest: /etc/systemd/system/crio.service
mode: 0755
mode: "0755"
remote_src: true
notify: Restart crio
- name: Cri-o | configure crio to use kube reserved cgroups
ansible.builtin.copy:
dest: /etc/systemd/system/crio.service.d/00-slice.conf
owner: root
group: root
mode: '0644'
content: |
[Service]
Slice={{ kube_reserved_cgroups_for_service_slice }}
notify: Restart crio
when:
- kube_reserved is defined and kube_reserved is true
- kube_reserved_cgroups_for_service_slice is defined
- name: Cri-o | update the bin dir for crio.service file
replace:
dest: /etc/systemd/system/crio.service
@@ -101,7 +115,7 @@
copy:
src: "{{ local_release_dir }}/cri-o/contrib/policy.json"
dest: /etc/containers/policy.json
mode: 0755
mode: "0755"
remote_src: true
notify: Restart crio
@@ -109,7 +123,7 @@
copy:
src: mounts.conf
dest: /etc/containers/mounts.conf
mode: 0644
mode: "0644"
when:
- ansible_os_family == 'RedHat'
notify: Restart crio
@@ -119,7 +133,7 @@
path: /etc/containers/oci/hooks.d
state: directory
owner: root
mode: 0755
mode: "0755"
- name: Cri-o | set overlay driver
community.general.ini_file:
@@ -127,7 +141,7 @@
section: storage
option: "{{ item.option }}"
value: "{{ item.value }}"
mode: 0644
mode: "0644"
with_items:
- option: driver
value: '"overlay"'
@@ -143,20 +157,20 @@
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"'' }}'
mode: 0644
mode: "0644"
- name: Cri-o | create directory registries configs
file:
path: /etc/containers/registries.conf.d
state: directory
owner: root
mode: 0755
mode: "0755"
- name: Cri-o | write registries configs
template:
src: registry.conf.j2
dest: "/etc/containers/registries.conf.d/10-{{ item.prefix | default(item.location) | regex_replace(':', '_') }}.conf"
mode: 0644
dest: "/etc/containers/registries.conf.d/10-{{ item.prefix | default(item.location) | regex_replace(':|/', '_') }}.conf"
mode: "0644"
loop: "{{ crio_registries }}"
notify: Restart crio
@@ -164,14 +178,14 @@
template:
src: unqualified.conf.j2
dest: "/etc/containers/registries.conf.d/01-unqualified.conf"
mode: 0644
mode: "0644"
notify: Restart crio
- name: Cri-o | write cri-o proxy drop-in
template:
src: http-proxy.conf.j2
dest: /etc/systemd/system/crio.service.d/http-proxy.conf
mode: 0644
mode: "0644"
notify: Restart crio
when: http_proxy is defined or https_proxy is defined

View File

@@ -8,7 +8,7 @@
lineinfile:
dest: /etc/yum.repos.d/amzn2-extras.repo
line: "[amzn2extra-docker]"
check_mode: yes
check_mode: true
register: amzn2_extras_docker_repo
when:
- amzn2_extras_file_stat.stat.exists
@@ -19,20 +19,8 @@
section: amzn2extra-docker
option: enabled
value: "0"
backup: yes
mode: 0644
backup: true
mode: "0644"
when:
- amzn2_extras_file_stat.stat.exists
- not amzn2_extras_docker_repo.changed
- name: Add container-selinux yum repo
yum_repository:
name: copr:copr.fedorainfracloud.org:lsm5:container-selinux
file: _copr_lsm5-container-selinux.repo
description: Copr repo for container-selinux owned by lsm5
baseurl: https://download.copr.fedorainfracloud.org/results/lsm5/container-selinux/epel-7-$basearch/
gpgcheck: yes
gpgkey: https://download.copr.fedorainfracloud.org/results/lsm5/container-selinux/pubkey.gpg
skip_if_unavailable: yes
enabled: yes
repo_gpgcheck: no

View File

@@ -1,8 +1,12 @@
---
crio_conmon: "{{ bin_dir }}/crio-conmon"
# cri-o binary files
crio_bin_files:
- conmon
- conmonrs
- crio-conmon
- crio-conmonrs
- crio-crun
- crio-runc
- crio
- pinns