# Cluster HA - Loghorn - Cilium - KubeVip

#### Architecture

<table border="1" id="bkmrk-hostname-ram-cpu-dis" style="border-collapse: collapse; width: 100%; height: 343.779px;"><colgroup><col style="width: 16.6847%;"></col><col style="width: 16.6847%;"></col><col style="width: 16.6847%;"></col><col style="width: 16.6847%;"></col><col style="width: 16.6847%;"></col><col style="width: 16.6847%;"></col></colgroup><tbody><tr style="height: 64.7443px;"><td class="align-center" style="height: 64.7443px;">##### **Hostname**

</td><td class="align-center" style="height: 64.7443px;">##### **RAM**

</td><td class="align-center" style="height: 64.7443px;">##### **CPU**

</td><td class="align-center" style="height: 64.7443px;">##### **DISQUE**

</td><td class="align-center" style="height: 64.7443px;">##### **IP**

</td><td style="height: 64.7443px;">##### **FONCTION**

</td></tr><tr style="height: 46.5057px;"><td style="height: 46.5057px;">k8s-master-1  
</td><td style="height: 46.5057px;">4 go</td><td style="height: 46.5057px;">2</td><td style="height: 46.5057px;">60 SSD</td><td style="height: 46.5057px;">192.168.1.101</td><td style="height: 46.5057px;">etcd + control-plane</td></tr><tr style="height: 46.5057px;"><td style="height: 46.5057px;">k8s-master-2</td><td style="height: 46.5057px;">4 go</td><td style="height: 46.5057px;">2</td><td style="height: 46.5057px;">60 SSD</td><td style="height: 46.5057px;">192.168.1.102</td><td style="height: 46.5057px;">etcd + control-plane</td></tr><tr style="height: 46.5057px;"><td style="height: 46.5057px;">k8s-master-3</td><td style="height: 46.5057px;">4 go</td><td style="height: 46.5057px;">2</td><td style="height: 46.5057px;">60 SSD</td><td style="height: 46.5057px;">192.168.1.103</td><td style="height: 46.5057px;">etcd + control-plane</td></tr><tr style="height: 46.5057px;"><td style="height: 46.5057px;">k8s-worker-1</td><td style="height: 46.5057px;">16 go</td><td style="height: 46.5057px;">4</td><td style="height: 46.5057px;">60 SSD + 100 Go HDD (/opt)</td><td style="height: 46.5057px;">192.168.1.104</td><td style="height: 46.5057px;">  
</td></tr><tr style="height: 46.5057px;"><td style="height: 46.5057px;">k8s-worker-2</td><td style="height: 46.5057px;">16 go</td><td style="height: 46.5057px;">4</td><td style="height: 46.5057px;">60 SSD + 100 Go HDD (/opt)</td><td style="height: 46.5057px;">192.168.1.105</td><td style="height: 46.5057px;">  
</td></tr><tr style="height: 46.5057px;"><td style="height: 46.5057px;">k8s-worker-3</td><td style="height: 46.5057px;">16 go</td><td style="height: 46.5057px;">4</td><td style="height: 46.5057px;">60 SSD + 100 Go HDD (/opt)</td><td style="height: 46.5057px;">192.168.1.106</td><td style="height: 46.5057px;"></td></tr><tr><td>VIP CLUSTER</td><td>192.168.1.100</td><td>  
</td><td>  
</td><td>  
</td><td></td></tr><tr><td>VIP WORKERS</td><td>192.168.1.99</td><td>  
</td><td>  
</td><td>  
</td><td></td></tr></tbody></table>

<p class="callout info">Tous les noeuds sont sur debian 13.</p>

#### Résumé :

Type de cluster : **Haute Disponibilité**

Stockage : **Loghorn**

Réseau : **Cilium**

Exposition des workers : **KubeVip**

#### Préparation du systèm

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)



#### Installation des prérequits

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)

#### Préparation du cluster HA (KubeVip)

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)


#### Initialisation du cluster

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)


#### Installation du réseau Cilium 

Installation de cilium-cli :

```bash
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-amd64.tar.gz
sudo tar xzvf cilium-linux-amd64.tar.gz -C /usr/local/bin
rm cilium-linux-amd64.tar.gz
```

Déploiement :

```
cilium install --set ipam.operator.clusterPoolIPv4PodCIDRList="10.10.0.0/16"
```

<div _ngcontent-ng-c3082907845="" class="code-block ng-tns-c3082907845-168 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" data-hveid="6" id="bkmrk--1" jslog="223238;track:impression,attention;BardVeMetadataKey:[["r_b8d74a3caa98e15d","c_fcb4ad331681ddd4",null,"rc_71108aef33d9eead",null,null,"fr",null,1,null,null,1,0]]"><div _ngcontent-ng-c3082907845="" class="formatted-code-block-internal-container ng-tns-c3082907845-168"><div _ngcontent-ng-c3082907845="" class="animated-opacity ng-tns-c3082907845-168"></div></div></div>Attendre que le statut soit opérationnel :

```bash
cilium status --wait
```

<div _ngcontent-ng-c3082907845="" class="code-block ng-tns-c3082907845-169 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" data-hveid="8" id="bkmrk--2" jslog="223238;track:impression,attention;BardVeMetadataKey:[["r_b8d74a3caa98e15d","c_fcb4ad331681ddd4",null,"rc_71108aef33d9eead",null,null,"fr",null,1,null,null,1,0]]"><div _ngcontent-ng-c3082907845="" class="formatted-code-block-internal-container ng-tns-c3082907845-169"><div _ngcontent-ng-c3082907845="" class="animated-opacity ng-tns-c3082907845-169"></div></div></div>Vérification de la conectivité :

```bash
cilium connectivity check
```

Suivi des pods :

```
watch kubectl get pods -n kube-system -l k8s-app=cilium
```

<div _ngcontent-ng-c3082907845="" class="code-block ng-tns-c3082907845-171 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" data-hveid="12" id="bkmrk--3" jslog="223238;track:impression,attention;BardVeMetadataKey:[["r_b8d74a3caa98e15d","c_fcb4ad331681ddd4",null,"rc_71108aef33d9eead",null,null,"fr",null,1,null,null,1,0]]"><div _ngcontent-ng-c3082907845="" class="formatted-code-block-internal-container ng-tns-c3082907845-171"><div _ngcontent-ng-c3082907845="" class="animated-opacity ng-tns-c3082907845-171"></div></div></div>cilium upgrade --set l2announcements.enabled=true \\  
\--set externalIPs.enabled=true \\  
\--set kubeProxyReplacement=true

 kubectl get pods -n kube-system | grep cili | grep -v opera | grep -v envoy | awk '{print $1}' | xargs kubectl delete po -n kube-system

#### Configuration du cluster

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)

#### Ajout des différents noeuds master au cluster

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)

#### Déployer Loghorn

CF : [https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha](https://docs.nehemiebarkia.fr/books/kubernetes/page/initialisation-de-mon-tout-premier-cluster-ha)

#### Ajout des lablels "workers" aux noeuds workers :

```bash
kubectl label node k8s-worker-1 node-role.kubernetes.io/worker="true"
kubectl label node k8s-worker-2 node-role.kubernetes.io/worker="true"
kubectl label node k8s-worker-3 node-role.kubernetes.io/worker="true"
```

#### Déployer une VIP pour les noeuds Workers

cat &lt;&lt;EOF | kubectl apply -f -  
apiVersion: cilium.io/v2alpha1  
kind: CiliumLoadBalancerIPPool  
metadata:  
 name: worker-vip-pool  
spec:  
 blocks:  
\- start: "192.168.1.2"  
 stop: "192.168.1.9"  
 serviceSelector:  
 matchLabels:  
 expose: "true"  
EOF

cat &lt;&lt;EOF | kubectl apply -f -  
apiVersion: cilium.io/v2alpha1  
kind: CiliumL2AnnouncementPolicy  
metadata:  
 name: worker-l2-policy  
 namespace: kube-system  
spec:  
 nodeSelector:  
 matchLabels:  
 node-role.kubernetes.io/worker: "true"  
 serviceSelector:  
 matchLabels:  
 expose: "true"  
 loadBalancerIPs: true  
 externalIPs: false  
 interfaces:  
\- ens18  
EOF

cat &lt;&lt;EOF | kubectl apply -f -  
apiVersion: apps/v1  
kind: Deployment  
metadata:  
 name: hello-world  
 namespace: default  
spec:  
 replicas: 2  
 selector:  
 matchLabels:  
 app: hello-world  
 template:  
 metadata:  
 labels:  
 app: hello-world  
 spec:  
 containers:  
\- name: hello  
 image: hashicorp/http-echo:latest  
 args:  
\- "-text=Hello from Cilium VIP 👋"  
\- "-listen=:8080"  
 ports:  
\- containerPort: 8080  
\---  
apiVersion: v1  
kind: Service  
metadata:  
 name: hello-world  
 namespace: default  
 labels:  
 expose: "true"  
 annotations:  
 lbipam.cilium.io/ips: "192.168.1.2" # IP fixe dans le pool  
spec:  
 type: LoadBalancer  
 selector:  
 app: hello-world  
 ports:  
\- port: 80  
 targetPort: 8080  
EOF

[![image.png](https://docs.nehemiebarkia.fr/uploads/images/gallery/2026-04/scaled-1680-/8o5image.png)](https://docs.nehemiebarkia.fr/uploads/images/gallery/2026-04/8o5image.png)