Skip to main content
  1. Posts/

Konfigurasi Mode VXLAN pada Calico Kubernetes

2 mins
calico kubernetes calico
Table of Contents

Issue
#

Saat pertama kali setup kubernetes dengan calico network, muncul permasalahan load balancer dengan ingress tidak berfungsi sehingga trafik tidak terdistribusi ke semua pods pada node lain dan hanya terhubung ke node yang terdapat ingress nginx controller.

Jika dicek pada log ingress controller mendapati beberapa kali connection timeout ke tujuan network pod pada node lain.

2023/07/30 08:38:05 [error] 98#98: *96486 upstream timed out (110: Operation timed out) while connecting to upstream, client: 192.168.12.72, server: web8.srv1.de, request: "GET / HTTP/1.1", upstream: "http://10.10.80.209:80/", host: "web8.srv1.de"
2023/07/30 08:38:10 [error] 98#98: *96486 upstream timed out (110: Operation timed out) while connecting to upstream, client: 192.168.12.72, server: web8.srv1.de, request: "GET / HTTP/1.1", upstream: "http://10.10.80.210:80/", host: "web8.srv1.de"

Solution
#

Setelah penelusuran baru diketahui jika konfigurasi saat pertama men-deploy calico mode yang digunakan tidak VXLAN melainkan IPIP sehingga terdapat rute blackhole pada network pods yang dialokasikan pada setiap node.

Berikut cara untuk mengubah mode menjadi VXLAN.

Edit konfigurasi IPPool

kubectl edit ippools/default-ipv4-ippool

Selanjutnya ubah ipipMode menjadi Never dan vxlanMode menjadi Always

spec:
  allowedUses:
  - Workload
  - Tunnel
  blockSize: 26
  cidr: 10.10.0.0/16
  ipipMode: Never
  natOutgoing: true
  nodeSelector: all()
  vxlanMode: Always

Simpan konfigurasi lalu jalankan perintah berikut pada semua node yang ada di kluster kubernetes untuk me-restart pods.

crictl stop $(crictl ps --name calico* -q)

Tunggu beberapa saat sampai pods dibuat lagi secara otomatis.

Atau Anda dapat reboot semua node.

Related

Configure Calico with eBPF Mode
3 mins
calico kubernetes calico
Kubernetes Internal Errors: Failed Calling Webhook
1 min
kubernetes kubernetes
Setting Up Private Registry Using Harbor
4 mins
docker docker kubernetes
Kubernetes External DNS with PowerDNS
2 mins
kubernetes pdns kubernetes
Advanced L2 Configuration with MetalLB
3 mins
metallb metallb kubernetes
Using VLAN with MetalLB Kubernetes
2 mins
metallb kubernetes metallb