Commit Graph

63 Commits

Author SHA1 Message Date
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Zach Shepherd
2b554079af
Ensure a provider ID is set on a node if expected
A transient issue might occur that causes an error to be returned by
InstanceID(). When this is ignored, the external cloud provider taint
will be removed and neither AddCloudNode() nor UpdateCloudNode() will
try to set a provider ID in the future.

By returning the error we can ensure that the external cloud provider
taint is not removed prematurely, allowing the operation to be retried
(until the provider ID can be set).

Preserve support for external cloud providers that do not use IDs by
continuing if a NotImplemented error is returned, making a distinction
between lack of support for provider IDs and an actual error.

Introduce pair of unit tests that show a provider ID will eventually
be set if an error is returned, unless that error is a NotImplemented,
in which case the external cloud provider taint will be removed.
2020-01-10 11:00:54 -08:00
Alvaro Aleman
18fa7bdb6e Cloud node controller: Only call once into cloud provider 2019-12-17 20:03:27 +01:00
Andrew Sy Kim
55e40b8dc1 cloud node controller: apply stable instance-type label with backfill to existing nodes
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-08 10:50:52 -05:00
Andrew Sy Kim
3032c81187 node controller: set both deprecated Beta and GA labels for Zone/Region topology
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-07 20:08:11 -05:00
Andrew Sy Kim
897b8d7476 improve error handling in cloud node controller
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-10-28 20:23:12 -04:00
walter
6991069e31 Push context up to cloud node controller.
This adds context to the cloud node controller. It continues the propogation started in 59287.  Fixes 815.
Fixed test code calls.
2019-10-20 11:20:49 -07:00
Yassine TIJANI
356e3d0d61 remove Get/Set node condition dependency for the ccm controllers
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-10-04 16:52:36 +02:00
Ted Yu
68d8a5ae15 Break out of loop when NodeHostName is found 2019-09-18 16:57:39 -07:00
mengyang02
b4638519a9 init check for cloud node controller 2019-09-07 10:47:11 +08:00
Kubernetes Prow Robot
ec88ec272c
Merge pull request #75405 from tghartland/node-init-fix
Recheck for cloud taint before initializing nodes in cloud controller
2019-05-14 11:21:19 -07:00
Thomas Hartland
081ec69386 Abort node initialization if cloud taint was already removed
If node events are received at a faster rate than they
can be processed then initialization for some nodes will
be delayed. Once they are eventually processed their cloud taint
is removed, but there may already be several update events
for those nodes with the cloud taint still on them already
in the event queue. To avoid re-initializing those nodes,
the cloud taint is checked for again after requesting
the current state of the node. If the cloud taint is no
longer on the node then nil is returned from the
RetryOnConflict, as an error does not need to be logged.

The logging for a successful initialization is also
moved inside the RetryOnConflict so that the early nil
return does not cause the aborted initialization to be
logged as a success.
2019-05-10 09:26:16 +02:00
Kubernetes Prow Robot
3ed23a9594
Merge pull request #73350 from hello2mao/remove-unused-const-in-node-controller
Remove unused const
2019-05-09 11:26:51 -07:00
Ted Yu
4031900c0c fix variable name 2019-02-13 19:46:18 -08:00
Ted Yu
a346460c08 Reduce unnecessary Map in node_controller#nodeAddressesChangeDetected 2019-02-13 16:16:15 -08:00
Davanum Srinivas
b975573385
move pkg/kubelet/apis/well_known_labels.go to staging/src/k8s.io/api/core/v1/
Co-Authored-By: Weibin Lin <linweibin1@huawei.com>

Change-Id: I163b2f2833e6b8767f72e2c815dcacd0f4e504ea
2019-02-05 13:39:07 -05:00
maohongbin01
cbfe654a30 remove unused const in node-controller.go 2019-01-26 23:05:47 +08:00
Joshua Horwitz
9b3ab29cc9 Only attempt to register cloud nodes on update with the cloud taint 2019-01-25 14:48:29 -05:00
andrewsykim
5329f09663 consolidate node deletion logic between node lifecycle and cloud node controller 2018-12-03 13:33:53 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
tanshanshan
b7c7966b9f Move pkg/scheduler/algorithm/well_known_labels.go out 2018-10-13 09:10:00 +08:00
Walter Fender
f3f46d5f5a Moving the cloudprovider interface to staging.
Individual implementations are not yet being moved.
Fixed all dependencies which call the interface.
Fixed golint exceptions to reflect the move.
Added project info as per @dims and
https://github.com/kubernetes/kubernetes-template-project.
Added dims to the security contacts.
Fixed minor issues.
Added missing template files.
Copied ControllerClientBuilder interface to cp.
This allows us to break the only dependency on K8s/K8s.
Added TODO to ControllerClientBuilder.
Fixed GoDeps.
Factored in feedback from JustinSB.
2018-10-04 14:41:20 -07:00
Kubernetes Submit Queue
5623efebea
Merge pull request #65052 from dbdd4us/master
Automatic merge from submit-queue (batch tested with PRs 65052, 65594). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix update node condition

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

Fixes #65051

/area cloudprovider
/sig cluster-lifecycle

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-11 22:25:03 -07:00
morrislaw
45ab6d7a55 Improved logging message for checking if node is shutdown. 2018-07-03 09:34:42 -04:00
dbdd4us
5835d9bde4 fix update node condition 2018-06-13 19:58:41 +08:00
Kubernetes Submit Queue
0757e05e78
Merge pull request #64368 from justinsb/ccm_instanceid_fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ccm: recognize InstanceNotFound from InstanceID

Otherwise we won't actually delete Nodes in this code path.

```release-note
NONE
```
2018-06-02 04:48:38 -07:00
andrewsykim
4510fe48c3 cloud node controller: improve error handling for node registration 2018-05-31 16:23:41 -04:00
Justin Santa Barbara
ec12fe1e84 ccm: recognize InstanceNotFound from InstanceID
Otherwise we won't actually delete Nodes in this code path.
2018-05-26 22:29:36 -07:00
xuzhonghu
7e894b33ee pass stop channel to node-controller 2018-05-15 17:08:35 +08:00
Kubernetes Submit Queue
6017f6daef
Merge pull request #63170 from micahhausler/node-ip-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Report node DNS info with --node-ip

**What this PR does / why we need it**:
This PR adds `ExternalDNS`, `InternalDNS`, and `ExternalIP` info for kubelets with the `--nodeip` flag enabled. 

**Which issue(s) this PR fixes** 
Fixes #63158

**Special notes for your reviewer**:

I added a field to the Kubelet to make IP validation more testable (`validateNodeIP` relies on the `net` package and the IP address of the host that is executing the test.) I also converted the test to use a table so new cases could be added more easily.

**Release Notes**
```release-note
Report node DNS info with --node-ip flag
```

@andrewsykim
@nckturner 

/sig node
/sig network
2018-05-11 15:46:35 -07:00
Dong Liu
f0046a7194 Rename func to ensureNodeExistsByProviderID 2018-04-28 13:43:29 +08:00
Micah Hausler
1a218aaee2 Report node DNS info with --node-ip
```release-note
Report node DNS info with --node-ip flag
```
2018-04-27 13:18:40 -07:00
Dong Liu
050b583b96 Fix ensure by provider id 2018-04-27 14:19:52 +08:00
Jesse Haka
de967b717d PR #59323, fix bug and remove one api call, add node util dependency to cloud controller 2018-04-22 20:32:26 +03:00
Mike Danese
f427531179 boring 2018-04-18 09:55:57 -07:00
Anup Navare
1335e6e2d4 Cleanup the use of ExternalID as it is deprecated
The patch removes ExternalID usage from node_controller
and node_lifecycle_oontroller. The code instead uses InstanceID
which returns the cloud provider ID as well.
2018-04-02 10:15:32 -07:00
Mikhail Mazurskiy
468655b76a
Use typed events client directly 2018-04-01 18:57:29 +10:00
Aleksandra Malinowska
2d54ba3e0f
Revert "add node shutdown taint" 2018-02-16 12:24:27 +01:00
Kubernetes Submit Queue
281cb00776
Merge pull request #59939 from dims/avoid-calls-to-cloud-instances-unless-taint-present
Automatic merge from submit-queue (batch tested with PRs 59939, 59830). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Avoid call to get cloud instances

**What this PR does / why we need it**:

if a node does not have the taint, we really don't need to make calls
to get the list of instances from the cloud provider

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
Found when reviewing code for #59887

**Release note**:

```release-note
NONE
```
2018-02-15 16:43:34 -08:00
Kubernetes Submit Queue
01517e530f
Merge pull request #59887 from dims/process-cloud-nodes-in-ccm-before-creating-shared-informer-handler
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Process existing cloud nodes in CCM

**What this PR does / why we need it**:

This is a timing issue. If kubelet(s) get started before the CCM is
started, the shared informer event handler does not process them at
all. So we should loop through these before. We run this in a
go wait.Until loop to tolerate errors when listing the nodes and
giving an opportunity for any scripts that may need to setup RBAC
roles etc.


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #58613

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-15 12:17:26 -08:00
Davanum Srinivas
84d171fe86 Avoid call to get cloud instances
if a node does not have the taint, we really don't need to make calls
to get the list of instances from the cloud provider
2018-02-15 14:50:25 -05:00
Davanum Srinivas
c423be11d5 Process existing cloud nodes in CCM
Existing nodes are sent via update and not via the add function,
so let's add an UpdateCloudNode and just forward it to the
AddCloudNode. This works fine as all we do is look for the cloud
taint and bail out if it is not present.
2018-02-15 06:29:48 -05:00
Jesse Haka
3cf5b172fa add node shutdown taint
shutdowned -> stopped

use shutdown everywhere

use patch in taints api call

use notimplemented in clouds use AddOrUpdateTaintOnNode

correct log text

add fake cloud

try to fix bazel

add shutdown tests

add context
2018-02-08 12:56:06 +02:00
Walter Fender
e18e8ec3c0 Add context to all relevant cloud APIs
This adds context to all the relevant cloud provider interface signatures.
Callers of those APIs are currently satisfied using context.TODO().
There will be follow on PRs to push the context through the stack.
For an idea of the full scope of this change please look at PR #58532.
2018-02-06 12:49:17 -08:00
Jonathan Basseri
30b89d830b Move scheduler code out of plugin directory.
This moves plugin/pkg/scheduler to pkg/scheduler and
plugin/cmd/kube-scheduler to cmd/kube-scheduler.

Bulk of the work was done with gomvpkg, except for kube-scheduler main
package.
2018-01-05 15:05:01 -08:00
Kubernetes Submit Queue
27d2ffb32f
Merge pull request #49856 from dixudx/polish_UpdateNodeStatus
Automatic merge from submit-queue (batch tested with PRs 49856, 56257, 57027, 57695, 57432). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Change to pkg/util/node.UpdateNodeStatus

**What this PR does / why we need it**:

> // TODO: Change to pkg/util/node.UpdateNodeStatus.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
/cc @brendandburns @dchen1107 @lavalamp 

**Release note**:

```release-note
None
```
2018-01-02 13:15:42 -08:00
Kubernetes Submit Queue
e9f7970caa
Merge pull request #51124 from huzhengchuan/clm-node-updateaddress
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Node which is not present not need update NodeAddress

**What this PR does / why we need it**:
when the node is not exist according to cloud provider. there is no need to update node address better. 
finally the node will be delete  in https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/cloud/node_controller.go#L240


**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-11-08 12:18:44 -08:00
Di Xu
13a355c837 refactor method to pkg/util/node 2017-11-06 09:51:09 +08:00
zhengchuan hu
8ef7265802 Nods which is not present not need updateAddress 2017-11-03 16:00:10 +08:00
andrewsykim
2def443440 log when node is initialized in cloud controller manager 2017-10-06 00:59:11 -04:00