@@ -1301,6 +1301,9 @@ write_files:
1301
1301
typha_service_name: "none"
1302
1302
{{- end }}
1303
1303
1304
+ # Configure the MTU to use
1305
+ veth_mtu: "1440"
1306
+
1304
1307
# The CNI network configuration to install on each node.
1305
1308
cni_network_config: |-
1306
1309
{
@@ -1489,6 +1492,7 @@ write_files:
1489
1492
metadata:
1490
1493
labels:
1491
1494
k8s-app: canal-master
1495
+ role.kubernetes.io/networking: "1"
1492
1496
annotations:
1493
1497
scheduler.alpha.kubernetes.io/critical-pod: ''
1494
1498
spec:
@@ -1518,16 +1522,44 @@ write_files:
1518
1522
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
1519
1523
terminationGracePeriodSeconds: 0
1520
1524
initContainers:
1521
- - name: remove-cni-networks
1522
- image: {{.HyperkubeImage.RepoWithTag}}
1523
- command:
1524
- - /bin/rm
1525
- - -rf
1526
- - /etc/kubernetes/cni/net.d/10-flannel.conflist
1527
- - /etc/kubernetes/cni/net.d/10-calico.conf
1525
+ # This container installs the CNI binaries
1526
+ # and CNI network config file on each node.
1527
+ - name: install-cni
1528
+ image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1529
+ command: ["/install-cni.sh"]
1530
+ env:
1531
+ - name: CNI_NET_DIR
1532
+ value: /etc/kubernetes/cni/net.d
1533
+ # Name of the CNI config file to create.
1534
+ - name: CNI_CONF_NAME
1535
+ value: "10-canal.conflist"
1536
+ # The CNI network config to install on each node.
1537
+ - name: CNI_NETWORK_CONFIG
1538
+ valueFrom:
1539
+ configMapKeyRef:
1540
+ name: canal-config
1541
+ key: cni_network_config
1542
+ # Set the hostname based on the k8s node name.
1543
+ - name: KUBERNETES_NODE_NAME
1544
+ valueFrom:
1545
+ fieldRef:
1546
+ fieldPath: spec.nodeName
1547
+ # CNI MTU Config variable
1548
+ - name: CNI_MTU
1549
+ valueFrom:
1550
+ configMapKeyRef:
1551
+ name: canal-config
1552
+ key: veth_mtu
1553
+ # Prevents the container from sleeping forever.
1554
+ - name: SLEEP
1555
+ value: "false"
1528
1556
volumeMounts:
1529
- - mountPath: /etc/kubernetes/cni/net.d
1530
- name: cni-net-dir
1557
+ - mountPath: /host/opt/cni/bin
1558
+ name: cni-bin-dir
1559
+ - mountPath: /host/etc/cni/net.d
1560
+ name: cni-net-dir
1561
+ securityContext:
1562
+ privileged: true
1531
1563
containers:
1532
1564
# Runs calico/node container on each Kubernetes node. This
1533
1565
# container programs network policy and routes on each
@@ -1538,6 +1570,9 @@ write_files:
1538
1570
# Use Kubernetes API as the backing datastore.
1539
1571
- name: DATASTORE_TYPE
1540
1572
value: "kubernetes"
1573
+ # Configure route aggregation based on pod CIDR.
1574
+ - name: USE_POD_CIDR
1575
+ value: "true"
1541
1576
# Enable felix logging.
1542
1577
- name: FELIX_LOGSEVERITYSYS
1543
1578
value: "Warning"
@@ -1565,6 +1600,12 @@ write_files:
1565
1600
# Typha support: is never enabled on masters
1566
1601
- name: FELIX_TYPHAK8SSERVICENAME
1567
1602
value: "none"
1603
+ # Set MTU for tunnel device used if ipip is enabled
1604
+ - name: FELIX_IPINIPMTU
1605
+ valueFrom:
1606
+ configMapKeyRef:
1607
+ name: canal-config
1608
+ key: veth_mtu
1568
1609
- name: NODENAME
1569
1610
valueFrom:
1570
1611
fieldRef:
@@ -1599,37 +1640,17 @@ write_files:
1599
1640
- mountPath: /lib/modules
1600
1641
name: lib-modules
1601
1642
readOnly: true
1643
+ - mountPath: /run/xtables.lock
1644
+ name: xtables-lock
1645
+ readOnly: false
1602
1646
- mountPath: /var/run/calico
1603
1647
name: var-run-calico
1604
1648
readOnly: false
1605
1649
- mountPath: /var/lib/calico
1606
1650
name: var-lib-calico
1607
1651
readOnly: false
1608
- # This container installs the Calico CNI binaries
1609
- # and CNI network config file on each node.
1610
- - name: install-cni
1611
- image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1612
- command: ["/install-cni.sh"]
1613
- env:
1614
- - name: CNI_NET_DIR
1615
- value: "/etc/kubernetes/cni/net.d"
1616
- - name: CNI_CONF_NAME
1617
- value: "10-calico.conflist"
1618
- # The CNI network config to install on each node.
1619
- - name: CNI_NETWORK_CONFIG
1620
- valueFrom:
1621
- configMapKeyRef:
1622
- name: canal-config
1623
- key: cni_network_config
1624
- - name: KUBERNETES_NODE_NAME
1625
- valueFrom:
1626
- fieldRef:
1627
- fieldPath: spec.nodeName
1628
- volumeMounts:
1629
- - mountPath: /host/opt/cni/bin
1630
- name: cni-bin-dir
1631
- - mountPath: /host/etc/cni/net.d
1632
- name: cni-net-dir
1652
+ - name: policysync
1653
+ mountPath: /var/run/nodeagent
1633
1654
# This container runs flannel using the kube-subnet-mgr backend
1634
1655
# for allocating subnets.
1635
1656
- name: flannel
@@ -1638,6 +1659,8 @@ write_files:
1638
1659
securityContext:
1639
1660
privileged: true
1640
1661
env:
1662
+ - name: FLANNELD_IPTABLES_FORWARD_RULES
1663
+ value: "false"
1641
1664
- name: POD_NAME
1642
1665
valueFrom:
1643
1666
fieldRef:
@@ -1657,8 +1680,9 @@ write_files:
1657
1680
name: canal-config
1658
1681
key: masquerade
1659
1682
volumeMounts:
1660
- - name: run
1661
- mountPath: /run
1683
+ - mountPath: /run/xtables.lock
1684
+ name: xtables-lock
1685
+ readOnly: false
1662
1686
- name: flannel-cfg
1663
1687
mountPath: /etc/kube-flannel/
1664
1688
volumes:
@@ -1672,20 +1696,26 @@ write_files:
1672
1696
- name: var-lib-calico
1673
1697
hostPath:
1674
1698
path: /var/lib/calico
1699
+ - name: xtables-lock
1700
+ hostPath:
1701
+ path: /run/xtables.lock
1702
+ type: FileOrCreate
1703
+ # Used by flannel.
1704
+ - name: flannel-cfg
1705
+ configMap:
1706
+ name: canal-config
1675
1707
# Used to install CNI.
1676
1708
- name: cni-bin-dir
1677
1709
hostPath:
1678
1710
path: /opt/cni/bin
1679
1711
- name: cni-net-dir
1680
1712
hostPath:
1681
1713
path: /etc/kubernetes/cni/net.d
1682
- # Used by flannel.
1683
- - name: run
1714
+ # Used to create per-pod Unix Domain Sockets
1715
+ - name: policysync
1684
1716
hostPath:
1685
- path: /run
1686
- - name: flannel-cfg
1687
- configMap:
1688
- name: canal-config
1717
+ type: DirectoryOrCreate
1718
+ path: /var/run/nodeagent
1689
1719
1690
1720
# Canal DaemonSet for Nodes - Typha can be enabled.
1691
1721
---
@@ -1699,6 +1729,7 @@ write_files:
1699
1729
namespace: kube-system
1700
1730
labels:
1701
1731
k8s-app: canal-node
1732
+ role.kubernetes.io/networking: "1"
1702
1733
spec:
1703
1734
selector:
1704
1735
matchLabels:
@@ -1711,6 +1742,7 @@ write_files:
1711
1742
metadata:
1712
1743
labels:
1713
1744
k8s-app: canal-node
1745
+ role.kubernetes.io/networking: "1"
1714
1746
annotations:
1715
1747
scheduler.alpha.kubernetes.io/critical-pod: ''
1716
1748
spec:
@@ -1740,16 +1772,44 @@ write_files:
1740
1772
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
1741
1773
terminationGracePeriodSeconds: 0
1742
1774
initContainers:
1743
- - name: remove-cni-networks
1744
- image: {{.HyperkubeImage.RepoWithTag}}
1745
- command:
1746
- - /bin/rm
1747
- - -rf
1748
- - /etc/kubernetes/cni/net.d/10-flannel.conflist
1749
- - /etc/kubernetes/cni/net.d/10-calico.conf
1775
+ # This container installs the CNI binaries
1776
+ # and CNI network config file on each node.
1777
+ - name: install-cni
1778
+ image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1779
+ command: ["/install-cni.sh"]
1780
+ env:
1781
+ - name: CNI_NET_DIR
1782
+ value: /etc/kubernetes/cni/net.d
1783
+ # Name of the CNI config file to create.
1784
+ - name: CNI_CONF_NAME
1785
+ value: "10-canal.conflist"
1786
+ # The CNI network config to install on each node.
1787
+ - name: CNI_NETWORK_CONFIG
1788
+ valueFrom:
1789
+ configMapKeyRef:
1790
+ name: canal-config
1791
+ key: cni_network_config
1792
+ # Set the hostname based on the k8s node name.
1793
+ - name: KUBERNETES_NODE_NAME
1794
+ valueFrom:
1795
+ fieldRef:
1796
+ fieldPath: spec.nodeName
1797
+ # CNI MTU Config variable
1798
+ - name: CNI_MTU
1799
+ valueFrom:
1800
+ configMapKeyRef:
1801
+ name: canal-config
1802
+ key: veth_mtu
1803
+ # Prevents the container from sleeping forever.
1804
+ - name: SLEEP
1805
+ value: "false"
1750
1806
volumeMounts:
1751
- - mountPath: /etc/kubernetes/cni/net.d
1752
- name: cni-net-dir
1807
+ - mountPath: /host/opt/cni/bin
1808
+ name: cni-bin-dir
1809
+ - mountPath: /host/etc/cni/net.d
1810
+ name: cni-net-dir
1811
+ securityContext:
1812
+ privileged: true
1753
1813
containers:
1754
1814
# Runs calico/node container on each Kubernetes node. This
1755
1815
# container programs network policy and routes on each
@@ -1760,6 +1820,9 @@ write_files:
1760
1820
# Use Kubernetes API as the backing datastore.
1761
1821
- name: DATASTORE_TYPE
1762
1822
value: "kubernetes"
1823
+ # Configure route aggregation based on pod CIDR.
1824
+ - name: USE_POD_CIDR
1825
+ value: "true"
1763
1826
# Enable felix logging.
1764
1827
- name: FELIX_LOGSEVERITYSYS
1765
1828
value: "Warning"
@@ -1784,6 +1847,12 @@ write_files:
1784
1847
# No IP address needed.
1785
1848
- name: IP
1786
1849
value: ""
1850
+ # Set MTU for tunnel device used if ipip is enabled
1851
+ - name: FELIX_IPINIPMTU
1852
+ valueFrom:
1853
+ configMapKeyRef:
1854
+ name: canal-config
1855
+ key: veth_mtu
1787
1856
# Typha support: controlled by the ConfigMap.
1788
1857
- name: FELIX_TYPHAK8SSERVICENAME
1789
1858
valueFrom:
@@ -1833,31 +1902,8 @@ write_files:
1833
1902
- mountPath: /var/lib/calico
1834
1903
name: var-lib-calico
1835
1904
readOnly: false
1836
- # This container installs the Calico CNI binaries
1837
- # and CNI network config file on each node.
1838
- - name: install-cni
1839
- image: {{ .Kubernetes.Networking.SelfHosting.CalicoCniImage.RepoWithTag }}
1840
- command: ["/install-cni.sh"]
1841
- env:
1842
- - name: CNI_NET_DIR
1843
- value: "/etc/kubernetes/cni/net.d"
1844
- - name: CNI_CONF_NAME
1845
- value: "10-calico.conflist"
1846
- # The CNI network config to install on each node.
1847
- - name: CNI_NETWORK_CONFIG
1848
- valueFrom:
1849
- configMapKeyRef:
1850
- name: canal-config
1851
- key: cni_network_config
1852
- - name: KUBERNETES_NODE_NAME
1853
- valueFrom:
1854
- fieldRef:
1855
- fieldPath: spec.nodeName
1856
- volumeMounts:
1857
- - mountPath: /host/opt/cni/bin
1858
- name: cni-bin-dir
1859
- - mountPath: /host/etc/cni/net.d
1860
- name: cni-net-dir
1905
+ - name: policysync
1906
+ mountPath: /var/run/nodeagent
1861
1907
# This container runs flannel using the kube-subnet-mgr backend
1862
1908
# for allocating subnets.
1863
1909
- name: flannel
@@ -1866,6 +1912,8 @@ write_files:
1866
1912
securityContext:
1867
1913
privileged: true
1868
1914
env:
1915
+ - name: FLANNELD_IPTABLES_FORWARD_RULES
1916
+ value: "false"
1869
1917
- name: POD_NAME
1870
1918
valueFrom:
1871
1919
fieldRef:
@@ -1888,8 +1936,6 @@ write_files:
1888
1936
- mountPath: /run/xtables.lock
1889
1937
name: xtables-lock
1890
1938
readOnly: false
1891
- - name: run
1892
- mountPath: /run
1893
1939
- name: flannel-cfg
1894
1940
mountPath: /etc/kube-flannel/
1895
1941
volumes:
@@ -1907,20 +1953,22 @@ write_files:
1907
1953
hostPath:
1908
1954
path: /run/xtables.lock
1909
1955
type: FileOrCreate
1956
+ # Used by flannel.
1957
+ - name: flannel-cfg
1958
+ configMap:
1959
+ name: canal-config
1910
1960
# Used to install CNI.
1911
1961
- name: cni-bin-dir
1912
1962
hostPath:
1913
1963
path: /opt/cni/bin
1914
1964
- name: cni-net-dir
1915
1965
hostPath:
1916
1966
path: /etc/kubernetes/cni/net.d
1917
- # Used by flannel.
1918
- - name: run
1967
+ # Used to create per-pod Unix Domain Sockets
1968
+ - name: policysync
1919
1969
hostPath:
1920
- path: /run
1921
- - name: flannel-cfg
1922
- configMap:
1923
- name: canal-config
1970
+ type: DirectoryOrCreate
1971
+ path: /var/run/nodeagent
1924
1972
---
1925
1973
# Source: calico/templates/kdd-crds.yaml
1926
1974
# Create all the CustomResourceDefinitions needed for
0 commit comments