Commit Graph

2574 Commits (ce2dfac29619818bd06afbf2893a84aa501fba0b)

Author SHA1 Message Date
Abrar Shivani 1fb9ababbd Add update credentials function in vclib 2018-05-17 12:06:01 -07:00
Kubernetes Submit Queue a481f4bbe8
Merge pull request #63824 from dougm/vsphere-token-auth
Automatic merge from submit-queue (batch tested with PRs 63886, 63857, 63824). 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>.

vSphere Cloud Provider: add SAML token authentication support

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

The vSphere cloud provider currently supports username+password based authentication, this PR adds an option to use token based authentication.

**Which issue(s) this PR fixes**:

Fixes #63209

**Special notes for your reviewer**:

For now the config structs and validation are left as-is and
the LoginByToken method is used if the username value is PEM encoded.
In this case of username field configured with the public key, the password
field is expected to be configured with the private key.

In a follow-up PR we can look at collapsing the auth related fields into
a common struct to avoid duplication of field merging and validation.
And then add separate fields for the public and private keys.

**Release note**:

```release-note
vSphere Cloud Provider: add SAML token authentication support
```
2018-05-17 02:08:58 -07:00
Jordan Liggitt 6ab76041b7
Revert "Openstack: register metadata.hostname as node name"
This reverts commit eaac0f5489.
2018-05-15 22:49:21 -04:00
Jordan Liggitt 2f48ad3ff5
Revert "Split out the hostname when default dhcp_domain is used in nova.conf"
This reverts commit 9a8c6db448.
2018-05-15 22:47:02 -04:00
Jordan Liggitt ccc3eb2c31
Revert "Specify DHCP domain for hostname"
This reverts commit da5ccf7fb7.
2018-05-15 22:46:53 -04:00
Doug MacEachern 0791fca5ee update bazel 2018-05-15 10:08:38 -07:00
Doug MacEachern 83768d286c vSphere Cloud Provider: add SAML token authentication support
For now the config structs and validation are left as-is and
the LoginByToken method is used if the username value is PEM encoded.
In this case of username field configured with the public key, the password
field is expected to be configured with the private key.

In a follow-up PR we can look at collapsing the auth related fields into
a common struct to avoid duplication of field merging and validation.
And then add separate fields for the public and private keys.

Fixes #63209
2018-05-15 10:06:56 -07:00
Kubernetes Submit Queue f7ccaae269
Merge pull request #63686 from dougm/deprecate-photon
Automatic merge from submit-queue (batch tested with PRs 63686, 63736). 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>.

Deprecate photon cloud provider

vmware/photon-controller is no longer maintained, as of Oct 2017.

Adds a detail field to deprecatedCloudProviders, meant for pointing to external provider url or other reason for deprecation.



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

The photon cloud provider is no longer supported, need to let users know.

Photon controller support has already been removed from kube-up in PR #58096

**Release note**:

```release-note
NONE
```
2018-05-11 19:09:15 -07:00
Doug MacEachern f8ac0c4d41 Deprecate photon cloud provider
vmware/photon-controller is no longer maintained, as of Oct 2017.

Adds a detail field to deprecatedCloudProviders, meant for pointing to external provider url or other reason for deprecation.
2018-05-11 13:18:05 -07:00
Davanum Srinivas 2080de6adc log error for os.NewComputeV2
Since we are returning false, we are kind of losing the error message,
so we should at least log it.
2018-05-11 13:39:18 -04:00
Kubernetes Submit Queue 7eb88f11d2
Merge pull request #59727 from wgliang/master.time
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>.

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:
should use time.Since instead of time.Now().Sub

**Special notes for your reviewer**:
2018-05-10 20:29:40 -07:00
Nick Sardo 81a5fa431c Add Patch method to GA Backend Services 2018-05-10 12:45:21 -07:00
Kubernetes Submit Queue d09cd75ea6
Merge pull request #58874 from sorenmat/sg_tag_verbose
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>.

Include more information when multiple security groups are tagged

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

When trying to create ELB we can sometime fail if there is more then one AWS
security group tagged. It very useful to get the list of security groups printed in
the error message.

**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**:

**Release note**:
```release-note
  Include the list of security groups when failing with the errors that more then one is tagged
```
2018-05-09 05:48:42 -07:00
Kubernetes Submit Queue ce2bb3d77f
Merge pull request #63541 from feiskyer/vmss-ip
Automatic merge from submit-queue (batch tested with PRs 63563, 63541). 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>.

Do not check vmSetName when getting Azure node's IP

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

Do not check vmSetName when getting Azure node's IP.

**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 #63538

**Special notes for your reviewer**:

**Release note**:

```release-note
Do not check vmSetName when getting Azure node's IP
```
2018-05-08 23:48:16 -07:00
haz-mat 98b21faae7 scope AWS LoadBalancer security group to spec.loadBalancerSourceRanges 2018-05-08 22:48:58 -07:00
Pengfei Ni d32e73aba9 Fix unit tests for new interfaces 2018-05-09 12:47:56 +08:00
Pengfei Ni f427d279fe Do not check vmSetName when getting node IP 2018-05-09 12:47:52 +08:00
Kubernetes Submit Queue a46ced041d
Merge pull request #63464 from dougm/vsphere-auth
Automatic merge from submit-queue (batch tested with PRs 63364, 63464). 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>.

vsphere: use vim25.Client directly to support token authentication

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

This refactor is in support of SAML token authentication: #63209
Avoid use of govmomi.Client as it only supports username+password authentication via SessionManager.Login().
Using vim25.Client directly will allow VCP to add other authentication methods,
such as SessionManager.LoginByToken().

**Release note**:

```release-note
NONE
```
2018-05-08 18:36:14 -07:00
Kubernetes Submit Queue b00d600b48
Merge pull request #63526 from djsly/fix-vmss-parsing
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>.

adding support for VM name with extra Separator String

**What this PR does / why we need it**:
Allows the Azure VM name to have within their name the `_` character

**Special notes for your reviewer**:
This is the error I got before testing
```
May 07 21:55:14 kn-infra000000.<domainname> kubelet[39465]: I0507 21:55:14.462125   39465 azure_vmss.go:108] getVmssVM gets scaleSetName ("kn-infra_ss") and instanceID ("0") for node "kn-infra000000"
May 07 21:55:14 kn-infra000000.<domainname> kubelet[39465]: E0507 21:55:14.462147   39465 azure_vmss_cache.go:52] Failed to extract vmssVMName "kn-infra_ss_0"
May 07 21:55:14 kn-infra000000.<domainname> kubelet[39465]: F0507 21:55:14.462160   39465 kubelet.go:1349] Kubelet failed to get node info: failed to get external ID from cloud provider: not a vmss instance
```

**Release note**:
```release-note
Azure VMSS: support VM names to contain the `_` character
```
2018-05-08 15:01:30 -07:00
sylvain.boily a8de002952 adding support for VM name with extra Separator String 2018-05-08 06:36:04 -04:00
Davanum Srinivas e30fe2ba4b Deprecate in-tree OpenStack cloud provider
Warn operators and users to switch to the external cloud provider
for openstack.
2018-05-07 21:53:15 -04:00
Doug MacEachern cc1552c072 vsphere: update bazel 2018-05-07 08:50:31 -07:00
Doug MacEachern e22f9ca4ae vsphere: fallback to vcsim for testing authentication
The TestVSphereLogin method still defaults to testing against a real vCenter,
but if the required environment variables are not set, it can test against vcsim.

More tests can be converted to use configFromEnvOrSim(), but can be in follow up PRs.
2018-05-07 08:50:31 -07:00
Doug MacEachern e7f74d83c6 Rename VSphereConnection.GoVmomiClient -> Client 2018-05-07 08:50:31 -07:00
Doug MacEachern 64601373f1 vsphere: use vim25.Client directly to support token authentication
This refactor is in support of SAML token authentication: #63209
Avoid use of govmomi.Client as it only supports username+password authentication via SessionManager.Login().
Using vim25.Client directly will allow VCP to add other authentication methods,
such as SessionManager.LoginByToken().
2018-05-07 08:50:31 -07:00
Kubernetes Submit Queue b976ebd56a
Merge pull request #63425 from feiskyer/azclient
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>.

Clean up Azure clients

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

Follow up of #63278 (Use new Azure SDK APIs for load balancer and public IP operations), clean up all other clients.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-07 01:08:45 -07:00
Pengfei Ni 05d0d35d32 fix fake clients and unit tests 2018-05-04 14:09:48 +08:00
Pengfei Ni 12c9d2736a use new azure clients 2018-05-04 14:09:33 +08:00
Pengfei Ni 7d9b134246 cleanup unnecessary channels in azure clients 2018-05-04 14:09:07 +08:00
Nick Sardo f9d1f7eb75 Pass certificate URLs instead of the certificate structs 2018-05-03 13:14:55 -07:00
Kubernetes Submit Queue 4299a0518c
Merge pull request #63261 from dougm/cloudprovider-notimplemented
Automatic merge from submit-queue (batch tested with PRs 61725, 63261). 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>.

Use cloudprovider.NotImplemented in AddSSHKeyToAllInstances

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

Minor cleanup: In looking at implementations of this method,
noticed a few providers created their own errors instead of using cloudprovider.NotImplemented

**Release note**:

```release-note
NONE
```
2018-05-02 22:16:06 -07:00
Kubernetes Submit Queue 4018211800
Merge pull request #63278 from feiskyer/azure-lb-new-interface
Automatic merge from submit-queue (batch tested with PRs 62657, 63278, 62903, 63375). 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>.

Use new Azure SDK APIs for load balancer and public IP operations

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

#63063 updated Azure SDK to a stable version. After that, we should also update existing clients to use new SDK APIs.

Without this, public IP listing will be blocked forever in some case.

**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**:

A following PR will be sent for other interfaces, e.g. routes and NSGs.

**Release note**:

```release-note
NONE
```
2018-05-02 20:13:07 -07:00
Kubernetes Submit Queue c968d99ee5
Merge pull request #62516 from nicksardo/expand-id
Automatic merge from submit-queue (batch tested with PRs 62060, 62516). 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>.

[GCE] Add new formats to resource parser and self link creator

**What this PR does / why we need it**:
- Expands the set of parse-able strings for resource IDs, while also simplifying the code. Note that these are acceptable values for some fields in GCP API.
  - global/networks/my-network
  - regions/us-central1/subnetworks/my-sub
  - zones/us-central1-a/instances/my-hacker-instance
- Fixes the SelfLink function to return links for regions and zones:
  - https://www.googleapis.com/compute/v1/projects/proj4/regions/us-central1
- Generates helper functions to create a ResourceID for each resource
- Generates a unit test that ensures all links can be generated and all generated links can be parsed.
- Fixes an ILB test which creates a malformed URL.

**Special notes for your reviewer**:
/assign rramkumar1

**Release note**:
```release-note
NONE
```
2018-05-02 18:12:06 -07:00
Kubernetes Submit Queue 0d43bdec2b
Merge pull request #63294 from bertinatto/throttle_aws
Automatic merge from submit-queue (batch tested with PRs 63349, 63294). 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>.

Add metric for throttled requests in AWS

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

This PR adds a metric for request throttling in AWS.

**Special notes for your reviewer**:

* Added metric.
* Moved metrics-related code to `aws_metrics.go`.
* Capitalized acronyms, e.g., `recordAwsMetric` to `recordAWSMetric`.

**Release note**:

```release-note
NONE
```
2018-05-02 11:43:10 -07:00
Fabio Bertinatto 5abe207eef Add metric for throttled requests in AWS 2018-05-02 12:35:37 +02:00
Kubernetes Submit Queue 145f0aa5ed
Merge pull request #63091 from gonzolino/lb-member-name
Automatic merge from submit-queue (batch tested with PRs 63138, 63091, 63201, 63341). 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>.

Set names for OpenStack loadbalancer members and monitors

**What this PR does / why we need it**:
This PR sets names for OpenStack loadbalancer members and monitors.
ATM names for members and monitors are empty, making it difficult to identify where they belong.

Healthmonitors will be named `monitor_<lb_name>_<index>` and members
will be named `member_<lb_name>_<index>_<node_name>`.
This naming scheme should in sync with the naming of other LB resources, e.g. pools: `pool_<lb_name>_<index>`.

**Release note**:

```release-note
NONE
```
2018-05-01 16:00:12 -07:00
Nick Sardo 8098b91951 Expand ability of ResourceID 2018-05-01 12:21:44 -07:00
Cheng Xing b4009c5444 GCE PD plugin now prevents attaching a regional PD PV with pdName of a regular PD 2018-04-30 13:31:54 -07:00
Kubernetes Submit Queue 7ffd171c29
Merge pull request #62729 from databus23/fix-os-route-deletion
Automatic merge from submit-queue (batch tested with PRs 59879, 62729). 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>.

Openstack: fix orphaned route deletion

This is a follow-up to #56258 which only got half of the work done.
The OpenStack cloud providers DeleteRoute method fails to delete routes when it can’t find the corresponding instance in OpenStack.

```release-note
OpenStack cloudprovider: Fix deletion of orphaned routes
```
2018-04-30 06:58:06 -07:00
Fabio Bertinatto 81bf821d69 Capitalize acronyms in AWS metrics-related code 2018-04-30 15:50:18 +02:00
Pengfei Ni 19e45e35bd Fix fake clients and unit tests 2018-04-28 16:45:19 +08:00
Pengfei Ni 435df2b007 Use new Azure SDK APIs for load balancer and public IP operations 2018-04-28 16:45:05 +08:00
Pengfei Ni fd559ee165 Fix panic for attaching AzureDisk to vmss nodes 2018-04-28 15:48:39 +08:00
Doug MacEachern e7cc5df3f6 Use cloudprovider.NotImplemented in AddSSHKeyToAllInstances
Minor cleanup: In looking at implementations of this method,
noticed a few providers created their own errors instead of using cloudprovider.NotImplemented
2018-04-27 13:19:06 -07:00
Pengfei Ni f753c916cd Simplify vmset acquirement logic 2018-04-27 11:05:45 +08:00
Pengfei Ni a54cb15d7b Improve Azure disk operations for vmas and vmss 2018-04-26 14:23:09 +08:00
Pengfei Ni 079f9b85f8 Use new clients in azure cloud provider 2018-04-26 09:38:48 +08:00
Pengfei Ni 8a0cae8647 Upgrade virtualmachin/disk/storageaccount client to use new SDK 2018-04-26 09:38:48 +08:00
Kubernetes Submit Queue 02e3577ab1
Merge pull request #60009 from zetaab/nodetaint
Automatic merge from submit-queue (batch tested with PRs 63129, 63066, 60009, 63136, 63086). 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>.

add node shutdown taint

**What this PR does / why we need it**: we need node stopped taint in order to detach volumes immediately without waiting timeout. More info in issue ticket #58635 

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

**Special notes for your reviewer**: this was reverted, original PR https://github.com/kubernetes/kubernetes/pull/59323 Hopefully now bugs are fixed. However, I will execute more tests manually today.

**Release note**:
```release-note
NONE
```
2018-04-25 06:29:22 -07:00
Daniel Gonzalez e2ebc5f195 Set names for OpenStack loadbalancer members and monitors
Healthmonitors will be named 'monitor_<lb_name>_<index>' and members
will be named 'member_<lb_name>_<index>_<node_name>'.
2018-04-24 18:27:01 +02:00
Kubernetes Submit Queue 5752d1faaa
Merge pull request #62919 from vmware/backward_comp
Automatic merge from submit-queue (batch tested with PRs 63007, 62919, 62669, 62860). 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 vSphere Cloud Provider to handle upgrade from k8s version less than v1.9.4 to v1.9.4+

**What this PR does / why we need it**:
vSphere Cloud Provider in kubernetes master v1.9.4+ is not able to identify the kubernetes nodes of version less than 1.9.4. Hence, volume operations fail in this case. This PR fixes this.

**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 #62435

**Special notes for your reviewer**:
Internally reviewed here: https://github.com/vmware/kubernetes/pull/477

**Release note**:

```release-note
None
```
2018-04-23 15:45:13 -07: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
yankaiz 8aeb77f9c8 Add unit tests for gce loadbalancer internal.
Increase coverage for gce_loadbalancer_internal from 76.7% to 91.0%.
2018-04-20 16:14:02 -07:00
Abrar Shivani c15336e97a Fix upgrade to Kubernetes v1.9.3+ 2018-04-20 15:18:28 -07:00
Kubernetes Submit Queue 2bfe40a1d1
Merge pull request #62707 from feiskyer/vmss-standard-lb
Automatic merge from submit-queue (batch tested with PRs 62857, 62707). 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>.

Add support of standard LB to Azure vmss

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

Add support of standard LB to Azure vmss.

**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 #60485

**Special notes for your reviewer**:

**Release note**:

```release-note
Add support of standard LB to Azure vmss
```

/sig azure
2018-04-19 21:57:08 -07:00
Pengfei Ni c69cea41a0 Check all backends for vmss and standard instances 2018-04-20 10:31:23 +08:00
Nick Sardo be70541986 Fix ILB issue updating load balancers 2018-04-19 15:18:43 -07:00
Pengfei Ni efb7ae6ebc Add support of zero nodes in vmss 2018-04-19 16:53:52 +08:00
Pengfei Ni 87776025af Add standard LB support to Azure vmss 2018-04-19 16:40:26 +08:00
Pengfei Ni f1d7156c88 Move vmset checking back to vmsets 2018-04-19 16:35:08 +08:00
Mike Danese d02cf10123 remove last usage of external ID 2018-04-18 09:54:56 -07:00
Fabian Ruff 65d4147139 ensure we delete orphaned routes with matching next-hops only
There might be a valid route with the same DestinationCIDR pointing to a running node.
2018-04-18 13:19:58 +02:00
Kubernetes Submit Queue 93d89609cb
Merge pull request #62220 from vmware/detach_bug_fix
Automatic merge from submit-queue (batch tested with PRs 62568, 62220, 62743, 62751, 62753). 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>.

[vSphere Cloud Provider] Fix detach disk when VM is not found

**What this PR does / why we need it**:
When VM is deleted from VC inventory and detach request is issued detach returns error since VM cannot be found. In this scenario, detach should return no error if VM is not found. This PR fixes this.

**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 #61707.

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
@kubernetes/vmware
2018-04-17 20:52:12 -07:00
Kubernetes Submit Queue 22492dafa1
Merge pull request #62661 from agau4779/gce-lb-race
Automatic merge from submit-queue (batch tested with PRs 62748, 60536, 62300, 62661, 62731). 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>.

[GCE] Parallelize GCE loadbalancer tests

**What this PR does / why we need it**:
- Encapsulate IP counter in Mocks. Previously, ipCounter was a global int modified by multiple tests.
- Use mock-provided Lock before modifying resources.
- Parallelize loadbalancer tests.

```release-note
NONE
```
2018-04-17 19:53:21 -07:00
Kubernetes Submit Queue 74c6632c97
Merge pull request #62749 from andrewsykim/ccm-approvers
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>.

add @andrewsykim to OWNERS for cmd/cloud-controller-manager,pkg/contr…

**What this PR does / why we need it**:
Add myself as an approver for CCM related code.

cc @wlan0 

**Release note**:
```release-note
Add @andrewsykim as an approver for CCM related code.
```
2018-04-17 15:14:50 -07:00
andrewsykim da06951013 add @andrewsykim to OWNERS for cmd/cloud-controller-manager,pkg/controller/cloud,pkg/cloudprovider 2018-04-17 16:43:58 -04:00
Ashley Gau 6d7424885e encapsulate IP counter in X, parallelize lb tests 2018-04-17 13:34:49 -07:00
Fabian Ruff de15b859ba fix route deletion
This is a follow-up to #56258 which only half of the work done.
The DeleteRoute method failed to delete routes when it can’t find the corresponding node in OpenStack.
2018-04-17 15:34:06 +02:00
Ashley Gau aad92ba816 remove parallel 2018-04-16 09:29:28 -07:00
Pengfei Ni 8a287d2114 Fix machineID getting for vmss nodes when using instance metadata 2018-04-16 13:36:12 +08:00
Ashley Gau 6ff2afefbb update-bazel 2018-04-13 15:47:31 -07:00
Ashley Gau 023a477c63 Add comments, t.Parallel() 2018-04-13 15:47:31 -07:00
Ashley Gau 74092228b2 have fakeLoadbalancerService take lb type as argument 2018-04-13 15:47:31 -07:00
Ashley Gau f105397b88 tests for EnsureLoadBalancer, EnsureLoadBalancerDeleted 2018-04-13 15:47:31 -07:00
Ashley Gau 708a051399 refactor - create new apiService per test. encapsulate resource create/delete checks. 2018-04-13 15:47:31 -07:00
Kubernetes Submit Queue 2196b0a074
Merge pull request #61391 from hanxiaoshuai/fixtodo0320
Automatic merge from submit-queue (batch tested with PRs 60476, 62462, 61391, 62535, 62394). 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>.

Use function aws.Int64Value replace of deprecated function orZero

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

```
// orZero returns the value, or 0 if the pointer is nil
// Deprecated: prefer aws.Int64Value
func orZero(v *int64) int64 {
    return aws.Int64Value(v)
}
```
Use function aws.Int64Value replace of deprecated function orZero and remove unused orZero .

**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**:

**Release note**:

```release-note
NONE
```
2018-04-13 11:20:17 -07:00
Pengfei Ni 0f0e271936 Ensure expected load balancer is selected for Azure
Without this, the last element of LB list is always selected.
2018-04-12 15:57:44 +08:00
Kubernetes Submit Queue 27045d3fcd
Merge pull request #61082 from wenlxie/githubupstream.master.ignorevolumeerrorstatus
Automatic merge from submit-queue (batch tested with PRs 61549, 62230, 62055, 61082, 62212). 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>.

don't do attach and deatch when cinder volume status is error

When cinder volume status is `error`, it is not supposed to handle operation like `attach` and `detach`

@dims  @FengyunPan2

```release-note
cinder volume plugin : 
When the cinder volume status is `error`,  controller will not do `attach ` and `detach ` operation
```
2018-04-10 18:19:16 -07:00
Wang Guoliang 89669283fe should use time.Since instead of time.Now().Sub 2018-04-10 12:05:51 +08:00
Kubernetes Submit Queue 09ec7bf548
Merge pull request #60692 from adnavare/bug/60466
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>.

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.

fixes #60466
2018-04-09 11:58:12 -07:00
FengyunPan2 6f700b1e6e Add subnet-id annotation for openstack cloud provider
Currently user only specify subnet-id in cloud.conf file.
If user want to specify other subnet for some special services,
the subnet-id annotation should be a good choice.
2018-04-04 19:13:48 +08:00
Abrar Shivani 23b6b46cf2 Detach bug fix 2018-04-03 11:56:27 -07:00
Bowei Du 635ee5ad55 Add support for multiple certificates to targetproxy 2018-04-02 23:34:08 -07:00
Brendan Burns 966b9e1db0 Update tests. 2018-04-02 10:34:30 -07:00
Brendan Burns d263c255bf Update code for new SDK. 2018-04-02 10:34:30 -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
Kubernetes Submit Queue 3538676841
Merge pull request #61786 from grayluck/ensureelb-test
Automatic merge from submit-queue (batch tested with PRs 61871, 61890, 61786). 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>.

Add unit testcases for ensureExternalLoadBalancer to make sure it doesn't panic when errors raised.

**What this PR does / why we need it**:
Add unit testcases for ensureExternalLoadBalancer to make sure it doesn't panic when errors raised. Increase code coverage from 76.5% to 81.5%.

<!--
**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**:
-->

**Release note**: 

```release-note
NONE
```

\assign @MrHohn
2018-03-30 14:32:02 -07:00
Kubernetes Submit Queue 7a1e44456f
Merge pull request #61890 from dims/better-specify-dhcp-domain-for-hostname
Automatic merge from submit-queue (batch tested with PRs 61871, 61890, 61786). 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>.

Specify DHCP domain for hostname

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

In 9a8c6db448, we looked at the hostname
in the metadata service and used '.' as the delimiter to chop off the
dhcp_domain (specified in nova.conf). However administrators need to
better control the dhcp domain better as there may be a '.' in the host
name itself. So let's introduce a config option that we can use and
default it to what nova uses when dhcp_domain is not specified which is
"novalocal"


**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**:

**Release note**:

```release-note
new dhcp-domain parameter to be used for figuring out the hostname of a node
```
2018-03-30 14:31:59 -07:00
yankaiz 6714d17b61 Add unit testcases for ensureExternalLoadBalancer to make sure it doesn't panic when errors raised. 2018-03-30 11:36:47 -07:00
Pengfei Ni 7ec0315c39 some updates 2018-03-30 16:52:42 +08:00
Pengfei Ni 094dbded65 Add support of Azure standard load balancer and public IP 2018-03-30 16:52:36 +08:00
Davanum Srinivas da5ccf7fb7 Specify DHCP domain for hostname
In 9a8c6db448, we looked at the hostname
in the metadata service and used '.' as the delimiter to chop off the
dhcp_domain (specified in nova.conf). However administrators need to
better control the dhcp domain better as there may be a '.' in the host
name itself. So let's introduce a config option that we can use and
default it to what nova uses when dhcp_domain is not specified which is
"novalocal"
2018-03-29 21:31:02 -04:00
Kubernetes Submit Queue d7ec46c5de
Merge pull request #61000 from dims/split-host-name-when-dhcp-domain-is-present-in-host-name
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>.

Split out the hostname when default dhcp_domain is used in nova.conf

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

When /etc/nova/nova.conf does not have specify dhcp_domain to empty
string, a default string of '.novalocal' is returned by the meta data
service. So we need to just split the string and pick the first one
in the array.

```
$ curl http://169.254.169.254/latest/meta-data/hostname
testvm-1.novalocal
$ curl http://169.254.169.254/latest/meta-data/public-hostname
testvm-1.novalocal
$ curl http://169.254.169.254/latest/meta-data/local-hostname
testvm-1.novalocal
```

**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**:

**Release note**:

```release-note
NONE
```
2018-03-27 20:28:02 -07:00
Kubernetes Submit Queue 2bc231eb57
Merge pull request #61143 from satyasm/ipam-perf-cloud-mock
Automatic merge from submit-queue (batch tested with PRs 61402, 61143, 61427, 60592). 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>.

Performance tests and fix for IPAM controller.

Tests the four modes of allocations. Can be run using
./test-performance.sh under tests/integration/ipamperf
directory. See ./test-performance.sh -h for supported flags.



**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 #

**Special notes for your reviewer**:
Please see the implementation  notes comment block in cloud.go for core details of how 
the mocking works. README.md has details on how the tests can be run on the 
command line.

**Release note**:

```release-note
Performance test framework and basic tests for the IPAM controller, to simulate behavior
of the four supported modes under lightly loaded and loaded conditions, where load is 
defined as the number of operations to perform as against the configured kubernetes
API server QPS.
```
2018-03-27 15:33:09 -07:00
Davanum Srinivas 9a8c6db448 Split out the hostname when default dhcp_domain is used in nova.conf
When /etc/nova/nova.conf does not have specify dhcp_domain to empty
string, a default string of '.novalocal' is returned by the meta data
service. So we need to just split the string and pick the first one
in the array.

```
$ curl http://169.254.169.254/latest/meta-data/hostname
testvm-1.novalocal
$ curl http://169.254.169.254/latest/meta-data/public-hostname
testvm-1.novalocal
$ curl http://169.254.169.254/latest/meta-data/local-hostname
testvm-1.novalocal
```
2018-03-27 12:08:48 -04:00
Kubernetes Submit Queue 2edeb07aac
Merge pull request #61743 from rramkumar1/apply-cloud-provider-patch
Automatic merge from submit-queue (batch tested with PRs 61644, 61624, 61743, 61019, 61287). 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>.

Add support for setting a custom rate limiter in gce cloud provider

**What this PR does / why we need it**:
This PR makes it possible to use a custom rate limiter for the GCE cloud provider layer. This is a copy of the raw vendor patch made in https://github.com/kubernetes/ingress-gce/pull/148.

Fixes: https://github.com/kubernetes/ingress-gce/issues/154

**Special notes for your reviewer**:

**Release note**:
```release-note
None
```

/assign @bowei
2018-03-27 06:41:16 -07:00
Kubernetes Submit Queue bb6f0bf1ce
Merge pull request #61300 from grayluck/gce-lb-test
Automatic merge from submit-queue (batch tested with PRs 60499, 61715, 61688, 61300, 58787). 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>.

Unit tests for external load balancer

**What this PR does / why we need it**:
Unit test for external load balancer. Increase the code coverage of gce_loadbalancer_external.go from 61.6% to 76.5%.

<!--
**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**:
-->

**Release note**:

```release-note
NONE
```
2018-03-27 04:08:12 -07:00
Kubernetes Submit Queue 79e1297f9b
Merge pull request #61531 from feiskyer/delete-node
Automatic merge from submit-queue (batch tested with PRs 61434, 61501, 59609, 61467, 61531). 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>.

Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure

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

Azure ExponentialBackoff will still try to get VM information even when the VM has already been removed on Azure:

1365ce3419/pkg/cloudprovider/providers/azure/azure_backoff.go (L52-L60)

It should report `cloudprovider.InstanceNotFound` early and avoid calling Azure APIs on such case.

**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 #61465

**Special notes for your reviewer**:

Should be cherry-picked to v1.9

**Release note**:

```release-note
Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure
```
2018-03-26 19:52:17 -07:00
Kubernetes Submit Queue 408588a407
Merge pull request #61467 from feiskyer/azure-service-tags
Automatic merge from submit-queue (batch tested with PRs 61434, 61501, 59609, 61467, 61531). 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>.

Add support of specifying service tags for Azure cloud provider

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

This PR adds support of specifying service tags for Azure cloud provider by annotation `service.beta.kubernetes.io/azure-allowed-service-tags`.

Refer https://docs.microsoft.com/en-us/azure/virtual-network/security-overview#service-tags for more information about this feature.

**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 #57914

**Special notes for your reviewer**:

**Release note**:

```release-note
Azure cloud provider now supports specifying allowed service tags by annotation `service.beta.kubernetes.io/azure-allowed-service-tags`
```
2018-03-26 19:52:14 -07:00
Rohit Ramkumar 455fcac51c Add support for setting a custom rate limiter in gce cloud provider 2018-03-26 15:45:34 -07:00
yankaiz af5a7e2488 Unit tests for external load balancer. 2018-03-26 11:01:52 -07:00
Kubernetes Submit Queue df7ee3a543
Merge pull request #61441 from agau4779/remove-alphagate-validation
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>.

[GCE] Remove validation of Alpha Feature Gates

**What this PR does / why we need it**:
As per discussion with @bowei, @freehan, and @nicksardo , remove validation on Alpha Feature Gates so we can be more flexible with adding or removing new features.

**Release note**:
```release-note
NONE
```
2018-03-26 09:31:29 -07:00
Kubernetes Submit Queue 915798d229
Merge pull request #60563 from hzxuzhonghu/replace-context
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>.

Replace package "golang.org/x/net/context" with "context"

**What this PR does / why we need it**:
Replace package "golang.org/x/net/context" with "context"

**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 #60560

**Special notes for your reviewer**:
As of Go 1.7 this package(golang.org/x/net/context) is available in the standard library under the name context. see (https://godoc.org/golang.org/x/net/context)

It is almost machinery replace. 

**Release note**:

```release-note
NONE
```
2018-03-23 16:34:23 -07:00
Ashley Gau ad026f29d3 remove knownAlphaFeatures, only store input features. 2018-03-23 09:20:35 -07:00
Pengfei Ni bace00689b Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure 2018-03-23 09:22:27 +08:00
Satyadeep Musuvathy 77da96c7f6 Performance tests and fix for IPAM controller.
Tests the four modes of allocations. Can be run using
./test-performance.sh under tests/integration/ipamperf
directory. See ./test-performance.sh -h for supported flags.
2018-03-22 13:21:22 -07:00
Ashley Gau d5904e7a4e Remove validation of Alpha Feature Gates 2018-03-22 11:02:42 -07:00
hzxuzhonghu 70e45eccf2 Replace "golang.org/x/net/context" with "context" 2018-03-22 20:57:14 +08:00
Kubernetes Submit Queue d383ca1062
Merge pull request #60980 from n-marton/master
Automatic merge from submit-queue (batch tested with PRs 60980, 61273, 60811, 61021, 61367). 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 for openstack member cleanup for multiple port cases

**What this PR does / why we need it**:
Fixing an openstack lb issue.
**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: #60976

**Special notes for your reviewer**:
The problem with the code was that if multiple ports were exposed then that created multiple members for each listener, and the deletion process iterated over each listener with an array of every member resulting listener - member mismatch, which caused not found exception from lbaasv2.

**Release note**:

```release-note

```
2018-03-22 02:08:12 -07:00
Pengfei Ni b7813b15a1 Add verification of supported service tags 2018-03-22 15:36:08 +08:00
Kubernetes Submit Queue 33d480b599
Merge pull request #61366 from zetaab/fixnotfound
Automatic merge from submit-queue (batch tested with PRs 61354, 61366, 61386, 61394, 60755). 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 waitLoadbalancerDeleted timeout always

**What this PR does / why we need it**: waitLoadbalancerDeleted function goes always to timeout because not working check

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-21 23:44:10 -07:00
Kubernetes Submit Queue a29b047aa7
Merge pull request #61352 from dims/stabilize-openstack-test-when-running-against-real-openstack-cloud
Automatic merge from submit-queue (batch tested with PRs 60373, 61098, 61352, 61359, 61362). 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>.

Stabilize openstack_test when running against real cloud

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

in TestReadConfig, we are setting some env vars for testing if
we read them back properly. However this interferes with running
the unit test harness against a real openstack cloud where we
source the OS_* environment variables. Adding code here to save
and reset variables.

**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**:

**Release note**:

```release-note
NONE
```
2018-03-21 22:39:15 -07:00
Pengfei Ni 7d9d571659 Add support of specifying service tags for Azure cloud provider 2018-03-21 16:51:40 +08:00
Kubernetes Submit Queue 22a040a1b9
Merge pull request #60459 from agau4779/gce-internal-lb-tests
Automatic merge from submit-queue (batch tested with PRs 57871, 61094, 60459, 61089, 61105). 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>.

[GCE] Internal Loadbalancer Tests

**What this PR does / why we need it**:
Adds unit tests for the GCE Internal Loadbalancer. According to the test coverage tool, this PR brings test coverage of `gce_loadbalancer_internal.go` from 0% to 74.0%.

```release-note
NONE
```

/assign nicksardo bowei
2018-03-20 23:34:36 -07:00
Kubernetes Submit Queue e3ac40264f
Merge pull request #61002 from FengyunPan2/fix-isNotFound
Automatic merge from submit-queue (batch tested with PRs 60898, 60912, 60753, 61002, 60796). 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>.

IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode

Related to: #60658 #60976
Refer to:
 https://github.com/gophercloud/gophercloud/pull/103/files#diff-e8ad71423a1527851f282515739eecc2R265

**Release note**:
```release-note
NONE
```
2018-03-20 17:37:17 -07:00
hangaoshuai f78c7d3db0 Use function aws.Int64Value replace of deprecated function orZero 2018-03-20 17:27:20 +08:00
Kubernetes Submit Queue aeec2953d1
Merge pull request #59931 from zetaab/shutdoos
Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). 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>.

do not delete node in openstack, if those still exist in cloudprovider

**What this PR does / why we need it**: Deleting nodes in kubernetes cluster causes problems. It will lead to situations like labels and taints are missing from nodes when node will return online.

**Which issue(s) this PR fixes**:


**Special notes for your reviewer**:

```release-note
Nodes are not deleted from kubernetes anymore if node is shutdown in Openstack.
```
2018-03-20 00:42:12 -07:00
Jesse Haka 70c2baaff8 fix isnotfound
remove changes to isnotfound
2018-03-20 07:08:59 +02:00
Kubernetes Submit Queue 9df57d2812
Merge pull request #60086 from dougm/vsphere-finder
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>.

vSphere: Minimize property collection via Finder

The 'All' parameter of the 'NewFinder' function controls property collection while searching the inventory.
When 'All' is set to 'false', Finder collects the minimal set of object properties required to search inventory.
When 'All' is set to 'true', Finder collects *all* object properties, which are *not* required to search inventory.
Setting 'All' to 'true' is only useful when inspecting all properties of an object,
such as by certain govc commands when the '-json' or '-dump' flags are specified.

Changing All=false in VCP minimizes the SOAP payload size and marshalling required on both sides, without impacting any functionality.



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

Changing All=false in VCP minimizes the SOAP payload size and marshalling required on both sides, without impacting any functionality.

**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**:

**Release note**:

```release-note
NONE
```
2018-03-19 21:34:36 -07:00
Davanum Srinivas 97b4110d9f Stabilize openstack_test when running against real cloud
in TestReadConfig, we are setting some env vars for testing if
we read them back properly. However this interferes with running
the unit test harness against a real openstack cloud where we
source the OS_* environment variables. Adding code here to save
and reset variables.
2018-03-19 10:48:11 -04:00
Ashley Gau e07a944c49 add Get/Set methods, mutex on instanceGroupAttrs. 2018-03-13 13:17:24 -07:00
Ashley Gau 7fff54cfdd move shared test cluster vars into method + type 2018-03-13 13:18:08 -07:00
Ashley Gau ac6ff68e20 test ensureInternalBackendService, ensureInternalBackendServiceGroups 2018-03-13 13:17:55 -07:00
Ashley Gau 26c0a0d11f expect no error when correct resources already exist. DeleteWrongResources -> ClearPreviousResources 2018-03-13 13:17:24 -07:00
Ashley Gau 8855702ed2 test that deleting twice does not throw error 2018-03-13 13:17:24 -07:00
Ashley Gau 42c5bca0c0 rename to _test.go, update-bazel, comments 2018-03-13 13:17:24 -07:00
Ashley Gau 7648696c88 test updateInternalLoadBalancer 2018-03-13 11:13:41 -07:00
Ashley Gau fd2bf37d28 hooks for updating healthchecks, firewalls, regional backendservices 2018-03-13 11:13:41 -07:00
Ashley Gau ebd54ea5e3 test ensureInternalLoadBalancer and ensureInternalLoadBalancerDeleted 2018-03-13 11:13:41 -07:00
Ashley Gau f625b4a2d9 add hooks to add, remove, insert instances from instancegroups 2018-03-13 11:13:41 -07:00
Ashley Gau ad1f206329 isolate logic to be shared with internal lb tests into separate file 2018-03-13 11:13:41 -07:00
wenlxie ecfe25d57d don't do attach and deatch when volume status is error 2018-03-13 13:42:23 +08:00
Kubernetes Submit Queue 17195553cc
Merge pull request #60772 from feiskyer/const-cleanup
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>.

Code cleanup: group consts togather

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

This is a code cleanup, which groups all consts togather.

**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**:

**Release note**:

```release-note
NONE
```
2018-03-12 12:42:34 -07:00
Kubernetes Submit Queue ba535d57f6
Merge pull request #60774 from feiskyer/augmented-nsg
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>.

Update documentation for azure-shared-securityrule

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

Azure augmented rules for NSGs has been GA https://azure.microsoft.com/en-us/updates/agumented-rules-ga-nsg/. This PR updates documentation for "service.beta.kubernetes.io/azure-shared-securityrule" to reflect this.

**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**:

**Release note**:

```release-note
NONE
```
2018-03-12 08:39:10 -07:00
FengyunPan2 0da1660653 IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode
Related to: #60658 #60976
Refer to:
  https://github.com/gophercloud/gophercloud/pull/103
2018-03-10 10:57:37 +08:00
n-marton 744ff16ced fix for openstack member cleanup for multiple port cases 2018-03-09 15:50:15 +01:00
Pengfei Ni 3ae114cf08 Get external IP for azure standard nodes 2018-03-09 11:10:44 +08:00
Pengfei Ni 717fe5d0d6 Check whether it is running locally when UseInstanceMetadata 2018-03-09 11:09:33 +08:00
Cheng Xing 10cc971388 Change regional PD cloud provider references to use the beta API 2018-03-07 13:15:34 -08:00
Kubernetes Submit Queue 3d60b3cd67
Merge pull request #60490 from jsafrane/fix-aws-delete
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>.

Volume deletion should be idempotent

- Describe* calls should return `aws.Error` so caller can handle individual errors. `aws.Error` already has enough context (`"InvalidVolume.NotFound: The volume 'vol-0a06cc096e989c5a2' does not exist"`)
- Deletion of already deleted volume should succeed.


**Release note**:


Fixes: #60778

```release-note
NONE
```

/sig storage
/sig aws

/assign @justinsb @gnufied
2018-03-05 12:42:22 -08:00
Pengfei Ni 4321560619 Add unit tests for parseConfig 2018-03-05 16:04:46 +08:00
Pengfei Ni b697251d9c Enable maximumLoadBalancerRuleCount config for azure yaml config file 2018-03-05 15:41:57 +08:00
Pengfei Ni ff31ff1eaf Fix broken useManagedIdentityExtension for azure cloud provider 2018-03-05 15:37:25 +08:00
Pengfei Ni cca4f97ba7 Update documentation for azure-shared-securityrule
Azure augmented rules for NSGs has been GA since 2018.1
2018-03-05 14:23:47 +08:00
Pengfei Ni dd8a7d359d Code cleanup: group consts togather 2018-03-05 14:13:40 +08:00
Pengfei Ni ce8615dab6 Set default vmtype to standard if not set 2018-03-01 13:48:54 +08:00
Jesse Haka b1d1b4f811 remove filtering by instance state 2018-03-01 00:16:47 +02:00
Kubernetes Submit Queue e30554bd39
Merge pull request #58029 from yguo0905/tpu-api
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>.

GCE: support Cloud TPU API in cloud provider

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

This PR adds the support for Cloud TPU API in GCE 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**:

**Release note**:

```release-note
GCE: support Cloud TPU API in cloud provider
```

/assign @vishh 
/assign @cheftako
2018-02-27 15:58:13 -08:00
Kubernetes Submit Queue b13bfc74e2
Merge pull request #60337 from verult/repd-feature-gate
Automatic merge from submit-queue (batch tested with PRs 60157, 60337, 60246, 59714, 60467). 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>.

Feature gate for regional PDs

**What this PR does / why we need it**: Adding beta feature gate around regional PD support.

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

**Special notes for your reviewer**: This feature has already been in alpha for two releases, but at the time it was not gated with a Kubernetes feature gate. Instead it was controlled by a GCE-specific alpha gate. However, there are additional changes with GCE PD StorageClass parameters that we'd like to gate as well, and this is out of scope of GCE alpha gates.

/cc @saad-ali @lavalamp
2018-02-27 12:05:33 -08:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Jan Safranek 38c0ce75c3 Volume deletion should be idempotent
- Describe* calls should return aws.Error so caller can handle individual
  errors. aws.Error already has enough context ("InvalidVolume.NotFound: The
  volume 'vol-0a06cc096e989c5a2' does not exist")
- Deletion of already deleted volume should succeed.
2018-02-27 09:46:38 +01:00
Yang Guo 3aca71e162 GCE: support Cloud TPU API in cloud provider 2018-02-26 22:09:35 -08:00
Kubernetes Submit Queue 3ca89a3469
Merge pull request #60125 from vainu-arto/aws-missing-tags-error
Automatic merge from submit-queue (batch tested with PRs 60435, 60334, 60458, 59301, 60125). 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>.

Return missing ClusterID error instead of ignoring it

This fixes issue #57382. In the cases I'm aware of kubelet cannot function if it can't detect the cluster it is running in, so the error should be passed up to the caller preventing initialization when kubelet would fail. This way the error can be detected and kubelet startup attempted again later (giving AWS time to apply the tags).

```release-note
On AWS kubelet returns an error when started under conditions that do not allow it to work (AWS has not yet tagged the instance).
```
2018-02-26 17:48:54 -08:00
Cheng Xing bb0f819d0b Adding beta feature flag for regional PDs. 2018-02-26 15:28:23 -08:00
Kubernetes Submit Queue 98b1c79e2b
Merge pull request #59756 from tsmetana/refactor-describe-volume
Automatic merge from submit-queue (batch tested with PRs 57326, 60076, 60293, 59756, 60370). 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 #59601: AWS: Check error code returned from describeVolume

The errors returned by the describeVolume call are not all equal:
if the error is of InvalidVolume.NotFound type it does not necessarily
mean the desired operation cannot be finished successfully.

Fixes #59601

```release-note
NONE
```
2018-02-26 09:20:49 -08:00
Arto Jantunen cba110aa3d Return missing ClusterID error instead of ignoring it
This fixes issue #57382.
2018-02-26 14:50:58 +02:00
Arto Jantunen a58f16bdfa Add clusterid tags to the instances in AWS tests
In practice these were in most cases required to exist, but kubelet did not
previously enforce this. It now does, so these tests need to change a bit.
2018-02-26 14:50:58 +02:00
Kubernetes Submit Queue 62c5f21d5d
Merge pull request #58767 from 2rs2ts/tag-elb-sgs
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>.

Tag Security Group created for AWS ELB with same additional tags as ELB

/sig aws

(I worked on this with @bkochendorfer)

Tags the SG created for the ELB with the same additional tags the ELB gets from the `service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags` annotation. This is useful for identifying orphaned resources.

We think that reusing the annotation is a simpler and less intrusive approach than adding a new annotation, and most users will want the same set of tags applied.

We weren't sure how to write a test for this because it looks like the fake EC2 code doesn't store the state of the security groups. If new tests are a requirement for merging, we'll need help writing them.

Fixes #53489

```release-note
AWS Security Groups created for ELBs will now be tagged with the same additional tags as the ELB (i.e. the tags specified by the "service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags" annotation.)
```
2018-02-25 11:59:53 -08:00
Kubernetes Submit Queue d1f3de9a39
Merge pull request #57569 from micahhausler/nlb-remove-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>.

Fix AWS NLB delete error

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

Fixes an error when deleting an NLB in AWS

**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 #57568

**Special notes for your reviewer**:


**Release note**:

```release-note
Fixes an error when deleting an NLB in AWS - Fixes #57568
```

@justinsb  How do I get this into the `release-1.9` branch?
2018-02-25 11:07:07 -08:00
Kubernetes Submit Queue f49f799dbd
Merge pull request #59941 from agau4779/gce-external-lb-tests
Automatic merge from submit-queue (batch tested with PRs 60324, 60269, 59771, 60314, 59941). 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>.

[GCE] Refactor ExternalLoadBalancer Tests

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

- Refactors the ExternalLoadBalancer tests to use the generated GCE mock instead of FakeCloudAddressService, FakeCloudForwardingRuleService.
- Adds hooks to populate NetworkTier on Alpha resources
- Moves shared code to top of the external loadbalancer test file
- Moves NetworkTier into a constants file at the cloud level, so it is more easily called in subpackages

**Special notes for your reviewer**:

```release-note
NONE
```
2018-02-24 20:01:50 -08:00
Ashley Gau 828e22bdc6 add comments 2018-02-23 16:14:27 -08:00
Di Xu 271ae45901 fix new typos when rebasing 2018-02-23 09:33:14 +08:00
Doug MacEachern c90e33dda4 update bazel: adds new vclib test 2018-02-22 15:17:01 -08:00
Doug MacEachern 125ce72327 vSphere: Minimize property collection via Finder
The 'All' parameter of the 'NewFinder' function controls property collection while searching the inventory.
When 'All' is set to 'false', Finder collects the minimal set of object properties required to search inventory.
When 'All' is set to 'true', Finder collects *all* object properties, which are *not* required to search inventory.
Setting 'All' to 'true' is only useful when inspecting all properties of an object,
such as by certain govc commands when the '-json' or '-dump' flags are specified.

Changing All=false in VCP minimizes the SOAP payload size and marshalling required on both sides, without impacting any functionality.
2018-02-22 14:32:39 -08:00
Kubernetes Submit Queue a4222bd8c3
Merge pull request #60186 from feiskyer/vmss-check
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>.

Cleanup node type checking for azure nodes

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

This PR cleanup node type checking for azure nodes. It also fixes a problem of `instance not found` error for VMAS nodes in vmss cluster (vmType set to vmss):

```
ss.GetPrimaryInterface(k8s-master), ss.getCachedVirtualMachine(k8s-master), err=instance not found
```

**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 #60185

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-22 08:30:02 -08:00
Kubernetes Submit Queue 064597a8e0
Merge pull request #59857 from feiskyer/metadata
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>.

Fix instanceID for vmss nodes

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

When useInstanceMetadata is set to true for vmss nodes, their providerID is wrong.

Their providerID should be in format `azure:///subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Compute/virtualMachineScaleSets/<scaleset-name>/virtualMachines/<instance-id>`.


**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 #59855

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix instanceID for vmss nodes.
```
2018-02-22 04:39:14 -08:00
Kubernetes Submit Queue c153aff99f
Merge pull request #60064 from tenxcloud/fix_cp_azure_grammar_error
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>.

Fix grammar error of azure cloudprovider code

**What this PR does / why we need it**:
Fix grammar error to make it easy to understand

**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**:

**Release note**:

```release-note
NONE
```
2018-02-22 03:57:47 -08:00
Pengfei Ni 2e9afe2c97 Cleanup node type checking for azure nodes 2018-02-22 13:28:48 +08:00
Ashley Gau 775480f7d9 merge master 2018-02-21 09:58:40 -08:00
Kubernetes Submit Queue 24aa376b00
Merge pull request #59302 from brendandburns/ut2
Automatic merge from submit-queue (batch tested with PRs 59901, 59302, 59928). 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>.

Add more tests for Azure routes.

This builds off of #59165 

Please only review a8d0e73234
2018-02-21 07:02:35 -08:00
Mike Danese a9e0a2b09a cloud: don't require application default credentials to run unit tests 2018-02-20 15:22:00 -08:00
Ashley Gau 8691bb370d Delete unused ForwardingRule fakes 2018-02-20 13:19:04 -08:00
Ashley Gau 6d9409a692 Use shared variable names. Define hooks on mock objects 2018-02-20 13:19:04 -08:00
Ashley Gau d62200bb6c Move shared variables and fakeGCECloud method to top 2018-02-20 13:19:04 -08:00
Ashley Gau e250074b38 Define hooks for inserting Forwarding Rules and Addresses in all versions 2018-02-20 13:19:04 -08:00
Ashley Gau 5dd3fdebec Move and make exported lbScheme types into cloud/constants.go 2018-02-20 13:19:04 -08:00
Ashley Gau bef0838a21 Move NetworkTiers into cloud/constants.go 2018-02-20 13:19:04 -08:00
Ashley Gau a39e7e4146 Add test for wrong networktier resource deletion 2018-02-20 13:19:04 -08:00
Kubernetes Submit Queue 96ec318718
Merge pull request #59842 from ixdy/update-rules_go-02-2018
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>.

 Update bazelbuild/rules_go, kubernetes/repo-infra, and gazelle dependencies

**What this PR does / why we need it**: updates our bazelbuild/rules_go dependency in order to bump everything to go1.9.4. I'm separating this effort into two separate PRs, since updating rules_go requires a large cleanup, removing an attribute from most build rules.

**Release note**:

```release-note
NONE
```
2018-02-19 22:23:05 -08:00
Lei Wang 669560af38 Fix grammar eror of azure cloudprovider 2018-02-20 10:42:13 +08:00
Kubernetes Submit Queue e267f46c8e
Merge pull request #59986 from nicksardo/mockproject
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>.

GCE: Fix SelfLink of cloudprovider mocks

**What this PR does / why we need it**:
Allows the user to pass in a ProjectRouter to the mocked services

**Special notes for your reviewer**:
/assign bowei
/cc agau4779  

**Release note**:
```release-note
NONE
```
2018-02-18 18:39:14 -08:00
Kubernetes Submit Queue 6d0b71740f
Merge pull request #59968 from kubernetes/revert-59323-nodetaint
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>.

Revert "add node shutdown taint"

Reverts kubernetes/kubernetes#59323

Node becomes unready, but is never removed. I've found the following in [kube-controller-manager.log](https://storage.googleapis.com/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce-autoscaling/6055/artifacts/bootstrap-e2e-master/cluster-autoscaler.log) from test run for one such node:

`E0216 01:14:27.084923       1 node_lifecycle_controller.go:686] Error determining if node bootstrap-e2e-minion-group-01b1 shutdown in cloud: failed to get instance ID from cloud provider: instance not found`

This goes on for the rest of the run (~6h). Looks like the node is stuck in Unready state because of this check: https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/nodelifecycle/node_lifecycle_controller.go#L684. Previously, there was no such check and the node was removed.

Reverting as this would affect all users attempting to resize their node groups on GCE.

```release-note
NONE
```
2018-02-16 20:12:56 -08:00
Andrew Garrett 39f46806b7 Don't assume SG is for ELB; pass tags directly 2018-02-16 22:00:22 +00:00
Nick Sardo 2410b6576e Pass ProjectRouter to mocks 2018-02-16 13:47:12 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Soren Mathiasen 7c7e691c5f
Include more information when multiple security groups are tagged
When trying to create ELB we can sometime fail if there is more then one AWS
security group tagged. It very useful to get the list of security groups printed in
the error message.

**Release note**:

```release-note
  Include the list of security groups when failing with the errors that more then one is tagged
```
2018-02-16 16:37:00 +01:00
Kubernetes Submit Queue 0e81651e77
Merge pull request #59909 from jsafrane/volumemanager-approvers
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>.

Add jsafrane as AWS approver.

**What this PR does / why we need it**:
I contrinbuted several PRs in AWS storage and I'm willing to share review/approval duty.

**Release note**:

```release-note
NONE
```

/assign @justinsb
2018-02-16 06:02:01 -08:00
Aleksandra Malinowska 2d54ba3e0f
Revert "add node shutdown taint" 2018-02-16 12:24:27 +01:00
Bryce Carman 3b99e1b487 Add AWS cloud provider option for IAM role
Currently the AWS cloud provider uses the EC2 instance role when
interacting with AWS APIs. This change gives the option to provide and IAM
role that the cloud provider will assume before calling the APIs. All
resources created by the role will be owned by that account instead of
the account where the EC2 instance is running.
2018-02-15 21:14:58 -08:00
Kubernetes Submit Queue 271c267fff
Merge pull request #59830 from khenidak/az-ratelimit
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>.

Azure - ARM Read/Write rate limiting

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

Azure cloud provider currently runs with:
1. Single ARM rate limiter for both `read [put/post/delete]` and `write` operations, while ARM provide [different rates for read/write] (https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits). This causes write operation to stop even if there is available write request quotas. 
2. Cloud provider uses rate limiter's `Accept()` instead of `TryAccept()` This causes control loop to wait for prolonged tike `in case of no request quota available` for **all** requests even for those does not require ARM interaction. A case for that the `Service` control loop will wait for a prolonged time trying to create `LoadBalancer` service even though it can fail and work on the next service which is `ClusterIP`. This PR moves cloud provider tp `TryAccept()`

**Which issue(s) this PR fixes**:
Fixes # https://github.com/kubernetes/kubernetes/issues/58770

**Special notes for your reviewer**:
`n/a`

**Release note**:

```release-note
- Separate current ARM rate limiter into read/write
- Improve control over how ARM rate limiter is used within Azure cloud provider
```

cc @jackfrancis (need your help carefully reviewing this one) @brendanburns @jdumars
2018-02-15 16:43:37 -08:00
Khaled Henidak(Kal) 38a9fc33db code review: create err chan via helper 2018-02-15 20:11:40 +00:00
Brendan Burns 352722b1e7 Add some more tests for routes. 2018-02-15 11:37:39 -08:00
Kubernetes Submit Queue 27daaab224
Merge pull request #59323 from zetaab/nodetaint
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>.

add node shutdown taint

**What this PR does / why we need it**: we need node stopped taint in order to detach volumes immediately without waiting timeout. More info in issue ticket #58635 

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-15 09:52:10 -08:00
Khaled Henidak(Kal) 53036bf755 Code review + resync VMSS changes 2018-02-15 16:49:47 +00:00
Kubernetes Submit Queue 7e8de5422c
Merge pull request #56394 from porridge/fetch-token-retry-longer
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>.

Try longer to fetch initial token.

**What this PR does / why we need it**:
Step towards fixing #56293

**Special notes for your reviewer**:
/kind bug
/priority critial-urgent
@kubernetes/sig-scalability-bugs
/cc @shyamjvs please add to v1.9

**Release note**:
```release-note
NONE
```
2018-02-15 08:31:03 -08:00
Marcin Owsiany 3a5d48700c Try longer to fetch initial token. 2018-02-15 10:57:35 +01:00
Kubernetes Submit Queue 6535c955bf
Merge pull request #59440 from vmware/rohitj-upstream
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>.

Use SetInformers method to register for Node events. (#449)

Till 1.9.2 Kubernetes release vSphere Cloud Provider needs a separate service account which is not needed.

**What this PR does / why we need it**: 
In this fix, vSphere CLoud Provider is now implementing SetInformer API to get the required NodeInformer. With this change vSphere Cloud Provider no more requires separate service account for listening NodeEvents.

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

**Special notes for your reviewer**:
VMware vSphere Cloud Provide internal change

**Release note**:
```release-note
With this fix, separate service account is not needed for vSphere Cloud Provider for listening node events.
```
2018-02-14 13:46:48 -08:00
Jan Safranek 161972272c Add jsafrane as AWS approver. 2018-02-14 17:41:18 +01:00
Kubernetes Submit Queue 0dda5c8a7b
Merge pull request #59749 from zioproto/issues/59421-CheckCIDR
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>.

Detect CIDR IPv4 or IPv6 version to select nexthop

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

The node `InternalIP` is used as nexthop by the Kubernetes master to create routes in the Neutron router for Pods reachability.
If a node has more than one `InternalIP`s, eventually IPv4 and IPv6, a random `InternalIP` from the list is returned.
This can lead to the bug described in https://github.com/kubernetes/kubernetes/issues/59421
We need to check when we build a route that the CIDR and the nexthop belong to the same IP Address Family (both IPv4 or both IPv6)

**Which issue(s) this PR fixes** :
Fixes https://github.com/kubernetes/kubernetes/issues/59421
It is related to https://github.com/kubernetes/kubernetes/issues/55202

**Special notes for your reviewer**:
This is the suggested way to fix the problem after the discussion in https://github.com/kubernetes/kubernetes/pull/59502

**Release note**:
```release-note
NONE
```
2018-02-14 04:10:10 -08:00
Pengfei Ni 68dcacf6e0 Fix instanceID for vmss nodes 2018-02-14 16:38:49 +08:00
Kubernetes Submit Queue d89e64110a
Merge pull request #59716 from feiskyer/vmss-disk
Automatic merge from submit-queue (batch tested with PRs 59489, 59716). 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>.

Add AzureDisk support for vmss nodes

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

This PR adds AzureDisk support for vmss nodes. Changes include

- Upgrade vmss API to 2017-12-01
- Upgrade vmss clients with new version API
- Abstract AzureDisk operations for vmss and vmas
- Added AzureDisk support for vmss
- Unit tests and fake clients fix
 
**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 #43287

**Special notes for your reviewer**:

~~Depending on #59652 (the first two commits are from #59652).~~

**Release note**:

```release-note
Add AzureDisk support for vmss nodes
```
2018-02-14 00:14:34 -08:00
Pengfei Ni fbc871be32 Add vmType checking in Azure disk controller common 2018-02-14 08:38:34 +08:00
Khaled Henidak(Kal) f909859b6d fix json tag on Azure.config 2018-02-13 22:22:25 +00:00
Khaled Henidak(Kal) 9e4f1441b4 Merge branch 'master' of https://github.com/kubernetes/kubernetes into az-ratelimit 2018-02-13 20:57:05 +00:00
Khaled Henidak(Kal) a86062c259 Configuration changes 2018-02-13 20:56:53 +00:00
Khaled Henidak(Kal) 5bf6b0fd70 WIP - create read/writer rate limiter 2018-02-13 20:05:20 +00:00
Saverio Proto 2eff8bf31f Detect CIDR IPv4 or IPv6 version to select nexthop
https://github.com/kubernetes/kubernetes/issues/59421
https://github.com/kubernetes/kubernetes/issues/55202
2018-02-13 09:50:31 +01:00
Kubernetes Submit Queue 757c24d224
Merge pull request #57969 from jsafrane/aws-approver
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>.

Add gnufied as AWS approver.

@gnufied has been maintaining the storage part of AWS cloud provider for a long while and he deserves to be approver.

```release-note
NONE
```

/sig aws
2018-02-12 19:41:02 -08:00
Kubernetes Submit Queue 91c783e20b
Merge pull request #59739 from andyzhangx/azuredisk-initaccount
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>.

fix the error prone account creation method of blob disk

**What this PR does / why we need it**:
use new account generation method for blob disk to fix the error prone account creation method of blob disk

**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 #59738

**Special notes for your reviewer**:

**Release note**:

```
fix the error prone account creation method of azure blob disk
```

/assign @karataliu 
/sig azure
2018-02-12 19:03:37 -08:00
Kubernetes Submit Queue 7488d1c921
Merge pull request #59571 from dims/skip-test-routes-when-there-are-no-vms
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>.

Skip TestRoutes when there are no vm(s)

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

TestRoutes assumes that there is at least one vm in the OpenStack it
is connecting to. So let's limit this test to run properly only when
we are running in a VM or one was created already outside of the
test harness


**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**:
Please see https://github.com/dims/openstack-cloud-controller-manager/issues/73 for some more context

**Release note**:

```release-note
NONE
```
2018-02-12 10:25:55 -08:00
Tomas Smetana 6832d3a056 Fix #59601: AWS: Check error code returned from describeVolume
The errors returned by the describeVolume call are not all equal:
if the error is of InvalidVolume.NotFound type it does not necessarily
mean the desired operation cannot be finished successfully.

Fixes #59601
2018-02-12 17:15:11 +01:00
andyzhangx 8a7198b036 use new account generation method for blob disk
fix comments

change azureDiskSharedAccountNamePrefix var

rename sharedDiskAccountNamePrefix

use default vhd container name as "vhds"

use one commaon func: SearchStorageAccount

fix comments
2018-02-12 13:09:29 +00:00
Pengfei Ni 8c382649ba Add unit tests for mapLoadBalancerNameToVMSet 2018-02-12 16:07:11 +08:00
Pengfei Ni d3e0280c3a Map correct vmset name for internal load balancers 2018-02-12 15:56:57 +08:00
Pengfei Ni 1976983e79 Fix unit tests for vmss 2018-02-12 14:07:05 +08:00
Pengfei Ni 890b7efb1d Add azure disk support of vmss 2018-02-12 14:07:05 +08:00
Pengfei Ni 5042cea857 Use new clients for vmss cache 2018-02-12 14:07:05 +08:00
Pengfei Ni 3b7cc3dd5e Update Azure GO SDK to v12.4.0-beta 2018-02-12 14:07:05 +08:00
Pengfei Ni 5d16067ddd Update vmss fake clients 2018-02-12 14:07:05 +08:00
Pengfei Ni 829e0946e5 Update vmss client to new version 2018-02-12 14:07:05 +08:00
Pengfei Ni 11e5399dde Abstract disk operation interfaces in VMSet 2018-02-12 14:07:05 +08:00
Kubernetes Submit Queue 69324f90e6
Merge pull request #59652 from feiskyer/vmss-cache
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>.

Add generic cache for Azure VMSS

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

This PR adds a generic cache for VMSS and removes old list-based cache.

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

Continue of ##58770.

**Special notes for your reviewer**:

Depends on #59520.

**Release note**:

```release-note
Add generic cache for Azure VMSS
```
2018-02-11 21:22:45 -08:00
Pengfei Ni bde2989c7a Add unit tests for extractVmssVMName 2018-02-12 11:21:08 +08:00
Kubernetes Submit Queue cfa6774540
Merge pull request #56557 from andyzhangx/azurefile-createaccount
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>.

fix the create azure file pvc failure if there is no storage account in current resource group

**What this PR does / why we need it**:
When create an azure file PVC, there will be error if there is no storage account in current resource group.
With this PR, a storage account will be created if there is no storage account in current resource group.

**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 #56556

**Special notes for your reviewer**:
1. rephrase the code logic of `CreateFileShare` func.
```
if accountName is empty, then 
    find a storage account that matches accountType
    if no storage account found, then
        create a new account
else
    we only use user specified storage account

create a file share according to found storage account
```
2. Use func `getStorageAccountName` to get a unique storage account name by UUID, a storage account for azure file would be like `f0b2b0bd40c010112e897fa`. And in next PR, I will use this function to create storage account for azure disk, the storage account for azure disk would be like `d8f3ad8ad92000f1e1e88bd`.

**Release note**:

```
fix the create azure file pvc failure if there is no storage account in current resource group
```
/sig azure
/assign @rootfs
2018-02-11 05:03:32 -08:00
andyzhangx aa21bef677 create storage account if necessary when create azure file pvc
use new storage account name generation method

use uuid to generate account name

change azure file account prefix

use uniqueID to generate a storage account name

fix comments

fix comments

fix comments

fix a storage account matching bug

only use UUID in getStorageAccountName func

use shorter storage account prefix for azure file

fix comments

fix comments

fix comments

fix rebase build error

rewrite CreateFileShare code logic

fix gofmt issue

fix test error

fix comments

fix a location matching bug
2018-02-11 06:29:05 +00:00
Kubernetes Submit Queue 317853c90c
Merge pull request #59464 from dixudx/fix_all_typos
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>.

fix all the typos across the project

**What this PR does / why we need it**:
There are lots of typos across the project. We should avoid small PRs on fixing those annoying typos, which is time-consuming and low efficient.

This PR does fix all the typos across the project currently. And with #59463, typos could be avoided when a new PR gets merged.

**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**:
/sig testing
/area test-infra
/sig release
/cc @ixdy 
/assign @fejta 

**Release note**:

```release-note
None
```
2018-02-10 22:12:45 -08:00
Davanum Srinivas 7ef4f207c2 New github id - FengyunPan -> FengyunPan2
PanFengyun <pan_feng_yun@163.com>'s previous github id was @FengyunPan

Due to some problem with github, he lost access to @FengyunPan and
is not using @FengyunPan2. So let's switch over to the new id. Github
has promised to release the previous id back in 6 months, so we may
have to switch it back later.
2018-02-10 22:28:51 -05:00
Pengfei Ni f32bd6a081 Adjust unit tests for vmss 2018-02-11 11:09:22 +08:00
Pengfei Ni 4d5e7b7cfb Use generic cache for vmss 2018-02-11 11:09:22 +08:00
Kubernetes Submit Queue f0e573d6d5
Merge pull request #59520 from feiskyer/new-cache
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>.

Add generic cache for Azure VM/LB/NSG/RouteTable

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

Part of #58770. This PR adds a generic cache of Azure VM/LB/NSG/RouteTable for reducing ARM calls.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Add generic cache for Azure VM/LB/NSG/RouteTable
```
2018-02-10 19:06:02 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Jesse Haka 6665fa7144 taint also node controller
fix function

fix gofmt

fix function return value

fix tests

skip notimplemented error

remove factory unused

in openstack we should try to find instanceid from all states instead of ACTIVE, all other cloudproviders do this already

fix tests and lint

fix gofmt

fix nodelifecycletest

fix lint errors
2018-02-10 15:41:24 +02:00
Kubernetes Submit Queue a35acccaf8
Merge pull request #59447 from verult/pd-alpha
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>.

Fixes the regression of GCEPD not provisioning correctly on GKE alpha clusters.

Fixes the regression by better distinguishing between single-zone and multi-zone PDs.

**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 #59047

**Special notes for your reviewer**: All PD and dynamic provisioning e2e tests pass, manually verified provision, delete, attach, and detach of both single-zone and multi-zone PDs. Will create e2e tests for multizone PDs in a separate PR.

**Release note**:


/sig storage
/assign @saad-ali
2018-02-09 11:55:10 -08:00
Pengfei Ni 7634eacb4f Add error handling and new tests 2018-02-09 20:38:29 +08:00
Kubernetes Submit Queue 5d8f6ed452
Merge pull request #59619 from jianliao82/patch-1
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>.

Update azure_loadbalancer.md to fix typo

fix typo 
incase -> in case
selction -> selection



**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 #

**Special notes for your reviewer**:

**Release note**:

```release-note
fix typo 
incase -> in case
selction -> selection
```
2018-02-08 21:49:54 -08:00
Kubernetes Submit Queue 0b6a0a6977
Merge pull request #59490 from agau4779/gce-unittest
Automatic merge from submit-queue (batch tested with PRs 58437, 59490, 55684). 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>.

[GCE] Unit test ExternalLoadBalancer

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

- Unit tests for `pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go`
- Tests creating, updating, and deleting an external LoadBalancer

**Future Improvements**
In order to further test `gce_loadbalancer_external.go`, we should add tests for the following cases:

- Network Tiers - when the current/desired network tier doesn't match, existing resources with the wrong tier should be torn down
- Expect an error when the TargetPool does not exist
- Expect an error when the LoadBalancer Firewall does not exist
- Case when TargetPool needs to be recreated 
- Case when IP needs to be released (calls gce.DeleteRegionAddress)
```release-note
NONE
```
2018-02-08 21:34:37 -08:00
liaoj 953cbb11a1
Update azure_loadbalancer.md
fix typo 
incase -> in case
selction -> selection
2018-02-09 12:52:59 +08:00
Kubernetes Submit Queue 30f54b4028
Merge pull request #56974 from gnufied/speed-up-attach-detach
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>.

Make AWS attach/detach operations faster

Most attach/detach operations on AWS finish within 1-4seconds.
By using a shorter time interval and higher exponetial
factor  we can shorten time taken for attach and detach to complete. 

After this change retry interval looks like:

```
[1, 1.8, 3.24, 5.832000000000001, 10.4976]
```

Before it was:
```
[10, 12.0, 14.399999999999999, 17.279999999999998]
```


/sig aws

```release-note
AWS: Make attach/detach operations faster. from 10-12s to 2-6s
```
2018-02-08 20:24:10 -08:00
Pengfei Ni daec2bd745 Add cache for route tables 2018-02-09 09:09:25 +08:00
Pengfei Ni 21c8a63689 Add cache for network security groups 2018-02-09 09:09:25 +08:00
Pengfei Ni d22b6d9ebe Add cache for load balancer 2018-02-09 09:09:25 +08:00
Pengfei Ni 2badf1ff55 Add cache for virtual machines 2018-02-09 09:09:25 +08:00
Pengfei Ni 035c8da63d New unit tests for timedCache 2018-02-09 09:09:25 +08:00
Pengfei Ni 259dbf8da7 Make azure cache general for all objects 2018-02-09 09:09:25 +08:00
Kubernetes Submit Queue 2172a2a806
Merge pull request #59569 from tsmetana/fix-aws-detach
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>.

AWS: Do not ignore errors from EC2::DescribeVolume in DetachDisk

The DetachDisk method of AWS cloudprovider indirectly calls
EC2::DescribeVolume AWS API function to check if the volume
being detached is really attached to the specified node.

The AWS API call may fail and return error which is logged however
the DetachDisk then finishes successfully. This may cause the AWS
volumes to remain attached to the instances forever because the
attach/detach controller will mark the volume as attached. The PV
controller will never be able to delete those disks and they need
to be detached manually.

This patch ensures the error from DescribeVolume is propagated to
attach/detach controller and the detach operation is re-tried.

cc: @gnufied, @jsafrane 

```release-note
NONE
```
2018-02-08 17:02:18 -08:00
Ashley Gau 5e38d785a2 make context the first arg in AddInstanceHook/RemoveInstanceHook 2018-02-08 11:04:39 -08:00
Ashley Gau 4b398a6d8d generate mocked methods with context as the first arg, because golint 2018-02-08 11:02:48 -08:00
Cheng Xing 02352460f6 Fixes the regression of GCEPD not provisioning correctly on alpha clusters. 2018-02-08 10:46:06 -08:00
Kubernetes Submit Queue c3a92d0b9b
Merge pull request #59497 from dougm/vclib-tests
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>.

vclib: enable VM disk attach test

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

Follow up to PR #58534 , where this test was disabled due to a limitation in
govmomi/simulator.  The test passes as expected with godeps update of govmomi.

**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**:

This PR is 1-line update to the vSphere Cloud Provider tests and godep update of the vendor'd vmware/govmomi repo.

**Release note**:

```release-note
NONE
```
2018-02-08 10:40:27 -08:00
Kubernetes Submit Queue c0a337d4cc
Merge pull request #59519 from vmware/vm_uuid_provider_id
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 InstanceID for vSphere Cloud Provider as UUID obtained from product_serial file 

**What this PR does / why we need it**:
vSphere Cloud Provider is not able to find the nodes for VMs created on vSphere v1.6.5. Kubelet fetches SystemUUID from file ```/sys/class/dmi/id/product_uuid```. vSphere Cloud Provider uses this uuid as VM identifier to get node information from vCenter. vCenter v1.6.5 doesn't recognize this uuids, as a result, nodes are not found. 

UUID present in file ```/sys/class/dmi/id/product_serial``` is recognized by vCenter. Yet,  Kubelet doesn't report this. Therefore, in this PR InstanceID is reported as UUID which is fetched from file 
```/sys/class/dmi/id/product_serial```.

**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 https://github.com/kubernetes/kubernetes/issues/58927

**Special notes for your reviewer**:
Internally review here: https://github.com/vmware/kubernetes/pull/452

Tested:
Launched K8s cluster using kubeadm (Used Ubuntu VM compatible with vSphere version 6.5.)
_**Note: Installed Ubuntu from ISO**_
Observed following:
```
Master
> cat /sys/class/dmi/id/product_uuid
743F0E42-84EA-A2F9-7736-6106BB5DBF6B

> cat /sys/class/dmi/id/product_serial
VMware-42 0e 3f 74 ea 84 f9 a2-77 36 61 06 bb 5d bf 6b

Node
> cat /sys/class/dmi/id/product_uuid
956E0E42-CC9D-3D89-9757-F27CEB539B76

> cat /sys/class/dmi/id/product_serial
VMware-42 0e 6e 95 9d cc 89 3d-97 57 f2 7c eb 53 9b 76
```
With this fix controller manager was able to find the nodes.
**controller manager logs**
```
{"log":"I0205 22:43:00.106416       1 nodemanager.go:183] Found node ubuntu-node as vm=VirtualMachine:vm-95 in vc=10.161.120.115 and datacenter=vcqaDC\n","stream":"stderr","time":"2018-02-05T22:43:00.421010375Z"}
```


**Release note**:

```release-note
vSphere Cloud Provider supports VMs provisioned on vSphere v1.6.5
```
2018-02-08 09:43:08 -08:00
Davanum Srinivas 18f1486e97 Skip TestRoutes when there are no vm(s)
TestRoutes assumes that there is at least one vm in the OpenStack it
is connecting to. So let's limit this test to run properly only when
we are running in a VM or one was created already outside of the
test harness
2018-02-08 08:54:04 -05:00
Tomas Smetana c879e531f9 AWS: Do not ignore errors from EC2::DescribeVolumee in DetachDisk
The DetachDisk method of AWS cloudprovider indirectly calls
EC2::DescribeVolume AWS API function to check if the volume
being detached is really attached to the specified node.

The AWS API call may fail and return error which is logged however
the DetachDisk then finishes successfully. This may cause the AWS
volumes to remain attached to the instances forever because the
attach/detach controller will mark the volume as attached. The PV
controller will never be able to delete those disks and they need
to be detached manually.

This patch ensures on error from DescribeVolume is propagated to
attach/detach controller and the detach operation is re-tried.
2018-02-08 13:51:53 +01: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
Pengfei Ni 20de29ae6f Set instanceID to azure resource ID format while useInstanceMetadata is enabled 2018-02-08 15:12:36 +08:00
Pengfei Ni 4e4fde93a7 Add useInstanceMetadata param back in Azure cloud provider
This reverts commit bb1e797b28.
2018-02-08 12:40:35 +08:00
Abrar Shivani 918e47c438 Change provider ID to uuid 2018-02-07 17:08:47 -08:00
Ashley Gau b7fe9fe02f run update-bazel.sh, lint on mock.go 2018-02-07 15:27:35 -08:00
Ashley Gau 5c8e7e3707 remove newline before err checks. address pr comments 2018-02-07 14:38:31 -08:00
Ashley Gau 41070a2f58 use getInstanceByName to check for node presence, instead of DeleteInstance) 2018-02-07 14:36:08 -08:00
Ashley Gau 378b177f02 test updateExternalLoadBalancer removes nodes 2018-02-07 12:42:57 -08:00
Ashley Gau 60ed92b16d check firewall creation + deletion for healthcheck firewall 2018-02-07 11:38:24 -08:00
Ashley Gau 58f96f76e3 isolate node creation into separate function, address PR comments 2018-02-07 11:22:33 -08:00
Doug MacEachern 3aabd7a9ae vclib: enable VM disk attach test
Follow up to PR #58534 , where this test was disabled due to a limitation in
govmomi/simulator.  The test passes as expected with godeps update of govmomi.
2018-02-07 10:55:49 -08:00
Ashley Gau 23a6c5b3b7 cleanup 2018-02-07 09:43:46 -08:00
Kubernetes Submit Queue 891b3d10c4
Merge pull request #59423 from jingax10/upgrade_aliases_branch
Automatic merge from submit-queue (batch tested with PRs 59394, 58769, 59423, 59363, 59245). 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>.

Only populate alias range for nic0 when invoking instance.UpdateNetworkInterface.

**What this PR does / why we need it**:
Without the fix, GCP will emit errors, e.g., googleapi: Error 400: Invalid value for field 'resource.accessConfigs': ''. Updating this field is not supported., invalid

**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 #
N/A

**Special notes for your reviewer**:

**Release note**:

```release-note
"NONE"
```
2018-02-06 21:34:43 -08:00
Kubernetes Submit Queue e5b6026db6
Merge pull request #59287 from cheftako/cloud-context-level
Automatic merge from submit-queue (batch tested with PRs 59441, 58264, 59287, 59396, 59439). 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>.

Add context to all relevant cloud APIs

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

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.

**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 #815

**Special notes for your reviewer**:
For an idea of the full scope of this change please look at PR #58532.

**Release note**:
```release-note
Implementers of the cloud provider interface will note the addition of a context to this interface. Trivial code modification will be necessary for a cloud provider to continue to compile.
```
2018-02-06 20:27:39 -08:00
Kubernetes Submit Queue e740fe68c5
Merge pull request #58264 from WanLinghao/log_fix
Automatic merge from submit-queue (batch tested with PRs 59441, 58264, 59287, 59396, 59439). 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 some log param error

this patch fix some log parameter mistakes.



**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 #

**Special notes for your reviewer**:

**Release note**:

```release-note 
/release-note-none
```
2018-02-06 20:27:36 -08:00
Ashley Gau 2ef71eb6e5 add AddInstanceHook mock method, test insertion of new instace 2018-02-06 17:41:06 -08:00
Ashley Gau ad98c4854f check presence of healthcheck 2018-02-06 17:41:06 -08:00
Ashley Gau 95bd67a18e test loadbalancer resources created & deleted 2018-02-06 17:41:05 -08:00
Ashley Gau aeba01a287 Move shared load balancer variables out of test.lb update/delete tests 2018-02-06 17:41:05 -08:00
Ashley Gau 6fedaa88ec Add TestEmsireExternalLoadBalancer test 2018-02-06 17:41:05 -08:00
Rohit Jog 68aba5fe44 Use SetInformers method to register for Node events. (#449)
Till 1.9.2 Kubernetes release vSphere Cloud Provider needs a separate service account which is not needed.
2018-02-06 16:27:31 -08: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
Ashley Gau 41318d7596 move makeHostUrl to gce_instances (only used there) 2018-02-06 10:49:08 -08:00
Ashley Gau 2d5d301669 use comparable host path instead of full url when creating a targetpool 2018-02-06 10:48:09 -08:00
Kubernetes Submit Queue 87f77cd237
Merge pull request #59340 from feiskyer/fip
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>.

Ensure public IP removed after service deleted

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

When creating many LoadBalancer services, some services may exceed Azure basic LB's FrontendIPConfiguations quota (default is 10). Public IPs are created for all services, but it is not removed after deleting the kubernetes services.

This PR fixes the problem.

**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 #59255

**Special notes for your reviewer**:

Should cherry-pick to v1.9.

**Release note**:

```release-note
Ensure Azure public IP removed after service deleted
```
2018-02-06 08:36:24 -08:00
Jing Ai 19b3bb1562 Only populate alias range for nic0 when invoking instance.UpdateNetworkInterface. 2018-02-06 07:57:26 -08:00
Kubernetes Submit Queue db23481ce8
Merge pull request #59165 from brendandburns/ut
Automatic merge from submit-queue (batch tested with PRs 59165, 59386). 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>.

Refactor and add some tests.

Improve test coverage of the Azure cloud provider.
2018-02-05 23:50:31 -08:00
Pengfei Ni e2eaccb829 Ensure public IP removed after service deleted 2018-02-06 15:04:15 +08:00
Brendan Burns d6bb434730 Refactor and add some tests. 2018-02-05 19:00:39 -08:00
Kubernetes Submit Queue c471b6f946
Merge pull request #59361 from jingax10/aliaes_version_branch
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>.

Use beta instead of alpha GCE Compute API to add an alias range to an instance.

… instance.



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

We use beta instead of alpha GCE Compute API to add an alias range to an instance. Without this change, such an API is reserved for GCP projects which has whitelisted for this feature. 

**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 #
N/A

**Special notes for your reviewer**:

**Release note**:

```release-note
 "NONE".
```
2018-02-05 17:14:13 -08:00
Jing Ai 4738e10b3e Add GCE instance UpdateNetworkInterface API to beta. 2018-02-05 11:39:54 -08:00
Kubernetes Submit Queue ffda1e2200
Merge pull request #57017 from andyzhangx/azurefile-growsize
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>.

add PV size grow feature for azure file

**What this PR does / why we need it**:
According to kubernetes/features#284, add size grow feature for azure file

**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 #56462 

**Special notes for your reviewer**:
Since azure file is using SMB 3.0 protocal, there is no necessary to resize filesystem on agent side, the agent node will detect the changed size automatically.

**Release note**:

```
add size grow feature for azure file
```
/sig azure
@gnufied @rootfs @brendandburns
2018-02-05 11:25:48 -08:00
Jing Ai 627f4d3550 Use beta instead of alpha GCE Compute API to add an alias range to an instance. 2018-02-05 10:34:07 -08:00
Davanum Srinivas 73b46ff7db Fix golint for openstack and cinder packages 2018-02-04 17:15:32 -05:00
Kubernetes Submit Queue d5ee83bda0
Merge pull request #59039 from jianglingxia/jlx-01301854
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>.

Add UT test to openstack and two para in configFromEnv

**What this PR does / why we need it**:
configFromEnv fun miss some para that the type define and add ut to TestToAuthOptions fun
**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**:
/assign @dims 
**Release note**:

```release-note
NONE
```
2018-02-03 21:55:40 -08:00
Kubernetes Submit Queue ce719592fb
Merge pull request #58560 from FengyunPan/fix-ErrResourceNotFound
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>.

Fix non-interface type ErrResourceNotFound on left

Related to #58145
The gophercloud.ErrResourceNotFound is not a interface, so should
use reflect to get its type then do a check.

**Release note**:
```release-note
NONE
```
2018-02-03 21:20:36 -08:00
Kubernetes Submit Queue 1e63d5eb78
Merge pull request #59029 from jianglingxia/jlx-0130
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>.

Correct the URL of openstack and make test case more detail

**What this PR does / why we need it**:
correct the url of openstack doc and make the test case more detail,thanks!
**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 #54044

**Special notes for your reviewer**:
/assign @dims 
**Release note**:

```release-note
NONE
```
2018-02-03 20:45:33 -08:00
Kubernetes Submit Queue 9174553b76
Merge pull request #59295 from nicksardo/sort-firewall
Automatic merge from submit-queue (batch tested with PRs 59097, 57076, 59295). 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>.

GCE: sort firewall parameters

**What this PR does / why we need it**:
Make the firewall arguments deterministic.
Fixes #59294 

**Release note**:
```release-note
NONE
```
2018-02-02 19:37:41 -08:00
Nick Sardo 5d6bb83501 Sort firewall params 2018-02-02 15:38:23 -08:00
Kubernetes Submit Queue 88483ca25d
Merge pull request #59186 from qar/fix/typo
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>.

fix a typo in pkg/cloudprovider/providers/azure/azure_loadbalancer.go

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

fix typo

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


**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-02-02 05:55:06 -08:00
Kubernetes Submit Queue a183fae672
Merge pull request #59189 from jianglingxia/jlx-0201
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>.

Add UT test TestCheckOpenStackOptsfunc

**What this PR does / why we need it**:
checkOpenStackOpts func has three case that the test case not Covered,so add it,thanks
**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**:

**Release note**:

```release-note
NONE
```
2018-02-02 03:54:22 -08:00
Kubernetes Submit Queue d8605eb7eb
Merge pull request #59083 from feiskyer/fix-59046
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>.

Ensure IP is set for Azure internal loadbalancer

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

Internal Load Balancer created and associated with availability set but no target network ip configurations on Azure. And kube-controller-manager would panic because of nil pointer dereference.

This PR ensures it is set correctly.

**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 #59046

**Special notes for your reviewer**:

Should cherry-pick to v1.9

**Release note**:

```release-note
Ensure IP is set for Azure internal load balancer.
```
2018-02-02 01:16:57 -08:00
Kubernetes Submit Queue 92bb4caaea
Merge pull request #59075 from jrperritt/octavia-flip-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>.

cloudprovider/openstack: fix bug that tries to use octavia client to query flip

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

This fixes a bug that [potentially] tries to use an Octavia client to query a floating ip. Neutron should always handle those.

**Release note**:

```release-note
cloudprovider/openstack: fix bug the tries to use octavia client to query flip
```
2018-02-01 03:11:02 -08:00
jianglingxia 029317fdaf Add UT test TestCheckOpenStackOptsfunc 2018-02-01 17:29:26 +08:00
Qiao Anran 928716dfa8
fix a typo in pkg/cloudprovider/providers/azure/azure_loadbalancer.go 2018-02-01 16:30:30 +08:00
andyzhangx bf0c6d84f5 fix rebase error
fix test build failure
2018-01-31 03:02:15 +00:00
Pengfei Ni 6e453d7d31 Fix typo and comments 2018-01-31 10:55:41 +08:00