27/01/2026

K8s – flannel to calico

Önce Flannel i kaldiriyoruz

kubectl delete daemonset -n kube-flannel kube-flannel-ds
kubectl delete cm kube-flannel-cfg -n kube-flannel
rm /etc/cni/net.d/10-flannel.conflist

Calico kurulumu : https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises

Calico kurulumunda Flanneli kaldirdiktan sonra
https://docs.tigera.io/calico/latest/getting-started/kubernetes/quickstart#step-2-install-calico
Kuruyoruz sonra custom-resources.yaml i editliyoruz.

# This section includes base Calico installation configuration.
# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.Installation
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
  name: default
spec:
  # Configures Calico networking.
  calicoNetwork:
    ipPools:
      - name: default-ipv4-ippool
        blockSize: 26
        cidr: 172.16.0.0/12
        encapsulation: VXLANCrossSubnet
        natOutgoing: Enabled
        nodeSelector: all()

---
# This section configures the Calico API server.
# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.APIServer
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
  name: default
spec: {}

---
# Configures the Calico Goldmane flow aggregator.
apiVersion: operator.tigera.io/v1
kind: Goldmane
metadata:
  name: default

---
# Configures the Calico Whisker observability UI.
apiVersion: operator.tigera.io/v1
kind: Whisker
metadata:
  name: default

Burada önemli olan seylerin basinda cidr ve block geliyor. Block o node a kac Ip lik bir blok izni verdigimizi ve cidr da pods lar icin hangi ip grubunu kullanacagimizi belirliyor. Whisker bir web interface policy leri incelemek icin.

Status u takip etmek icin

kubectl get tigerastatus
NAME        AVAILABLE   PROGRESSING   DEGRADED   SINCE
apiserver   True        False         False      16m
calico      True        False         False      16m
goldmane    True        False         False      16m
ippools     True        False         False      25h
whisker     True        False         False      25h

gerekli calicoctl i suradan node tipine ve OS e göre indirip executable yapmak gerekiyor
https://github.com/projectcalico/calico

chmod +x calicoctl-linux-amd64
sudo mv calicoctl-linux-amd64 /usr/local/bin/calicoctl
calicoctl
Usage:
  calicoctl [options] <command> [<args>...]
Invalid option: ''. Use flag '--help' to read about a specific subcommand.

artik CNI networkünü calico ile daha net takip edebiliriz

calicoctl ipam show --show-blocks
+----------+-------------------+------------+------------+-------------------+
| GROUPING |       CIDR        | IPS TOTAL  | IPS IN USE |     IPS FREE      |
+----------+-------------------+------------+------------+-------------------+
| IP Pool  | 172.16.0.0/12     | 1.0486e+06 | 5 (0%)     | 1.0486e+06 (100%) |
| Block    | 172.18.186.0/26   |         64 | 3 (5%)     | 61 (95%)          |
| Block    | 172.19.106.64/26  |         64 | 1 (2%)     | 63 (98%)          |
| Block    | 172.31.134.128/26 |         64 | 1 (2%)     | 63 (98%)          |
+----------+-------------------+------------+------------+-------------------+

Calico BGP protokolünü kullaniyor

sudo calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+-------------------+-------+------------+-------------+
| PEER ADDRESS  |     PEER TYPE     | STATE |   SINCE    |    INFO     |
+---------------+-------------------+-------+------------+-------------+
| 192.168.69.55 | node-to-node mesh | up    | 2026-02-16 | Established |
| 192.168.69.56 | node-to-node mesh | up    | 2026-02-16 | Established |
+---------------+-------------------+-------+------------+-------------+

IPv6 BGP status
No IPv6 peers found.

aslinda bu BGP protokolünü kullanarak networkümüzde bulunan baska bir BGP sistemi ile pairing yapip Cluster disinda ki uygulamarin vs de direk erisimini saglayabiliriz podlarimiza gerekirse.