sudo curl -L https://github.com/projectcalico/calico/releases/latest/download/calicoctl-linux-amd64 -o calicoctl
sudo chmod +x calicoctl
sudo cp -p calicoctl /usr/bin
sudo calicoctl node status
sudo kubectl get nodes -owide
sudo kubectl drain --ignore-daemonsets <node name>
sudo calicoctl apply -f - --allow-version-mismatch <<EOF
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
name: default
spec:
logSeverityScreen: Info
nodeToNodeMeshEnabled: true
asNumber: 64567
EOF
sudo calicoctl get bgpconfiguration --allow-version-mismatch
sudo kubectl annotate node k8s-master-1 projectcalico.org/RouteReflectorClusterID=1.0.0.1
sudo kubectl label node k8s-master-1 route-reflector=true
sudo kubectl annotate node k8s-master-2 projectcalico.org/RouteReflectorClusterID=1.0.0.1
sudo kubectl label node k8s-master-2 route-reflector=true
sudo kubectl annotate node k8s-master-3 projectcalico.org/RouteReflectorClusterID=1.0.0.1
sudo kubectl label node k8s-master-3 route-reflector=true
sudo calicoctl apply -f - --allow-version-mismatch <<EOF
apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
name: rr-to-rr-peer
spec:
nodeSelector: has(route-reflector)
peerSelector: has(route-reflector)
EOF
sudo calicoctl apply -f - --allow-version-mismatch <<EOF
apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
name: node-peer-to-rr
spec:
nodeSelector: !has(route-reflector)
peerSelector: has(route-reflector)
EOF
sudo calicoctl node status
sudo calicoctl get bgppeer --allow-version-mismatch
sudo calicoctl patch bgpconfiguration default -p '{"spec": {"nodeToNodeMeshEnabled": false}}' --allow-version-mismatch
sudo calicoctl get bgpconfiguration --allow-version-mismatch
sudo calicoctl node status
sudo calicoctl get bgppeer --allow-version-mismatch
sudo kubectl edit ippools
apiVersion: projectcalico.org/v3
kind: IPPool
metadata:
name: default-ipv4-ippool
spec:
cidr: 192.160.0.0/16
ipipMode: CrossSubnet
natOutgoing: true
nodeSelector: all()
vxlanMode: Never
sudo calicoctl get ippool -o wide --allow-version-mismatch
sudo kubectl uncordon <node name>