From 9f7f143903d732eee1e1204479be75f827a12386 Mon Sep 17 00:00:00 2001 From: Wei Kin Huang Date: Thu, 14 Sep 2017 21:18:11 -0400 Subject: [PATCH] Enable portmap for calico --- pkg/asset/internal/templates.go | 34 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) mode change 100644 => 100755 pkg/asset/internal/templates.go diff --git a/pkg/asset/internal/templates.go b/pkg/asset/internal/templates.go old mode 100644 new mode 100755 index 9a3a927c4..746accf6f --- a/pkg/asset/internal/templates.go +++ b/pkg/asset/internal/templates.go @@ -1183,24 +1183,34 @@ data: # The CNI network configuration to install on each node. cni_network_config: |- { - "name": "k8s-pod-network", - "cniVersion": "0.3.0", - "type": "calico", - "log_level": "debug", - "datastore_type": "kubernetes", - "nodename": "__KUBERNETES_NODE_NAME__", - "ipam": { + "name": "k8s-pod-network", + "cniVersion": "0.3.1", + "plugins": [ + { + "type": "calico", + "log_level": "debug", + "datastore_type": "kubernetes", + "nodename": "__KUBERNETES_NODE_NAME__", + "ipam": { "type": "host-local", "subnet": "usePodCidr" - }, - "policy": { + }, + "policy": { "type": "k8s", "k8s_auth_token": "__SERVICEACCOUNT_TOKEN__" - }, - "kubernetes": { + }, + "kubernetes": { "k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__", "kubeconfig": "__KUBECONFIG_FILEPATH__" + } + }, + { + "type": "portmap", + "capabilities": { + "portMappings": true + } } + ] } `) @@ -1289,6 +1299,8 @@ spec: image: {{ .Images.CalicoCNI }} command: ["/install-cni.sh"] env: + - name: CNI_CONF_NAME + value: 10-calico.conflist - name: CNI_NETWORK_CONFIG valueFrom: configMapKeyRef: