Skip to content

Commit

Permalink
Update calico to v3.16.5 including eBPF mode pre-requirements
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Lampert <ml@mlampert.de>
  • Loading branch information
maxilampert committed Nov 16, 2020
1 parent 3e84d52 commit bf0b680
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pkg/templates/canal/canal.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import (

const (
calicoImageRegistry = "docker.io"
installCNIImageName = "/calico/cni:v3.15.1"
calicoImageName = "/calico/node:v3.15.1"
controllerImageName = "/calico/kube-controllers:v3.15.1"
installCNIImageName = "/calico/cni:v3.16.5"
calicoImageName = "/calico/node:v3.16.5"
controllerImageName = "/calico/kube-controllers:v3.16.5"
flannelImageRegisty = "quay.io"
flannelImageName = "/coreos/flannel:v0.13.0"
canalComponentLabel = "canal"
Expand All @@ -51,7 +51,8 @@ const (
"plugins": [
{
"type": "calico",
"log_level": "info",
"log_level": "info",
"log_file_path": "/var/log/calico/cni/cni.log",
"datastore_type": "kubernetes",
"nodename": "__KUBERNETES_NODE_NAME__",
"mtu": __CNI_MTU__,
Expand Down
41 changes: 40 additions & 1 deletion pkg/templates/canal/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flann
maxUnavailable := intstr.FromInt(1)
terminationGracePeriodSeconds := int64(0)
privileged := true
optional := true
fileOrCreate := corev1.HostPathFileOrCreate
directoryOrCreate := corev1.HostPathDirectoryOrCreate
bidirectionalMountPropagation := corev1.MountPropagationBidirectional

commonLabels := map[string]string{
"k8s-app": "canal",
}
Expand Down Expand Up @@ -137,7 +140,18 @@ func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flann
Name: "install-cni",
Image: installCNIImage,
Command: []string{
"/install-cni.sh",
"/opt/cni/bin/install",
},
EnvFrom: []corev1.EnvFromSource{
{
// Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode.
ConfigMapRef: &corev1.ConfigMapEnvSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "kubernetes-services-endpoint",
},
Optional: &optional,
},
},
},
Env: []corev1.EnvVar{
{
Expand Down Expand Up @@ -197,6 +211,17 @@ func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flann
{
Name: "calico-node",
Image: calicoImage,
EnvFrom: []corev1.EnvFromSource{
{
// Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode.
ConfigMapRef: &corev1.ConfigMapEnvSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "kubernetes-services-endpoint",
},
Optional: &optional,
},
},
},
Env: []corev1.EnvVar{
{
// Use Kubernetes API as the backing datastore
Expand Down Expand Up @@ -330,6 +355,11 @@ func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flann
MountPath: "/var/run/nodeagent",
Name: "policysync",
},
{
MountPath: "/sys/fs/",
Name: "sysfs",
MountPropagation: &bidirectionalMountPropagation,
},
},
},
{
Expand Down Expand Up @@ -394,6 +424,15 @@ func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flann
},
},
},
{
Name: "sysfs",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/sys/fs/",
Type: &directoryOrCreate,
},
},
},
{
Name: "flannel-cfg",
VolumeSource: corev1.VolumeSource{
Expand Down

0 comments on commit bf0b680

Please sign in to comment.