Files
IaC/ansible/k8s_post_install.yml

50 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
- name: CNI Fix
hosts: k8s_nodes
become: true
tasks:
- name: 1. Исправление сетевых путей (Все плагины сразу)
shell: |
mkdir -p /usr/lib/cni
ln -s /opt/cni/bin/cilium-cni /usr/lib/cni/cilium-cni
changed_when: true
- name: 2. Перезапуск Kubelet
shell: systemctl restart kubelet
- name: Cluster Resources
hosts: masters_group
become: false
tasks:
- name: Install Storage
shell: kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
- name: Install MetalLB
shell: kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.8/config/manifests/metallb-native.yaml
- name: Wait for MetalLB
shell: kubectl wait --namespace metallb-system --for=condition=ready pod -l app=metallb,component=controller --timeout=120s
ignore_errors: true
- name: Fix Webhook
shell: kubectl delete validatingwebhookconfiguration metallb-webhook-configuration
ignore_errors: true
- name: Config IP Pool
shell: |
cat <<EOF | kubectl apply -f -
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: main-pool
namespace: metallb-system
spec:
addresses:
- 10.33.33.210-10.33.33.250
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: l2-adv
namespace: metallb-system
EOF