Skip to content

Commit

Permalink
kubenet containerd: match upstream configuration
Browse files Browse the repository at this point in the history
Configure kubenet in containerd/CNI mode to match upstream configuration.

Biggest change is a move to the ptp plugin.
  • Loading branch information
justinsb committed Feb 7, 2021
1 parent dbd1925 commit 691f072
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
13 changes: 6 additions & 7 deletions nodeup/pkg/model/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,15 @@ runtime-endpoint: unix:///run/containerd/containerd.sock

// buildCNIConfigTemplateFile is responsible for creating a special template for setups using Kubenet
func (b *ContainerdBuilder) buildCNIConfigTemplateFile(c *fi.ModelBuilderContext) {

// Based on https://github.com/kubernetes/kubernetes/blob/15a8a8ec4a3275a33b7f8eb3d4d98db2abad55b7/cluster/gce/gci/configure-helper.sh#L2911-L2937
// TODO: Should we set MTU? upstream has "mtu": 1460
contents := `{
"cniVersion": "0.4.0",
"name": "containerd-net",
"cniVersion": "0.3.1",
"name": "k8s-pod-network",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"promiscMode": true,
"type": "ptp",
"ipam": {
"type": "host-local",
"ranges": [[{"subnet": "{{.PodCIDR}}"}]],
Expand Down
10 changes: 3 additions & 7 deletions nodeup/pkg/model/tests/containerdbuilder/simple/tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
contents: |
{
"cniVersion": "0.4.0",
"name": "containerd-net",
"cniVersion": "0.3.1",
"name": "k8s-pod-network",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"promiscMode": true,
"type": "ptp",
"ipam": {
"type": "host-local",
"ranges": [[{"subnet": "{{.PodCIDR}}"}]],
Expand Down

0 comments on commit 691f072

Please sign in to comment.