Commit Graph

79 Commits (a72967454d4bf819befaee45d1cf9134b2ac9bd6)

Author SHA1 Message Date
Nick Sardo 729303f0de Watching ClusterId from within GCE cloud provider 2017-05-23 14:11:24 -07:00
Nick Sardo 87a5edd2cd Initialize cloud providers with a K8s clientBuilder 2017-05-17 14:38:25 -07:00
wlan0 a68c783dc8 Use ProviderID to address nodes in the cloudprovider
The cloudprovider is being refactored out of kubernetes core. This is being
done by moving all the cloud-specific calls from kube-apiserver, kubelet and
kube-controller-manager into a separately maintained binary(by vendors) called
cloud-controller-manager. The Kubelet relies on the cloudprovider to detect information
about the node that it is running on. Some of the cloudproviders worked by
querying local information to obtain this information. In the new world of things,
local information cannot be relied on, since cloud-controller-manager will not
run on every node. Only one active instance of it will be run in the cluster.

Today, all calls to the cloudprovider are based on the nodename. Nodenames are
unqiue within the kubernetes cluster, but generally not unique within the cloud.
This model of addressing nodes by nodename will not work in the future because
local services cannot be queried to uniquely identify a node in the cloud. Therefore,
I propose that we perform all cloudprovider calls based on ProviderID. This ID is
a unique identifier for identifying a node on an external database (such as
the instanceID in aws cloud).
2017-03-27 23:13:13 -07:00
Jing Xu 880de79376 Return nil when deleting non-exist GCE PD
When gce cloud tries to delete a disk, if the disk could not be found
from the zones, the function should return nil error. This modified behavior is also consistent with AWS
2017-03-03 15:06:39 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Angus Lees 8a7e103191 providers: Remove long-deprecated Instances.List()
This method has been unused by k8s for some time, and yet is the last
piece of the cloud provider API that encourages provider names to be
human-friendly strings (this method applies a regex to instance names).

Actually removing this deprecated method is part of a long effort to
migrate from instance names to instance IDs in at least the OpenStack
provider plugin.
2016-12-10 22:36:12 +11:00
Angus Lees 83e7a85ecc provider: Pass full node objects to *LoadBalancer
Many providers need to do some sort of node name -> IP or instanceID
lookup before they can use the list of hostnames passed to
EnsureLoadBalancer/UpdateLoadBalancer.

This change just passes the full Node object instead of simply the node
name, allowing providers to use the node's provider ID and cached
addresses without additional lookups.  Using `node.Name` reproduces the
old behaviour.
2016-12-01 09:53:53 +11:00
Chao Xu c962c2602a dependencies: pkg/cloudprovider 2016-11-23 15:53:09 -08:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Cole Mickens 2ebffb431d implement azure cloudprovider 2016-07-26 14:50:33 -07:00
Cole Mickens 6ad9dc659f add clusterName to Loadbalancer methods 2016-07-26 14:50:33 -07:00
Justin Santa Barbara 29e95431c5 Correctly document cloudprovider Instances contract
The requirement that ExternalID returns InstanceNotFound when the
instance not found was incorrectly documented on InstanceID and
InstanceType.  This requirement arises from the node controller, which
is the only place that checks for the InstanceNotFound error.
2016-07-22 21:59:31 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Minhan Xia a1bd33f510 promote sourceRange into service spec 2016-05-26 10:42:30 -07:00
Chris Batey and James Ravn be9ce30897 Change LoadBalancer methods to take api.Service
This is a better abstraction than passing in specific pieces of the
Service that each of the cloudproviders may or may not need. For
instance, many of the providers don't need a region, yet this is passed
in. Similarly many of the providers want a string IP for the load
balancer, but it passes in a converted net ip. Affinity is unused by
AWS. A provider change may also require adding a new parameter which has
an effect on all other cloud provider implementations.

Further, this will simplify adding provider specific load balancer
options, such as with labels or some other metadata. For example, we
could add labels for configuring the details of an AWS elastic load
balancer, such as idle timeout on connections, whether it is
internal or external, cross-zone load balancing, and so on.

Authors: @chbatey, @jsravn
2016-03-23 10:48:11 +00:00
Justin Santa Barbara cb92133dfa LB Source Ranges: Move validation into API layer
Had to move other things around too to avoid a weird api ->
cloudprovider dependency.

Also adding fixes per code reviews.

(This is a squash of the previously approved commits)
2016-03-03 10:27:17 -05:00
Justin Santa Barbara 49e1149227 AWS: Add support for load balancer source ranges
This refactors #21431 to pull a lot of the code into cloudprovider so it
can be reused by AWS.

It also changes the name of the annotation to be non-GCE specific:
service.beta.kubernetes.io/load-balancer-source-ranges

Fix #21651
2016-02-29 19:32:08 -05:00
Minhan Xia 7ffb123abe add source range support for loadbalancer on gce 2016-02-18 17:05:02 -08:00
Rudi Chiarito b3863eae82 Add instance-type label to cloud providers
Fully implemented for AWS and GCE
2016-02-12 15:02:03 -05:00
Rudi Chiarito 5874b0cb9d Pass namespaced service name to cloudprovider's EnsureLoadBalancer
Also has an AWS implementation that plugs the service name into the ELB and SG.
Log the service name under GCE and OpenStack.
Fixes #20668
2016-02-09 06:50:53 -05:00
Kenneth Shelton d399a8f8cc * Added UDP LB support (for GCE) 2016-01-05 20:51:21 +00:00
Tim Hockin 42c7fec490 Add a cloud-provider hook to scrub DNS for pods
GCE needs this hook and it seems general enough to include.
2015-10-23 17:01:49 -07:00
qiaolei 919add69be Fixed some typos and improved comments 2015-10-03 22:43:10 +08:00
Abhishek Shah 44ce4aa423 Create a LB for a K8S with the LB-IP provided by user. 2015-09-10 21:05:06 -07:00
Justin Santa Barbara 87df1d6fb6 Change CreateTCPLoadBalancer -> EnsureTCPLoadBalancer; implementations auto-delete if already exists
Previously the servicecontroller would do the delete, but by having the cloudprovider
take that task on, we can later remove it from the servicecontroller, and the
cloudprovider can do something more efficient.
2015-08-17 08:58:45 -04:00
CJ Cullen e20467afcb Clean up GCE metadata calls. Remove GetNodeResources from all providers. 2015-08-14 07:29:52 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Satnam Singh 9f32599bee Merge pull request #9720 from justinsb/aws_routes
Refactor Routes, and dynamically configure minion CIDRs on AWS
2015-06-18 17:16:29 -07:00
Justin Santa Barbara a3b43a36fd Refactor cloud route interface, to avoid assumption that routes are named 2015-06-18 14:59:37 -07:00
Justin Santa Barbara a77bc9cfc4 Document assumption made by node-controller, and fix AWS to match
ExternalID must return "", cloudprovider.InstanceNotFound if the instance
is not found, for nodecontroller to remove nodes corresponding to deleted instances.
2015-06-18 14:55:10 -07:00
Justin Santa Barbara df87470ecf Allow cloud providers to return a node identifier different from the hostname 2015-06-18 12:40:05 -07:00
Satnam Singh e4f5529a2d Revert "Allow nodename to be != hostname, use AWS instance ID on AWS" 2015-06-18 11:27:55 -07:00
Justin Santa Barbara efaead81dc Allow cloud providers to return a node identifier different from the hostname 2015-06-17 00:40:43 -04:00
Brendan Burns 5115fd5703 Add key generation. 2015-06-05 14:55:15 -07:00
Justin Santa Barbara c741b8f3ae Pass ports as []*api.ServicePort into LoadBalancer provider
Because AWS needs the NodePort; this also paves the way for e.g. UDP balancing
2015-05-29 18:47:05 -04:00
Federico Simoncelli 2a89428d44 api: add the ProviderID attribute to NodeSpec
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-05-28 13:01:58 -04:00
Federico Simoncelli faba12951a cloudprovider: add support for InstanceID method
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-05-28 12:47:50 -04:00
Federico Simoncelli 194343267d cloudprovider: add the ProviderName method
This patch adds the ProviderName method used to identify the cloud
provider.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-05-28 12:47:47 -04:00
Robert Bailey 1dfaa93ccd For GCE, compute the external IP by using the local metadata
server. This is in many ways a revert of #7530 but after auditing
the code I found that this function is now only used to determine
an address of the node where it is currently running.
2015-05-27 17:41:41 -07:00
Justin Santa Barbara 3884d5fc59 Add LoadBalancer status to ServiceStatus
This will replace publicIPs
2015-05-22 18:27:05 -04:00
Dawn Chen 677a4aa1a7 Merge pull request #8164 from cjcullen/cloudprovider
Route creation reconciler loop.
2015-05-22 12:27:50 -07:00
Quinton Hoole 6d8eaa924e Merge pull request #7852 from a-robinson/tp
Prevent stranding of partial load balancers resources
2015-05-22 10:12:30 -07:00
CJ Cullen e6da5b9601 Make routecontroller_test less hacky.
Rename reconcilePodCIDRs to reconcileNodeCIDRs.
Add comments and TODOs about using controller framework.
2015-05-21 18:05:11 -07:00
CJ Cullen 0d12a15971 Route creation reconciler loop. 2015-05-20 14:21:30 -07:00
CJ Cullen bf646abf8d Revert "Revert "Modify nodes to register directly with the master.""
This reverts commit c53786ab31.
2015-05-20 14:21:03 -07:00
Quinton Hoole c53786ab31 Revert "Modify nodes to register directly with the master." 2015-05-20 13:47:51 -07:00
Alex Robinson dbf224475d Require DeleteTCPLoadBalancer to be idempotent and change the service
controller to rely on that, so that we won't strand partial resources
from them anymore (target pools in GCE, pools in OpenStack, etc.).
2015-05-19 17:06:54 +00:00
Robert Bailey 01467e0bb8 Modify nodes to register directly with the master.
- Delete nodes when they are no longer ready and don't exist in the
cloud provider.
 - Label each node with it's hostname.
 - Add flag to skip node registration.
 - Add a test for registering an existing node.
2015-05-19 09:55:07 -07:00
Tim Hockin a548d542db Rename AffinityType to ServiceAffinity 2015-05-18 17:21:30 -07:00
Tomek Kulczynski 290c7b94ef Make nodecontroller configure nodes' pod IP ranges 2015-05-05 16:10:42 -07:00