diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0001-kubelet-report-NodeReady-last-in-status-list.patch b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0001-kubelet-report-NodeReady-last-in-status-list.patch index ffcab06d47..8537e06727 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0001-kubelet-report-NodeReady-last-in-status-list.patch +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0001-kubelet-report-NodeReady-last-in-status-list.patch @@ -1,7 +1,7 @@ -From 0180f019c7575a5cfe8344ecab14e9c3da883ac7 Mon Sep 17 00:00:00 2001 +From 6195a477686ce589f0568d9f0e6e44e7a9e146e3 Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Tue, 17 Nov 2015 13:05:53 -0800 -Subject: [PATCH 1/3] kubelet: report NodeReady last in status list +Subject: [PATCH 1/4] kubelet: report NodeReady last in status list Addresses a version skew issue where the last condition status is always evaluated as the NodeReady status. As a workaround force the NodeReady diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0002-explicitly-check-Ready-condition-in-validate-cluster.patch b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0002-explicitly-check-Ready-condition-in-validate-cluster.patch index 01ee7542aa..6f73ebcd62 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0002-explicitly-check-Ready-condition-in-validate-cluster.patch +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0002-explicitly-check-Ready-condition-in-validate-cluster.patch @@ -1,7 +1,7 @@ -From 1fdd876287ed3454df939d15602d6f8037ff3156 Mon Sep 17 00:00:00 2001 +From 48d7f5314be4903c6ffc2fb4be542d61b7241b8b Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Thu, 19 Nov 2015 19:06:39 -0800 -Subject: [PATCH 2/3] explicitly check "Ready" condition in validate-cluster +Subject: [PATCH 2/4] explicitly check "Ready" condition in validate-cluster --- cluster/validate-cluster.sh | 2 +- diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0003-kubelet-check-node-condition-by-type-rather-than-by-.patch b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0003-kubelet-check-node-condition-by-type-rather-than-by-.patch index 9adc2718d7..8601b7892d 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0003-kubelet-check-node-condition-by-type-rather-than-by-.patch +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0003-kubelet-check-node-condition-by-type-rather-than-by-.patch @@ -1,7 +1,7 @@ -From 26728c3a424fcd6ac3a3c23963bab3beac388ae6 Mon Sep 17 00:00:00 2001 +From 2b2afd9fe6501150e2da0341fc8725260a42c74f Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Mon, 30 Nov 2015 19:02:12 -0800 -Subject: [PATCH 3/3] kubelet: check node condition by type rather than by +Subject: [PATCH 3/4] kubelet: check node condition by type rather than by index --- diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0004-pkg-kubelet-force-NodeReady-condition-to-be-last-on-.patch b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0004-pkg-kubelet-force-NodeReady-condition-to-be-last-on-.patch new file mode 100644 index 0000000000..256e5ae62a --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/files/0004-pkg-kubelet-force-NodeReady-condition-to-be-last-on-.patch @@ -0,0 +1,75 @@ +From aaa856a8d73fc36f9b458498fdbde8445f99dd7b Mon Sep 17 00:00:00 2001 +From: Aaron Levy +Date: Tue, 8 Dec 2015 14:36:49 -0800 +Subject: [PATCH 4/4] pkg/kubelet: force NodeReady condition to be last on + existing nodes + +--- + pkg/kubelet/kubelet.go | 14 +++++++++++--- + pkg/kubelet/kubelet_test.go | 12 ++++++------ + 2 files changed, 17 insertions(+), 9 deletions(-) + +diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go +index df83ce4..6928563 100644 +--- a/pkg/kubelet/kubelet.go ++++ b/pkg/kubelet/kubelet.go +@@ -2495,9 +2495,6 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error { + node.Status.Conditions = append(node.Status.Conditions, *nodeOODCondition) + } + +- // NOTE(aaronlevy): NodeReady condition needs to be the last in the list of node conditions. +- // This is due to an issue with version skewed kubelet and master components. +- // ref: https://github.com/kubernetes/kubernetes/issues/16961 + var newNodeReadyCondition api.NodeCondition + var oldNodeReadyConditionStatus api.ConditionStatus + if containerRuntimeUp && networkConfigured && containerRuntimeVersionRequirementMet { +@@ -2562,6 +2559,17 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error { + } + oldNodeUnschedulable = node.Spec.Unschedulable + } ++ ++ // NOTE(aaronlevy): NodeReady condition needs to be the last in the list of node conditions. ++ // This is due to an issue with version skewed kubelet and master components. ++ // ref: https://github.com/kubernetes/kubernetes/issues/16961 ++ lastIndex := len(node.Status.Conditions) - 1 ++ for i := range node.Status.Conditions { ++ if node.Status.Conditions[i].Type == api.NodeReady && i < lastIndex { ++ node.Status.Conditions[i], node.Status.Conditions[lastIndex] = node.Status.Conditions[lastIndex], node.Status.Conditions[i] ++ break ++ } ++ } + return nil + } + +diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go +index 7777814..30081a7 100644 +--- a/pkg/kubelet/kubelet_test.go ++++ b/pkg/kubelet/kubelet_test.go +@@ -2789,18 +2789,18 @@ func TestUpdateExistingNodeStatus(t *testing.T) { + Status: api.NodeStatus{ + Conditions: []api.NodeCondition{ + { +- Type: api.NodeOutOfDisk, ++ Type: api.NodeReady, + Status: api.ConditionTrue, +- Reason: "KubeletOutOfDisk", +- Message: "out of disk space", ++ Reason: "KubeletReady", ++ Message: fmt.Sprintf("kubelet is posting ready status"), + LastHeartbeatTime: unversioned.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC), + LastTransitionTime: unversioned.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC), + }, + { +- Type: api.NodeReady, ++ Type: api.NodeOutOfDisk, + Status: api.ConditionTrue, +- Reason: "KubeletReady", +- Message: fmt.Sprintf("kubelet is posting ready status"), ++ Reason: "KubeletOutOfDisk", ++ Message: "out of disk space", + LastHeartbeatTime: unversioned.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC), + LastTransitionTime: unversioned.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC), + }, +-- +2.3.8 (Apple Git-58) + diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/kubelet-1.1.2.ebuild b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/kubelet-1.1.2-r1.ebuild similarity index 93% rename from sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/kubelet-1.1.2.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/kubelet-1.1.2-r1.ebuild index 5ffbe6470a..b5e15b4f45 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/kubelet-1.1.2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/kubelet/kubelet-1.1.2-r1.ebuild @@ -25,6 +25,7 @@ src_prepare() { epatch "${FILESDIR}/0001-kubelet-report-NodeReady-last-in-status-list.patch" epatch "${FILESDIR}/0002-explicitly-check-Ready-condition-in-validate-cluster.patch" epatch "${FILESDIR}/0003-kubelet-check-node-condition-by-type-rather-than-by-.patch" + epatch "${FILESDIR}/0004-pkg-kubelet-force-NodeReady-condition-to-be-last-on-.patch" if gcc-specs-pie; then append-ldflags -nopie