Fix CICD playbooks

This commit is contained in:
2025-09-27 18:50:28 +03:00
parent 61f83b4567
commit aa8bbb6984
6 changed files with 17 additions and 28 deletions

View File

@@ -30,7 +30,4 @@
group: root group: root
mode: '0644' mode: '0644'
notify: Restart_keepalived notify: Restart_keepalived
when: ansible_distribution == "Debian" and ansible_distribution_major_version == "12" when: ansible_distribution == "Debian" and ( ansible_distribution_major_version == "12" or ansible_distribution_major_version == "13" )

View File

@@ -20,7 +20,7 @@ frontend kubernetes_api
backend k8s_masters backend k8s_masters
option tcp-check option tcp-check
balance roundrobin balance source
{% for srv in haproxy_backend_server %} {% for srv in haproxy_backend_server %}
server {{ srv.backend_name }} {{ srv.backend_ip }}:{{ srv.backend_port }} check fall 3 rise 2 server {{ srv.backend_name }} {{ srv.backend_ip }}:{{ srv.backend_port }} check inter 5s fall 3 rise 2
{% endfor %} {% endfor %}

View File

@@ -6,10 +6,9 @@ pkg_list:
haproxy_bind_port: "6443" haproxy_bind_port: "6443"
haproxy_backend_server: haproxy_backend_server:
- { backend_name: "k8s-cr01", backend_ip: "192.168.111.191", backend_port: "6443"} - { backend_name: "k8s01-ctr01.lab.loc", backend_ip: "192.168.1.101", backend_port: "6443"}
- { backend_name: "k8s-cr02", backend_ip: "192.168.111.192", backend_port: "6443"} - { backend_name: "k8s01-ctr02.lab.loc", backend_ip: "192.168.1.102", backend_port: "6443"}
- { backend_name: "k8s-cr03", backend_ip: "192.168.111.193", backend_port: "6443"} - { backend_name: "k8s01-ctr03.lab.loc", backend_ip: "192.168.1.103", backend_port: "6443"}
keepalived_vip: "192.168.111.190/24" keepalived_vip: "192.168.1.190/24"
keepalived_auth_pass: "1q2w3e4r" keepalived_auth_pass: "1q2w3e4r"

View File

@@ -38,7 +38,6 @@
creates: /etc/apt/keyrings/kubernetes-apt-keyring.gpg creates: /etc/apt/keyrings/kubernetes-apt-keyring.gpg
when: not kube_keyring.stat.exists when: not kube_keyring.stat.exists
- name: Add Kubernetes apt repository - name: Add Kubernetes apt repository
apt_repository: apt_repository:
repo: "{{ k8s_repo_url }}" repo: "{{ k8s_repo_url }}"
@@ -61,9 +60,6 @@
shell: | shell: |
containerd config default > /etc/containerd/config.toml containerd config default > /etc/containerd/config.toml
args:
creates: /etc/containerd/config.toml
- name: Ensure SystemdCgroup = true - name: Ensure SystemdCgroup = true
replace: replace:
path: /etc/containerd/config.toml path: /etc/containerd/config.toml
@@ -71,9 +67,9 @@
replace: '\1true' replace: '\1true'
notify: Restart_containerd notify: Restart_containerd
- name: Update pause image to 3.9 - name: Update pause image to 3.10.1
replace: replace:
path: /etc/containerd/config.toml path: /etc/containerd/config.toml
regexp: 'registry.k8s.io/pause:3.6' regexp: 'registry.k8s.io/pause:3.8'
replace: 'registry.k8s.io/pause:3.9' replace: 'registry.k8s.io/pause:3.10.1'
notify: Restart_containerd notify: Restart_containerd

View File

@@ -2,9 +2,7 @@
- block: - block:
# - include_tasks: k8s-pre.yml - include_tasks: k8s-pre.yml
- include_tasks: k8s-control-plane-setup.yml # - include_tasks: k8s-control-plane-setup.yml
when: ansible_distribution == "Debian" and ( ansible_distribution_major_version == "12" or ansible_distribution_major_version == "13" )
when: ansible_distribution == "Debian" and ansible_distribution_major_version == "12"

View File

@@ -1,8 +1,8 @@
--- ---
k8s_apt_key_url: "https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key" k8s_apt_key_url: "https://pkgs.k8s.io/core:/stable:/v1.34/deb/Release.key"
k8s_repo_url: "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /" k8s_repo_url: "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.34/deb/ /"
k8s_pkg_list: k8s_pkg_list:
- apt-transport-https - apt-transport-https
@@ -16,10 +16,9 @@ k8s_pkg_list:
- kubectl - kubectl
k8s_clusterApi: "k8s-cl01-api.k8s-test.local:6443" k8s_clusterApi: "k8s01-api.lab.loc:6443"
k8s_clusterName: "k8s-cl01.k8s-test.local" k8s_clusterName: "k8s-cl01.k8s-cl01.local"
k8s_dnsDomain: "k8s-cl01.local" k8s_dnsDomain: "k8s-cl01.local"
k8s_podSubnet: "10.111.111.0/16" k8s_podSubnet: "10.111.111.0/16"
k8s_calico_manifest_file: "https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml" k8s_calico_manifest_file: "https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml"