50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
---
|
||
- name: CNI Fix
|
||
hosts: k8s_nodes
|
||
become: true
|
||
tasks:
|
||
- name: 1. Исправление сетевых путей (Все плагины сразу)
|
||
shell: |
|
||
mkdir -p /usr/lib/cni
|
||
ln -sf /opt/cni/bin/* /usr/lib/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 |