Commit Graph

255 Commits (f34a24e98e7c837b567b78be3af958ac1156cd80)

Author SHA1 Message Date
Kubernetes Submit Queue 55e49ed554 Merge pull request #51409 from FengyunPan/implement-InstanceExistsByProviderID
Automatic merge from submit-queue (batch tested with PRs 51409, 54616). 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>.

Implement InstanceExistsByProviderID() for cloud providers

Fix #51406
If cloud providers(like aws, gce etc...) implement ExternalID()
and support getting instance by ProviderID , they also implement
InstanceExistsByProviderID().

/assign wlan0
/assign @luxas

**Release note**:
```release-note
NONE
```
2017-10-27 06:16:20 -07:00
Kubernetes Submit Queue b2b31ada14 Merge pull request #52717 from FengyunPan/remove-LbassV1
Automatic merge from submit-queue (batch tested with PRs 52717, 54568, 54452, 53997, 54237). 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]Remove the LbaasV1 of OpenStack cloud provider

The Neutron LbaasV1 has been declared obsolete, LbaasV2 is a
better choice.
So let's remove the codes of LbaasV1, only support LbaasV2.
xref: #52609
Reference OpenStack doc:
https://docs.openstack.org/mitaka/networking-guide/config-lbaas.html

**Special notes for your reviewer**:
/assign @dims 
/assign @anguslees 

**Release note**:
```release-note
Remove the LbaasV1 of OpenStack cloud provider, currently only support LbaasV2.
```
2017-10-25 23:10:25 -07:00
Kubernetes Submit Queue 1213f9112b Merge pull request #54176 from gonzolino/os-lbaas-provider
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 OpenStack LBaaS v2 Provider configurable

Add option 'lb-provider' to the Loadbalancer section of the OpenStack
cloudprovider configuration to allow using a different LBaaS v2
provider than the default.



