Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to communicate across kubernetes nodes? #7

Closed
YYGCui opened this issue May 5, 2017 · 7 comments
Closed

Is there a way to communicate across kubernetes nodes? #7

YYGCui opened this issue May 5, 2017 · 7 comments

Comments

@YYGCui
Copy link

YYGCui commented May 5, 2017

I use flannel to communicate across kubernetes nodes. pods can communicate via the default interface eth0.

If I add more one, the cni configure file looks as follows:
---master---

      "type": "ptp",
      "ipam": {
        "type": "host-local",
        "subnet": "172.16.1.0/24",
        "routes": [
          { "dst": "0.0.0.0/0" }
        ],
        "gateway": "172.16.1.1"
     }

---minion---

      "type": "ptp",
      "ipam": {
        "type": "host-local",
        "subnet": "172.16.2.0/24",
        "routes": [
          { "dst": "0.0.0.0/0" }
        ],
        "gateway": "172.16.2.1"
     }

the pods in the same node can reachable, but across nodes unreachable because they are in different subnets.(use different subnets to avoid ip conflict)

I cannot find a way to make them reachable.

should I use the default route? (created by flannel-docker-bridge)

Is there are some example for that?

@rkamudhan
Copy link
Member

Why can't you use flannel Multiple Network use case ? It is more efficient than using ptp plugin.

@YYGCui
Copy link
Author

YYGCui commented May 5, 2017

Actually, I'd like to use flannel Multiple network.
But I can't sure that if two flannel network can be used in a kubernetes cluster

@YYGCui
Copy link
Author

YYGCui commented May 5, 2017

If I understand well, the conf should be like

{
   "name":"mynet",
   "type":"multus",
   "delegates":[
      {
#the second network
         "type":"flannel",
         "delegate":{
            "bridge": "mybr0",
            "mtu":1472,
            "ipMasq":false,
            "isGateway":true,
            "ipam":{
               "type":"host-local",
               "subnet":"10.1.17.0/24"
            }
         }
      },
      {
#the default network
         "type":"flannel",
         "masterplugin":true,
         "delegate":{
            "isDefaultGateway":true
         }
      }
   ]
}

Am I right?

@rkamudhan
Copy link
Member

Please follow the steps for the Mutliple flannel Network. To my knowledge ipam is not allowed in flannel delegate, please correct me if I am wrong. Flannel get the IPAM information from the /run/flannel/subnet.env

@rkamudhan
Copy link
Member

@YYGCui - Is the Multiple Flannel Network, solved your issue ?

@YYGCui
Copy link
Author

YYGCui commented May 11, 2017

Multiple Flannel Network is worked for me. Thanks!

the conf file

{
    "name": "multus-demo-network",
    "type": "multus",
    "delegates": [
        {
                "type": "flannel",
                "name": "flannel.2",
                "subnetFile": "/run/flannel/networks/2.env",
                "dataDir": "/var/lib/cni/flannel/2",
                "delegate": {
                        "bridge": "kbr1"
                }
        },
        {
                "type": "flannel",
                "name": "flannel.1",
                "subnetFile": "/run/flannel/subnet.env",
                "dataDir": "/var/lib/cni/flannel",
                "masterplugin": true,
                "delegate": {
                        "bridge": "kbr0",
                        "isDefaultGateway": true
                }
        }
    ]
}

@YYGCui YYGCui closed this as completed May 11, 2017
@rkamudhan
Copy link
Member

@YYGCui added your CNI config information in the Multus README.md file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants