@@ -1320,6 +1320,9 @@ write_files:
1320
1320
typha_service_name: "none"
1321
1321
{{- end }}
1322
1322
1323
+ # Configure the MTU to use
1324
+ veth_mtu: "1440"
1325
+
1323
1326
# The CNI network configuration to install on each node.
1324
1327
cni_network_config: |-
1325
1328
{
@@ -1502,6 +1505,7 @@ write_files:
1502
1505
metadata:
1503
1506
labels:
1504
1507
k8s-app: canal-master
1508
+ role.kubernetes.io/networking: "1"
1505
1509
annotations:
1506
1510
scheduler.alpha.kubernetes.io/critical-pod: ''
1507
1511
spec:
@@ -1531,16 +1535,44 @@ write_files:
1531
1535
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
1532
1536
terminationGracePeriodSeconds: 0
1533
1537
initContainers:
1534
- - name: remove-cni-networks
1535
- image: {{.HyperkubeImage.RepoWithTag}}
1536
- command:
1537
- - /bin/rm
1538
- - -rf
1539
- - /etc/kubernetes/cni/net.d/10-flannel.conflist
1540
- - /etc/kubernetes/cni/net.d/10-calico.conf
1538
+ # This container installs the CNI binaries
1539
+ # and CNI network config file on each node.
1540
+ - name: install-cni
1541
+ image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1542
+ command: ["/install-cni.sh"]
1543
+ env:
1544
+ - name: CNI_NET_DIR
1545
+ value: /etc/kubernetes/cni/net.d
1546
+ # Name of the CNI config file to create.
1547
+ - name: CNI_CONF_NAME
1548
+ value: "10-canal.conflist"
1549
+ # The CNI network config to install on each node.
1550
+ - name: CNI_NETWORK_CONFIG
1551
+ valueFrom:
1552
+ configMapKeyRef:
1553
+ name: canal-config
1554
+ key: cni_network_config
1555
+ # Set the hostname based on the k8s node name.
1556
+ - name: KUBERNETES_NODE_NAME
1557
+ valueFrom:
1558
+ fieldRef:
1559
+ fieldPath: spec.nodeName
1560
+ # CNI MTU Config variable
1561
+ - name: CNI_MTU
1562
+ valueFrom:
1563
+ configMapKeyRef:
1564
+ name: canal-config
1565
+ key: veth_mtu
1566
+ # Prevents the container from sleeping forever.
1567
+ - name: SLEEP
1568
+ value: "false"
1541
1569
volumeMounts:
1542
- - mountPath: /etc/kubernetes/cni/net.d
1543
- name: cni-net-dir
1570
+ - mountPath: /host/opt/cni/bin
1571
+ name: cni-bin-dir
1572
+ - mountPath: /host/etc/cni/net.d
1573
+ name: cni-net-dir
1574
+ securityContext:
1575
+ privileged: true
1544
1576
containers:
1545
1577
# Runs calico/node container on each Kubernetes node. This
1546
1578
# container programs network policy and routes on each
@@ -1551,6 +1583,9 @@ write_files:
1551
1583
# Use Kubernetes API as the backing datastore.
1552
1584
- name: DATASTORE_TYPE
1553
1585
value: "kubernetes"
1586
+ # Configure route aggregation based on pod CIDR.
1587
+ - name: USE_POD_CIDR
1588
+ value: "true"
1554
1589
# Enable felix logging.
1555
1590
- name: FELIX_LOGSEVERITYSYS
1556
1591
value: "info"
@@ -1578,6 +1613,12 @@ write_files:
1578
1613
# Typha support: is never enabled on masters
1579
1614
- name: FELIX_TYPHAK8SSERVICENAME
1580
1615
value: "none"
1616
+ # Set MTU for tunnel device used if ipip is enabled
1617
+ - name: FELIX_IPINIPMTU
1618
+ valueFrom:
1619
+ configMapKeyRef:
1620
+ name: canal-config
1621
+ key: veth_mtu
1581
1622
- name: NODENAME
1582
1623
valueFrom:
1583
1624
fieldRef:
@@ -1612,37 +1653,17 @@ write_files:
1612
1653
- mountPath: /lib/modules
1613
1654
name: lib-modules
1614
1655
readOnly: true
1656
+ - mountPath: /run/xtables.lock
1657
+ name: xtables-lock
1658
+ readOnly: false
1615
1659
- mountPath: /var/run/calico
1616
1660
name: var-run-calico
1617
1661
readOnly: false
1618
1662
- mountPath: /var/lib/calico
1619
1663
name: var-lib-calico
1620
1664
readOnly: false
1621
- # This container installs the Calico CNI binaries
1622
- # and CNI network config file on each node.
1623
- - name: install-cni
1624
- image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1625
- command: ["/install-cni.sh"]
1626
- env:
1627
- - name: CNI_NET_DIR
1628
- value: "/etc/kubernetes/cni/net.d"
1629
- - name: CNI_CONF_NAME
1630
- value: "10-calico.conflist"
1631
- # The CNI network config to install on each node.
1632
- - name: CNI_NETWORK_CONFIG
1633
- valueFrom:
1634
- configMapKeyRef:
1635
- name: canal-config
1636
- key: cni_network_config
1637
- - name: KUBERNETES_NODE_NAME
1638
- valueFrom:
1639
- fieldRef:
1640
- fieldPath: spec.nodeName
1641
- volumeMounts:
1642
- - mountPath: /host/opt/cni/bin
1643
- name: cni-bin-dir
1644
- - mountPath: /host/etc/cni/net.d
1645
- name: cni-net-dir
1665
+ - name: policysync
1666
+ mountPath: /var/run/nodeagent
1646
1667
# This container runs flannel using the kube-subnet-mgr backend
1647
1668
# for allocating subnets.
1648
1669
- name: flannel
@@ -1651,6 +1672,8 @@ write_files:
1651
1672
securityContext:
1652
1673
privileged: true
1653
1674
env:
1675
+ - name: FLANNELD_IPTABLES_FORWARD_RULES
1676
+ value: "false"
1654
1677
- name: POD_NAME
1655
1678
valueFrom:
1656
1679
fieldRef:
@@ -1670,12 +1693,13 @@ write_files:
1670
1693
name: canal-config
1671
1694
key: masquerade
1672
1695
volumeMounts:
1673
- - name: run
1674
- mountPath: /run
1675
- - name: flannel-cfg
1676
- mountPath: /etc/kube-flannel/
1696
+ - mountPath: /run/xtables.lock
1697
+ name: xtables-lock
1698
+ readOnly: false
1699
+ - name: flannel-cfg
1700
+ mountPath: /etc/kube-flannel/
1677
1701
volumes:
1678
- # Used by calico/node .
1702
+ # Used by canal .
1679
1703
- name: lib-modules
1680
1704
hostPath:
1681
1705
path: /lib/modules
@@ -1685,20 +1709,26 @@ write_files:
1685
1709
- name: var-lib-calico
1686
1710
hostPath:
1687
1711
path: /var/lib/calico
1712
+ - name: xtables-lock
1713
+ hostPath:
1714
+ path: /run/xtables.lock
1715
+ type: FileOrCreate
1716
+ # Used by flannel.
1717
+ - name: flannel-cfg
1718
+ configMap:
1719
+ name: canal-config
1688
1720
# Used to install CNI.
1689
1721
- name: cni-bin-dir
1690
1722
hostPath:
1691
1723
path: /opt/cni/bin
1692
1724
- name: cni-net-dir
1693
1725
hostPath:
1694
1726
path: /etc/kubernetes/cni/net.d
1695
- # Used by flannel.
1696
- - name: run
1727
+ # Used to create per-pod Unix Domain Sockets
1728
+ - name: policysync
1697
1729
hostPath:
1698
- path: /run
1699
- - name: flannel-cfg
1700
- configMap:
1701
- name: canal-config
1730
+ type: DirectoryOrCreate
1731
+ path: /var/run/nodeagent
1702
1732
1703
1733
# Canal DaemonSet for Nodes - Typha can be enabled.
1704
1734
---
@@ -1712,6 +1742,7 @@ write_files:
1712
1742
namespace: kube-system
1713
1743
labels:
1714
1744
k8s-app: canal-node
1745
+ role.kubernetes.io/networking: "1"
1715
1746
spec:
1716
1747
selector:
1717
1748
matchLabels:
@@ -1753,16 +1784,44 @@ write_files:
1753
1784
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
1754
1785
terminationGracePeriodSeconds: 0
1755
1786
initContainers:
1756
- - name: remove-cni-networks
1757
- image: {{.HyperkubeImage.RepoWithTag}}
1758
- command:
1759
- - /bin/rm
1760
- - -rf
1761
- - /etc/kubernetes/cni/net.d/10-flannel.conflist
1762
- - /etc/kubernetes/cni/net.d/10-calico.conf
1787
+ # This container installs the CNI binaries
1788
+ # and CNI network config file on each node.
1789
+ - name: install-cni
1790
+ image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1791
+ command: ["/install-cni.sh"]
1792
+ env:
1793
+ - name: CNI_NET_DIR
1794
+ value: /etc/kubernetes/cni/net.d
1795
+ # Name of the CNI config file to create.
1796
+ - name: CNI_CONF_NAME
1797
+ value: "10-canal.conflist"
1798
+ # The CNI network config to install on each node.
1799
+ - name: CNI_NETWORK_CONFIG
1800
+ valueFrom:
1801
+ configMapKeyRef:
1802
+ name: canal-config
1803
+ key: cni_network_config
1804
+ # Set the hostname based on the k8s node name.
1805
+ - name: KUBERNETES_NODE_NAME
1806
+ valueFrom:
1807
+ fieldRef:
1808
+ fieldPath: spec.nodeName
1809
+ # CNI MTU Config variable
1810
+ - name: CNI_MTU
1811
+ valueFrom:
1812
+ configMapKeyRef:
1813
+ name: canal-config
1814
+ key: veth_mtu
1815
+ # Prevents the container from sleeping forever.
1816
+ - name: SLEEP
1817
+ value: "false"
1763
1818
volumeMounts:
1764
- - mountPath: /etc/kubernetes/cni/net.d
1765
- name: cni-net-dir
1819
+ - mountPath: /host/opt/cni/bin
1820
+ name: cni-bin-dir
1821
+ - mountPath: /host/etc/cni/net.d
1822
+ name: cni-net-dir
1823
+ securityContext:
1824
+ privileged: true
1766
1825
containers:
1767
1826
# Runs calico/node container on each Kubernetes node. This
1768
1827
# container programs network policy and routes on each
@@ -1773,6 +1832,9 @@ write_files:
1773
1832
# Use Kubernetes API as the backing datastore.
1774
1833
- name: DATASTORE_TYPE
1775
1834
value: "kubernetes"
1835
+ # Configure route aggregation based on pod CIDR.
1836
+ - name: USE_POD_CIDR
1837
+ value: "true"
1776
1838
# Enable felix logging.
1777
1839
- name: FELIX_LOGSEVERITYSYS
1778
1840
value: "info"
@@ -1797,6 +1859,12 @@ write_files:
1797
1859
# No IP address needed.
1798
1860
- name: IP
1799
1861
value: ""
1862
+ # Set MTU for tunnel device used if ipip is enabled
1863
+ - name: FELIX_IPINIPMTU
1864
+ valueFrom:
1865
+ configMapKeyRef:
1866
+ name: canal-config
1867
+ key: veth_mtu
1800
1868
# Typha support: controlled by the ConfigMap.
1801
1869
- name: FELIX_TYPHAK8SSERVICENAME
1802
1870
valueFrom:
@@ -1846,31 +1914,8 @@ write_files:
1846
1914
- mountPath: /var/lib/calico
1847
1915
name: var-lib-calico
1848
1916
readOnly: false
1849
- # This container installs the Calico CNI binaries
1850
- # and CNI network config file on each node.
1851
- - name: install-cni
1852
- image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1853
- command: ["/install-cni.sh"]
1854
- env:
1855
- - name: CNI_NET_DIR
1856
- value: "/etc/kubernetes/cni/net.d"
1857
- - name: CNI_CONF_NAME
1858
- value: "10-calico.conflist"
1859
- # The CNI network config to install on each node.
1860
- - name: CNI_NETWORK_CONFIG
1861
- valueFrom:
1862
- configMapKeyRef:
1863
- name: canal-config
1864
- key: cni_network_config
1865
- - name: KUBERNETES_NODE_NAME
1866
- valueFrom:
1867
- fieldRef:
1868
- fieldPath: spec.nodeName
1869
- volumeMounts:
1870
- - mountPath: /host/opt/cni/bin
1871
- name: cni-bin-dir
1872
- - mountPath: /host/etc/cni/net.d
1873
- name: cni-net-dir
1917
+ - name: policysync
1918
+ mountPath: /var/run/nodeagent
1874
1919
# This container runs flannel using the kube-subnet-mgr backend
1875
1920
# for allocating subnets.
1876
1921
- name: flannel
@@ -1879,6 +1924,8 @@ write_files:
1879
1924
securityContext:
1880
1925
privileged: true
1881
1926
env:
1927
+ - name: FLANNELD_IPTABLES_FORWARD_RULES
1928
+ value: "false"
1882
1929
- name: POD_NAME
1883
1930
valueFrom:
1884
1931
fieldRef:
@@ -1901,12 +1948,10 @@ write_files:
1901
1948
- mountPath: /run/xtables.lock
1902
1949
name: xtables-lock
1903
1950
readOnly: false
1904
- - name: run
1905
- mountPath: /run
1906
1951
- name: flannel-cfg
1907
1952
mountPath: /etc/kube-flannel/
1908
1953
volumes:
1909
- # Used by calico/node.
1954
+ # Used by canal
1910
1955
- name: lib-modules
1911
1956
hostPath:
1912
1957
path: /lib/modules
@@ -1920,20 +1965,22 @@ write_files:
1920
1965
hostPath:
1921
1966
path: /run/xtables.lock
1922
1967
type: FileOrCreate
1968
+ # Used by flannel.
1969
+ - name: flannel-cfg
1970
+ configMap:
1971
+ name: canal-config
1923
1972
# Used to install CNI.
1924
1973
- name: cni-bin-dir
1925
1974
hostPath:
1926
1975
path: /opt/cni/bin
1927
1976
- name: cni-net-dir
1928
1977
hostPath:
1929
1978
path: /etc/kubernetes/cni/net.d
1930
- # Used by flannel.
1931
- - name: run
1979
+ # Used to create per-pod Unix Domain Sockets
1980
+ - name: policysync
1932
1981
hostPath:
1933
- path: /run
1934
- - name: flannel-cfg
1935
- configMap:
1936
- name: canal-config
1982
+ type: DirectoryOrCreate
1983
+ path: /var/run/nodeagent
1937
1984
---
1938
1985
# Source: calico/templates/kdd-crds.yaml
1939
1986
# Create all the CustomResourceDefinitions needed for
0 commit comments