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

CNI networking installation support #621

Merged
merged 6 commits into from
Oct 20, 2016

Conversation

chrislovecnm
Copy link
Contributor

@chrislovecnm chrislovecnm commented Oct 9, 2016

Work on getting cni networks such a weave functioning. I did encounter this probably kubernetes/kubernetes#20379

Oct  9 04:09:44 ip-172-20-111-165 kubelet[999]: E1009 04:09:44.019978     999 kubelet.go:2095] Failed killing the pod "cassandra-5": failed to "TeardownNetwork" for "cassandra-5_default" with TeardownNetworkError: "Failed to teardown network for pod \"b4f4f534-8dd5-11e6-a44d-02c1f7bba931\" using network plugins \"cni\": no such file or directory"

This is now tested an ready for master. I will be testing an install above the 50 node limit to fully vet.

@@ -16,7 +17,12 @@ type KubenetNetworkingSpec struct {
}

// ExternalNetworkingSpec is the specification for networking that is implemented by a Daemonset
// It also uses kubenet
type ExternalNetworkingSpec struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious - what are we using the empty struct for?

@chrislovecnm
Copy link
Contributor Author

Yah noticed that too, just modeled the original code. @justinsb?

# AWS MTU is 9001
NetworkPluginMTU: 9001

# TODO: Having to duplicate MasterKubelet & Kubelet feels wrong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What feels wrong here? Generally vagrant TODO's make me at least want to raise a question :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments ported over from the files I stole from kubenet. I can remove.

@@ -23,6 +23,9 @@ func buildCloudupTags(cluster *api.Cluster) (map[string]struct{}, error) {
// external is based on kubenet
tags["_networking_kubenet"] = struct{}{}
tags["_networking_external"] = struct{}{}
} else if networking.CNI != nil {
// external is based on cni, weave, flannel, etc
tags["_networking_cni"] = struct{}{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More empty structs? Are these just place holders for future members or something?

Copy link
Contributor Author

@chrislovecnm chrislovecnm Oct 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost answered in French. Again just modeling code that was done before. We can cleanup if you care to recommend a pattern.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the "best way" to do sets in golang

@chrislovecnm
Copy link
Contributor Author

should solve #537 as well

@chrislovecnm
Copy link
Contributor Author

Should solve #315 as well

@chrislovecnm chrislovecnm force-pushed the cni-networks branch 2 times, most recently from 13a023c to 29dafb6 Compare October 11, 2016 20:44
@WillPlatnick
Copy link
Contributor

I am so excited for this. Thanks @chrislovecnm

@chrislovecnm
Copy link
Contributor Author

@WillPlatnick looking good, just needing more testing.

@@ -0,0 +1,7 @@
Kubelet:
# AWS MTU is 9001
NetworkPluginMTU: 9001
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrislovecnm , I got a question about this MTU. According to Weave document, the MTU should be 8950 as there is an overhead of 50 bytes for Vxlan, will this be handled automatically?

Another question is I can see kubenet is using the MTU passed to the plugin (https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/network/kubenet/kubenet_linux.go#L128), however, for cni it doesn't seem it's using the MTU value (https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/network/cni/cni.go#L144). Is this been handled somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to remove it. Thanks

@offlinehacker
Copy link

We are testing on new cluster, and it seems to work without problems so far, i also did some basic policy testing which also seems to work.

@chrislovecnm chrislovecnm force-pushed the cni-networks branch 2 times, most recently from 6b00f9b to 03ac69e Compare October 14, 2016 18:05
Copy link
Contributor

@krisnova krisnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chrislovecnm
Copy link
Contributor Author

I need more testing and squash my commits prettier :)

@chrislovecnm chrislovecnm force-pushed the cni-networks branch 2 times, most recently from 19ed4c8 to c24836a Compare October 18, 2016 21:15
@chrislovecnm chrislovecnm changed the title [WIP] CNI networks CNI networking installation support Oct 18, 2016
@chrislovecnm
Copy link
Contributor Author

chrislovecnm commented Oct 18, 2016

@JuJu227 if you could take a look, specifically at the documentation, would be much appreciated.

@kris-nova & @justinsb the commit are squashed by me already.

{Name: "us-west-2a", CIDR: "172.20.2.0/27"},
{Name: "us-west-2b", CIDR: "172.20.2.32/27"},
{Name: "us-west-2c", CIDR: "172.20.2.64/27"},
}*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest removing dead code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@krisnova
Copy link
Contributor

@chrislovecnm - this looks good.. From a code/documentation standpoint this all makes sense. Will have to defer to you and @justinsb for functionality success.

UpdatePolicy string
}

func buildCluster(clusterArgs interface{}) *api.Cluster {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this isn't just clusterArgs *ClusterParams ?

@justinsb
Copy link
Member

LGTM... found a few problems:

  1m    1m      1       {kubelet ip-172-20-68-75.ec2.internal}          Warning FailedSync      Error syncing pod, skipping: failed to "SetupNetwork" for "guestbook-03xsn_default" with SetupNetworkError: "Failed to setup network for pod \"guestbook-03xsn_default(4c4a9f7b-9676-11e6-b502-061a7a80de7a)\" using network plugins \"cni\": unable to allocate IP address: Post http://127.0.0.1:6784/ip/416e5685e89795642fa79a0959dfbf687aa452fdba527c0ff11ad8dd1519c652: dial tcp 127.0.0.1:6784: getsockopt: connection refused; Skipping pod"
  • If we can change the pod IP range away from 10.0.0.0/8 that will avoid conflicts with EC2 classic. We default to 100.64.x.x, if we can honor that it's probably best
  • At 125 nodes, started seeing this error:
E1020 03:58:52.832357       5 endpoints_controller.go:514] Endpoints "guestbook" is invalid: [subsets[0].addresses[52].nodeName: Forbidden: Cannot change NodeName for 10.38.0.1 to ip-172-20-92-169.ec2.internal, subsets[0].addresses[97].nodeName: Forbidden: Cannot change NodeName for 10.42.128.1 to ip-172-20-91-115.ec2.internal]

@justinsb
Copy link
Member

Merging - we can address those issues post merge!

@justinsb justinsb merged commit 8255dbf into kubernetes:master Oct 20, 2016
@justinsb
Copy link
Member

@chrislovecnm do we have issues to track the the 5 snags above?

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

Successfully merging this pull request may close these issues.

8 participants