**What this PR does / why we need it**:
This PR allows to use a different OpenStack LBaaS v2 provider than the default of the OpenStack cloud.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Added option lb-provider to OpenStack cloud provider config
```
2017-10-23 08:08:10 -07:00
Daniel Gonzalez 62b8a62844 Make OpenStack LBaaS v2 Provider configurable
Add option 'lb-provider' to the Loadbalancer section of the OpenStack
cloudprovider configuration to allow using a different LBaaS v2
provider than the default.
2017-10-23 12:27:10 +02:00
FengyunPan bf7f1a0610 Update gophercloud: cleanup lbaas v1 2017-10-23 18:01:03 +08:00
FengyunPan b308e36819 [OpenStack]Remove the LbaasV1 of OpenStack cloud provider
The Neutron LbaasV1 has been declared obsolete, LbaasV2 is a
better choice.
So let's remove the codes of LbaasV1, only support LbaasV2.
Talked at: #52609
Related to: #52821
Reference OpenStack doc:
https://docs.openstack.org/mitaka/networking-guide/config-lbaas.html
2017-10-23 17:59:20 +08:00
NickrenREN 8af03d0fae let the caller log error message 2017-10-23 11:12:04 +08:00
FengyunPan 462087fd74 Implement InstanceExistsByProviderID() for cloud providers
Fix #51406
If cloud providers(like aws, gce etc...) implement ExternalID()
and support getting instance by ProviderID , they also implement
InstanceExistsByProviderID().
2017-10-20 14:59:28 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
FengyunPan 30e7a5c118 Volunteer to help with sig/openstack
I would like to do some code review/approve for OpenStack cloud
provider and cinder volume.
2017-10-13 16:49:59 +08:00
Kubernetes Submit Queue f60b92a26a Merge pull request #50836 from FengyunPan/auto-get-NodeSecurityGroupID
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>.

Support autoprobing node-security-group for openstack cloud provider

1. Support autoprobing node-security-group
2. Support multiple Security Groups for cluster's nodes
3. Fix recreating Security Group for cluster's nodes

This is a part of #50726

**Special notes for your reviewer**:
/assign @anguslees 
/assign @dims 

**Release note**:
```release-note
Support autoprobing node-security-group for openstack cloud provider, Support multiple Security Groups for cluster's nodes.
```
2017-10-11 21:40:16 -07:00
FengyunPan 5af6a0b4de The Securty Group name should be unique
Currently the service's name is not unique, and the Securty Group
name is not unique too. openstack cloud provider will delete the
Securty Group of other loadbalancer service when do a deletion.
2017-10-11 19:20:36 +08:00
FengyunPan 04dbfe67d6 Support autoprobing node-security-group for openstack cloud provider
1. Support autoprobing node-security-group
2. Support multiple Security Groups for cluster's nodes
3. Fix recreating Security Group for cluster's nodes

This is a part of #50726
2017-10-10 15:04:32 +08:00
Kubernetes Submit Queue e8ee831abf Merge pull request #53588 from NickrenREN/openstack-deletevolume
Automatic merge from submit-queue (batch tested with PRs 52662, 53547, 53588, 53573, 53599). 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 err when delete volume failed

Return err when delete volume failed

**Release note**:
```release-note
NONE
```

/kind bug
/sig openstack
2017-10-09 12:51:19 -07:00
Kubernetes Submit Queue 1dc1eb7373 Merge pull request #53197 from FengyunPan/node-0
Automatic merge from submit-queue (batch tested with PRs 53567, 53197, 52944, 49593). 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]Add codes to check the count of nodes(members)

After merging this PR(#53146), if there is no available nodes for
the loadbalancer service, UpdateLoadBalancer() will run panic.

**Release note**:
```release-note
NONE
```
2017-10-09 11:18:46 -07:00
Kubernetes Submit Queue 92210a7d76 Merge pull request #53523 from zetaab/ignore_volume_label
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 possibility to ignore volume label in dynamic provisioning

**What this PR does / why we need it**: this is needed if openstack cinder zone name does not match to compute zone names. For instance if there is only one cinder zone and many compute zones.

**Which issue this PR fixes**: fixes #53488

**Special notes for your reviewer**: 

```release-note
NONE
```
2017-10-09 09:17:04 -07:00
NickrenREN dca4732145 Return err when delete volume failed 2017-10-09 21:32:45 +08:00
Jesse Haka e45457b0d8 add possibility to ignore volume label in dynamic provisioning
ignorelabel -> addlabel

FIX tests

small fix to test

fixes according what was asked

fix test

fix test
2017-10-09 09:52:42 +03:00
FengyunPan 370ad205b7 [OpenStack]Add codes to check the count of nodes(members)
After merging this PR(#53146), if there is no available nodes for
the loadbalancer service, UpdateLoadBalancer() will run panic.
2017-10-09 10:01:49 +08:00
Kubernetes Submit Queue 6e7989e652 Merge pull request #53510 from dims/run-tests-with-devstack
Automatic merge from submit-queue (batch tested with PRs 52768, 51898, 53510, 53097, 53058). 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>.

Ability to run the openstack tests against DevStack

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

Some of the environment variables have changed as devstack defaults
have changed. So look for the older env variables first and try the
newer ones later.

At a minimum you need the following for v3 authentication which is
the default with latest devstack. If you miss the Tenant information
then the token issued will be a unscoped token (and will not have any
service catalog information).

OS_AUTH_URL=http://192.168.0.42/identity
OS_REGION_NAME=RegionOne
OS_USERNAME=demo
OS_PASSWORD=supersecret
OS_TENANT_NAME=demo
OS_USER_DOMAIN_ID=default


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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-06 13:16:42 -07:00
Kubernetes Submit Queue 536f9ac1d8 Merge pull request #53115 from FengyunPan/fix-auto
Automatic merge from submit-queue (batch tested with PRs 53418, 53366, 53115, 53402, 53130). 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 version detection of OpenStack Cinder

**What this PR does / why we need it**:
When running Kubernetes against an installation of DevStack which
deploys the Cinder service at a path rather than a port (ex:
http://foo.bar/volume rather than http://foo.bar:xxx), the version
detection fails. It is better to use the OpenStack service catalog.
OTOH, when initialize cinder client, kubernetes will check the
endpoint from the OpenStack service catalog, so we can do this
version detection by it.

There are two case should be fixed in other PR:
1. revisit the version detection after supporting Cinder V3 API.
2. add codes to support MicroVersion after gophercloud supports MicroVersion.

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

**Special notes for your reviewer**:
/assign @dims 
/assign @xsgordon 

**Release note**:
```release-note
Using OpenStack service catalog to do version detection
```
2017-10-05 17:31:21 -07:00
Davanum Srinivas c04f04c229 Ability to run the openstack tests against DevStack
Some of the environment variables have changed as devstack defaults
have changed. So look for the older env variables first and try the
newer ones later.

At a minimum you need the following for v3 authentication which is
the default with latest devstack. If you miss the Tenant information
then the token issued will be a unscoped token (and will not have any
service catalog information).

OS_AUTH_URL=http://192.168.0.42/identity
OS_REGION_NAME=RegionOne
OS_USERNAME=demo
OS_PASSWORD=supersecret
OS_TENANT_NAME=demo
OS_USER_DOMAIN_ID=default
2017-10-05 17:31:20 -04:00
Kubernetes Submit Queue 9e9ebc04fb Merge pull request #53195 from dixudx/add_timeout_for_openstack_cloudprovider
Automatic merge from submit-queue (batch tested with PRs 51750, 53195, 53384, 53410). 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 http request timeout for OpenStack cloud provider

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

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

**Special notes for your reviewer**:
/assign @NickrenREN @dims @FengyunPan 

**Release note**:

```release-note
None
```
2017-10-05 06:08:58 -07:00
Di Xu fe92a55425 add timeout for Openstack cloud provider 2017-10-03 10:11:54 +08:00
Kubernetes Submit Queue 56cff3fc26 Merge pull request #53101 from FengyunPan/default-external
Automatic merge from submit-queue (batch tested with PRs 53101, 53158, 52165). 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] Service LoadBalancer defaults to external

**What this PR does / why we need it**:
Let "service.beta.kubernetes.io/openstack-internal-load-balancer" default to false.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-09-29 14:36:16 -07:00
Kubernetes Submit Queue d58e322bdb Merge pull request #52983 from kubermatic/use-notimplemented-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>.

Use custom error for "unimplemented"

**What this PR does / why we need it**:
This introduces a new error type `NotImplemented` which is used in cloud-providers to tell that this functionality is not implemented.

Needed for https://github.com/kubernetes/kubernetes/pull/52645 to avoid doing a string comparison.
2017-09-29 01:05:50 -07:00
Kubernetes Submit Queue 3eb5ba805c Merge pull request #52628 from richardalberto/metadata-search-order
Automatic merge from submit-queue (batch tested with PRs 53157, 52628). 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>.

Added openstack instance metadata search order

**What this PR does / why we need it**: This PR adds a search order for the instance metadata retrieval on openstack. More information and discussion can be found on #52378 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-27 22:54:15 -07:00
Richard Gonzalez 0e81cac328 Metadata order search tests 2017-09-27 13:39:07 -04:00
Richard Gonzalez 870195ad59 Added openstack instance metadata search order 2017-09-27 02:33:16 -04:00
FengyunPan 4b2604bfe8 [OpenStack] Service LoadBalancer defaults to external 2017-09-27 11:12:51 +08:00
FengyunPan b35aa85560 Fix the version detection of OpenStack Cinder
When running Kubernetes against an installation of DevStack which
deploys the Cinder service at a path rather than a port (ex:
http://foo.bar/volume rather than http://foo.bar:xxx), the version
detection fails. It is better to use the OpenStack service catalog.
OTOH, when initialize cinder client, kubernetes will check the
endpoint from the OpenStack service catalog, so we can do this
version detection by it.
2017-09-26 21:56:17 +08:00
Henrik Schmidt 1339e4cffc Use custom error for "unimplemented" 2017-09-26 09:21:53 +02:00
Kubernetes Submit Queue 0ce1cc9992 Merge pull request #52609 from FengyunPan/register-internal-ip
Automatic merge from submit-queue (batch tested with PRs 52751, 52898, 52633, 52611, 52609). 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 register floatingIP for external loadbalancer service

If the user has provided the floating-ip options, then it's safe
to assume they want (only) the floating-ip to be the ingress IP;
if they have not provided floating-ip options, then the LB IP is
the only relevant value.


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

**Release note**:
```release-note
Only register floatingIP into Loadbalancer ingress field for external loadbalancer service
```
2017-09-24 05:27:55 -07:00
Kubernetes Submit Queue 1e36480492 Merge pull request #52611 from FengyunPan/missing-floatingip
Automatic merge from submit-queue (batch tested with PRs 52751, 52898, 52633, 52611, 52609). 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 missing floatingip when calling GetLoadBalancer()

If user specify floating-network-id, a floatingip and a vip will
be assigned to LoadBalancer service, So its status contains a
floatingip and a vip, but GetLoadBalancer() only return vip.

**Release note**:
```release-note
GetLoadBalancer() only return floatingip when user specify floating-network-id, or return LB vip.
```
2017-09-24 05:27:52 -07:00
Kubernetes Submit Queue 8e7f5d8c8b Merge pull request #52855 from NickrenREN/remove-rackspace
Automatic merge from submit-queue (batch tested with PRs 52880, 52855, 52761, 52885, 52929). 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>..

Remove cloud provider rackspace

**What this PR does / why we need it**:
For now, we have to implement functions in both `rackspace` and `openstack` packages if we want to add function for cinder, for example [resize for cinder](https://github.com/kubernetes/kubernetes/pull/51498).  Since openstack has implemented all the functions rackspace has,  and rackspace is considered deprecated for a long time, [rackspace deprecated](https://github.com/rackspace/gophercloud/issues/592) ,
after talking with @mikedanese  and @jamiehannaford offline ,  i sent this PR to remove `rackspace` in favor of `openstack`

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

**Special notes for your reviewer**:

**Release note**:
```release-note
The Rackspace cloud provider has been removed after a long deprecation period. It was deprecated because it duplicates a lot of the OpenStack logic and can no longer be maintained. Please use the OpenStack cloud provider instead.
```
2017-09-24 04:30:04 -07:00
NickrenREN 39c48d3605 remove rackspace related code 2017-09-22 18:06:50 +08:00
FengyunPan a769c11d4b Mark the LBaaS v1 of OpenStack cloud provider deprecated
Since LBaaS v1 is deprecated in the OpenStack Liberty release, we
deprecated it on Kubernetes.
Reference OpenStack doc:
https://docs.openstack.org/mitaka/networking-guide/config-lbaas.html
Related to: #52717
2017-09-21 09:59:35 +08:00
FengyunPan 729634323d Fix missing floatingip when calling GetLoadBalancer()
If user specify floating-network-id, a floatingip be assigned to
LoadBalancer service, So its status contains a floatingip, but
GetLoadBalancer() only return vip.
2017-09-19 11:09:13 +08:00
FengyunPan 70a0f443c8 Only register floatingIP for external loadbalancer service
If the user has provided the floating-ip options, then it's safe
to assume they want (only) the floating-ip to be the ingress IP;
if they have not provided floating-ip options, then the LB IP is
the only relevant value.
Fix #52566
2017-09-19 09:43:24 +08:00
Davanum Srinivas b6721bebea Changes in OpenStack cloud provider for latest gophercloud 2017-09-01 20:56:13 -04:00
jianglingxia 437f4640ca fix typo about volumes 2017-08-29 18:57:57 +08:00
Kubernetes Submit Queue 4231308582 Merge pull request #51317 from FengyunPan/GetZoneByProviderID-openstack
Automatic merge from submit-queue

Implement GetZoneByProviderID and GetZoneByNodeName for openstack

This is part of #50926
cc @wlan0

**Release note**:
```release-note
NONE
```
2017-08-26 10:09:33 -07:00
Kubernetes Submit Queue 27fbb68f18 Merge pull request #51087 from oracle/for/upstream/master/ccm-instance-exists
Automatic merge from submit-queue (batch tested with PRs 51174, 51363, 51087, 51382, 51388)

Add InstanceExistsByProviderID to cloud provider interface for CCM

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

Currently, [`MonitorNode()`](02b520f0a4/pkg/controller/cloud/nodecontroller.go (L240)) in the node controller checks with the CCM if a node still exists by calling `ExternalID(nodeName)`. `ExternalID` is supposed to return the provider id of a node which is not supported on every cloud. This means that any clouds who cannot infer the provider id by the node name from a remote location will never remove nodes that no longer exist. 


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

**Special notes for your reviewer**:

We'll want to create a subsequent issue to track the implementation of these two new methods in the cloud providers.

**Release note**:

```release-note
Adds `InstanceExists` and `InstanceExistsByProviderID` to cloud provider interface for the cloud controller manager
```

/cc @wlan0 @thockin @andrewsykim @luxas @jhorwit2

/area cloudprovider
/sig cluster-lifecycle
2017-08-26 06:43:30 -07:00
Kubernetes Submit Queue c170f5bfa2 Merge pull request #50972 from FengyunPan/external-loadBalancerIP
Automatic merge from submit-queue (batch tested with PRs 51235, 50819, 51274, 50972, 50504)

Support for specifying external LoadBalancerIP on openstack

1. Support ServiceAnnotationLoadBalancerFloatingNetworkId for LB v1

2. Support for specifying external LoadBalancerIP on openstack
    Add ServiceAnnotationLoadBalancerInternal annotation to distinguish
    between internal LoadBalancerIP and external LoadBalancerIP.


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

**Release note**:
```release-note
NONE
```
2017-08-25 19:40:36 -07:00
Josh Horwitz cf75c49883 change godoc based on feedback from luxas 2017-08-25 18:04:10 -04:00
Josh Horwitz 3528ceb27f address test & doc comments 2017-08-25 16:15:55 -04:00
FengyunPan 79d2b1dd4e Implement GetZoneByProviderID and GetZoneByNodeName for openstack
This is part of #50926
cc @wlan0
2017-08-25 23:08:00 +08:00
Kubernetes Submit Queue d7102a0f36 Merge pull request #49770 from FengyunPan/fix-GetInstanceIDFromProviderID
Automatic merge from submit-queue (batch tested with PRs 51244, 50559, 49770, 51194, 50901)

Fix the matching rule of instance ProviderID

Url.Parse() can't parse ProviderID which contains ':///'.
This PR use regexp to match ProviderID.

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

**Release note**:
```release-note
NONE
```
2017-08-25 04:11:10 -07:00
andrewsykim bd3cc83110 cloudprovider.Zones should support external cloud providers 2017-08-24 21:05:49 -04:00
Josh Horwitz 2f1ea47c83 Add InstanceExists* methods to cloud provider interface for CCM 2017-08-24 20:41:28 -04:00