"type": "flannel" "delegate": {"type": "*",} are mandatory in /etc/kubernetes/cni/net.d/10-*.conf ?

13 views
Skip to first unread message

brant4test

unread,
Jun 1, 2017, 1:28:17 PM6/1/17
to CoreOS Dev
Hi, Team,

Under the portion of Network Configuration and Docker Configuration of the guide "CoreOS + Kubernetes Step By Step" below
https://coreos.com/kubernetes/docs/latest/deploy-master.html#set-up-calico-for-network-policy-optional

I saw this line
"
Networking is provided by Flannel and Calico.
Note:
If the pod-network is being managed independently of flannel, then the flannel parts of this guide can be skipped. In this case, Calico may still be used for providing network policy.
"
and
If using Flannel for networking, setup the Flannel CNI configuration with below

/etc/kubernetes/cni/net.d/10-flannel.conf
{
   
"name": "podnet",
   
"type": "flannel",
   
"delegate": {
       
"isDefaultGateway": true
   
}
}

If you intend to use Calico for networking,
/etc/kubernetes/cni/net.d/10-calico.conf
{
   
"name": "calico",
   
"type": "flannel",
   
"delegate": {
     
"type": "calico",
     
"etcd_endpoints": "__ETCD_ENDPOINTS__",
     
"log_level": "info",
     
"policy": {
         
"type": "k8s",
         
"k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__",
         
"k8s_auth_token": "__SERVICEACCOUNT_TOKEN__"
     
},
     
"kubernetes": {
         
"kubeconfig": "/etc/kubernetes/cni/net.d/__KUBECONFIG_FILENAME__"
     
}
   
}
}

My question is, does it mean that if even “the pod-network is being managed independently of flannel”, say to use Calico only, I still need to set
    "type": "flannel",
   
"delegate": {
     
"type": "calico",
in file /etc/kubernetes/cni/net.d/10-calico.conf
to allows "flannel" to wrap the CNI configuration of Calio plugin, and allows Calico to provide “policy” to containers running on Calico network?

And both lines here are mandatory, right? Cause CoreOS k8s is based on flannel by default.
    "type": "flannel",
   
"delegate": {

Thanks!

Best wishes,
Brant
Reply all
Reply to author
Forward
0 new messages