Skip to content

Instantly share code, notes, and snippets.

@avoidik
Created September 25, 2021 20:54
Show Gist options
  • Save avoidik/d54991b9273a6798d502e98cce55df8d to your computer and use it in GitHub Desktop.
Save avoidik/d54991b9273a6798d502e98cce55df8d to your computer and use it in GitHub Desktop.
- name: CALICO_IPV4POOL_CIDR
value: "172.16.0.0/16"
- name: IP_AUTODETECTION_METHOD
value: "interface=eth1"
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
kubernetesVersion: 1.21.1
controlPlaneEndpoint: "k8s-master:6443"
networking:
podSubnet: 172.16.0.0/16
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
nodeRegistration:
criSocket: unix:///var/run/crio/crio.sock
localAPIEndpoint:
advertiseAddress: 192.168.50.101
bindPort: 6443
---
kind: KubeletConfiguration
apiVersion: kubelet.config.k8s.io/v1beta1
cgroupDriver: systemd
---
@avoidik
Copy link
Author

avoidik commented Sep 25, 2021

kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=interface=eth1
kubectl set env daemonset/calico-node -n kube-system CALICO_IPV4POOL_CIDR=172.16.0.0/16

@avoidik
Copy link
Author

avoidik commented Oct 28, 2024

all calico settings can be defined via tigera-operator as follows:

kubectl create -f - <<EOF
---
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
  name: default
spec:
  calicoNetwork:
    containerIPForwarding: Enabled
    nodeAddressAutodetectionV4:
      interface: eth1
    ipPools:
    - name: default-ipv4-ippool
      blockSize: 24
      cidr: 10.244.0.0/16
      encapsulation: VXLANCrossSubnet
      natOutgoing: Enabled
      nodeSelector: all()
---
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
  name: default
spec: {}
EOF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment