Commit Graph

181 Commits (13b12e89408869c5b560a81e95bca33267bdb8e1)

Author SHA1 Message Date
Kubernetes Submit Queue b84567a57e Merge pull request #45773 from justinsb/servicecontroller_harmonize
Automatic merge from submit-queue

servicecontroller: use consistent node criteria

We have two node selection functions: includeNodeFromNodeList and
getNodeConditionPredicate, and the logic is different.

The logic should be the same, so remove includeNodeFromNodeList and just
use getNodeConditionPredicate everywhere.

Fix #45772

```release-note
servicecontroller: Fix node selection logic on initial LB creation
```
2017-06-11 20:50:10 -07:00
Zihong Zheng 5f814d957e Detect ExternalTrafficPolicy and HealthCheckNodePort changes in needsUpdate() 2017-05-22 18:15:48 -07:00
Bowei Du 3af1c0efcb Add bowei to OWNERS: e2e/test dns,network; cloud route, node, service controller 2017-05-19 14:49:43 -07:00
Justin Santa Barbara 976e046f7a servicecontroller: use consistent node criteria
We have two node selection functions: includeNodeFromNodeList and
getNodeConditionPredicate, and the logic is different.

The logic should be the same, so remove includeNodeFromNodeList and just
use getNodeConditionPredicate everywhere.

Fix #45772
2017-05-13 14:07:13 -04:00
Kubernetes Submit Queue badd785839 Merge pull request #40060 from justinsb/remove_unused_zone
Automatic merge from submit-queue (batch tested with PRs 40060, 44860, 44865, 44825, 44162)

servicecontroller: remove unused zone field

The zone field was unused, and this complicated e.g. #39996

```release-note
NONE
```
2017-04-24 23:07:38 -07:00
Kubernetes Submit Queue 56ea95fa83 Merge pull request #44745 from justinsb/lb_recognize_16_unschedulable
Automatic merge from submit-queue

Exclude master from LoadBalancer / NodePort

The servicecontroller documents that the master is excluded from the
LoadBalancer / NodePort, but this is broken for clusters where we are
using taints for the master (as introduced in 1.6), instead of marking
the master as unschedulable.

This restores the desired documented behaviour, by excluding nodes that
are labeled as masters with the new 1.6 labels, even if they use the new
1.6 taints.

Fix #33884

```release-note
Exclude nodes labeled as master from LoadBalancer / NodePort; restores documented behaviour
```
2017-04-23 21:37:42 -07:00
dhilipkumars fadb275a9a Improve Service controller code coverage a little bit 2017-04-22 22:25:46 +05:30
Justin Santa Barbara 82d600bb5c Exclude master from LoadBalancer / NodePort
The servicecontroller documents that the master is excluded from the
LoadBalancer / NodePort, but this is broken for clusters where we are
using taints for the master (as introduced in 1.6), instead of marking
the master as unschedulable.

This restores the desired documented behaviour, by excluding nodes that
are labeled as masters with the new 1.6 labels, even if they use the new
1.6 taints.

Fix #33884
2017-04-20 22:19:43 -04:00
Kubernetes Submit Queue 227e9744ea Merge pull request #41464 from StudyNick/zte170214
Automatic merge from submit-queue

'synchoronizing' word error
2017-04-17 18:15:13 -07:00
Kubernetes Submit Queue 32ee95496e Merge pull request #39944 from NickrenREN/controller-service-test
Automatic merge from submit-queue

add test for service controller sync and remove unused function
2017-04-17 18:15:04 -07:00
Chao Xu d4850b6c2b move pkg/api/v1/helpers.go to subpackage 2017-04-14 14:25:11 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Andy Goldstein e63fcf708d Make controller Run methods consistent
- startup/shutdown logging
- wait for cache sync logging
- defer utilruntime.HandleCrash()
- wait for stop channel before exiting
2017-04-14 07:27:45 -04:00
NickrenREN 5c9fe166f9 add test for service controller sync and remove unused function 2017-04-13 12:06:12 +08:00
Andy Goldstein 9d8d6ad16c Switch scheduler to use generated listers/informers
Where possible, switch the scheduler to use generated listers and
informers. There are still some places where it probably makes more
sense to use one-off reflectors/informers (listing/watching just a
single node, listing/watching scheduled & unscheduled pods using a field
selector).
2017-02-23 09:57:12 -05:00
Justin Santa Barbara 87da0e69d5 servicecontroller: remove unused zone field
The zone field was unused, and this complicated e.g. #39996
2017-02-19 02:03:38 -05:00
Andy Goldstein 726f18524b Switch service controller to shared informers 2017-02-15 11:21:01 -05:00
StudyNick 54f4a03ca5 'synchoronizing' word error 2017-02-15 16:09:36 +08:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
deads2k 2c1c0f3f72 move workqueue to client-go 2017-01-30 09:08:21 -05:00
deads2k b0b156b381 make tools/cache authoritative 2017-01-25 08:29:45 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
deads2k 1ce0637b27 move listers out of cache to reduce import tree 2017-01-20 15:01:38 -05:00
deads2k 11e8068d3f move pkg/fields to apimachinery 2017-01-19 09:50:16 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Klaus Ma 25fe1e0d82 Made cache.Controller to be interface. 2017-01-13 13:33:23 +08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
NickrenREN 639572ac68 fix redundant alias and remove unused function 2017-01-09 17:13:09 +08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
bprashanth 98c7fe98e1 Don't eat 403 in service controller 2016-12-15 10:27:14 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Kubernetes Submit Queue f45e918b8b Merge pull request #35833 from apelisse/owners-pkg-controller
Automatic merge from submit-queue

Curating Owners: pkg/controller

cc @jsafrane @mikedanese @bprashanth @derekwaynecarr @thockin @saad-ali

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone **lgtms** and then someone
experienced in the project **approves**), we are adding new reviewers to
existing owners files.
## If You Care About the Process:

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
perfectly: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.
## TLDR:

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:
1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.
2. The pull-request is made editable, please edit the OWNERS file to add
   the names of people that should be reviewing code in the future in the **reviewers** section. You probably do NOT need to modify the **approvers** section.
3. Notify me if you want some OWNERS file to be removed.  Being an approver or reviewer
   of a parent directory makes you a reviewer/approver of the subdirectories too, so not all
   OWNERS files may be necessary.
4. Please use ALIAS if you want to use the same list of people over and
   over again (don't hesitate to ask me for help, or use the pull-request
   above as an example)
2016-12-12 18:51:33 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue 5e6578a734 Merge pull request #38419 from freehan/service-status-update
Automatic merge from submit-queue

bump log level on service status update

ref: https://github.com/kubernetes/kubernetes/issues/38349

I tried to reproduce the problem in #38349 and failed. Not sure why service status update failed and service controller skip status update in the next round. What I have observed is that if service status update failed due to conflict, the next round of processServiceUpdate will correct it. 

Bumping log level to get a better signal when it occurs.
2016-12-12 12:42:53 -08:00
Minhan Xia e082ac4a78 bump log level on service status update 2016-12-08 15:00:43 -08:00
Kubernetes Submit Queue cffaf1b71b Merge pull request #31321 from anguslees/lb-nodes
Automatic merge from submit-queue (batch tested with PRs 37328, 38102, 37261, 31321, 38146)

Pass full Node objects to provider LoadBalancer methods
2016-12-05 20:16:53 -08:00
Kubernetes Submit Queue 6abb472357 Merge pull request #37720 from freehan/lb-src-update
Automatic merge from submit-queue

Fix Service Update on LoadBalancerSourceRanges Field

Fixes: https://github.com/kubernetes/kubernetes/issues/33033
Also expands: https://github.com/kubernetes/kubernetes/pull/32748
2016-12-01 18:21:39 -08:00
Minhan Xia 1c2c0c1f63 support service loadBalancerSourceRange update 2016-11-30 15:27:34 -08: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
Pengfei Ni f584ed4398 Fix package aliases to follow golang convention 2016-11-30 15:40:50 +08:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu 7eeb71f698 cmd/kube-controller-manager 2016-11-23 15:53:09 -08:00
Prashanth B 23b048b3ec Update OWNERS 2016-11-02 16:19:29 -07:00
Antoine Pelisse db35acde19 Update OWNERS: Remove reviewers: pkg/controller 2016-11-02 16:19:19 -07:00
Antoine Pelisse c695a54c1c Update OWNERS approvers and reviewers: pkg/controller 2016-11-02 16:19:18 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
deads2k 16fbb47189 fix up service lister 2016-09-20 08:24:33 -04:00
Mike Danese a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
mfanjie 3b374725c6 persist services need to be retried in service controller cache. 2016-08-23 14:49:54 +08:00
mfanjie 5fa640490e rewrite serivce controller to apply the latest controller pattern 2016-08-04 09:28:55 +08:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
k8s-merge-robot 5427e8aa02 Merge pull request #29544 from lixiaobing10051267/masterFuncNote
Automatic merge from submit-queue

Func note is copied same as other one
2016-07-27 21:07:03 -07:00
lixiaobing10051267 77f133dc84 Func note is copied same as other one
Delete the func note
2016-07-27 10:15:18 +08:00
Cole Mickens 6ad9dc659f add clusterName to Loadbalancer methods 2016-07-26 14:50:33 -07:00
k8s-merge-robot 2c490945e8 Merge pull request #28758 from xiang90/clean_service
Automatic merge from submit-queue

controller/service: minor cleanup

1. always handle short case first for if statement

2. do not capitalize error message

3. put the mutex before the fields it protects

4. prefer switch over if elseif.
2016-07-21 14:08:14 -07:00
k8s-merge-robot 7620ed4b52 Merge pull request #28963 from cdrage/better-warning-kubecontroller
Automatic merge from submit-queue

Warn when missing cloud-provider on kube controller
2016-07-20 11:11:23 -07:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
Charlie Drage 13cecd6e4a Warn when missing cloud-provider on kube controller
This commit warns the user / gives better information that when using
--cloud-provider="" on kube-controller, that services such as
LoadBalancer will not work.

However, despite the error, kube-controller will still run as normal.

Fixes https://github.com/kubernetes/kubernetes/issues/12716
Fixes https://github.com/kubernetes/kubernetes/issues/11172
Fixes https://github.com/kubernetes/kubernetes/issues/27085
2016-07-14 11:54:35 -04:00
Wojciech Tyczynski d14fe0f269 Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance 2016-07-11 21:02:33 +02:00
Xiang Li 67f670df2e controller/service: minor cleanup 2016-07-10 23:13:25 -07:00
Wojciech Tyczynski 7219802ac7 Pass pointer to node in NodCondition 2016-07-07 14:10:17 +02:00
bin liu 426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
bin liu fd27cd47f7 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 18:14:26 +08:00
Wojciech Tyczynski 5d702a32c1 Fix race in informer 2016-06-14 16:40:12 +02:00
Minhan Xia a1bd33f510 promote sourceRange into service spec 2016-05-26 10:42:30 -07:00
k8s-merge-robot 4a0e0826e5 Merge pull request #24220 from gmarek/metrics
Automatic merge from submit-queue

Generated clients can return their RESTClients, RESTClient can return its RateLimiter

cc @lavalamp @krousey @wojtek-t @smarterclayton @timothysc 

Ref. #22421
2016-04-27 19:25:38 -07:00
gmarek 3171aac57c Generated clients can return their RESTClients, RESTClient can return its RateLimiter 2016-04-27 22:15:10 +02:00
Alex Robinson ed15931935 Fix DeletingLoadBalancer event generation.
Also patch up a log statement to log the service's namespace and name
rather than potentially just logging `kind:"" apiVersion:""`.
2016-04-27 00:27:55 +00:00
Chao Xu 8537095415 use fully qualified resource in fake clients actions 2016-04-20 19:44:40 -07:00
Chao Xu 49559a3332 Generate the typed clients under the clientset folder 2016-03-31 15:28:45 -07:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -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 5b3bb56a4f Apply exponential backoff in servicecontroller before retrying
Issue #21952
2016-02-29 14:47:36 -05:00
Alex Robinson ab797d1b65 A load balancer should be updated if a service's UID has changed.
The load balancer's name is determined by the service's UID. If the
service's UID has changed (presumably due to a delete and recreate),
then we need to recreate the load balancer as well to avoid eventually
leaking the old one.
2016-02-26 20:26:27 +00:00
Alex Robinson 4ce5f68ed0 Protect against race conditions in the service controller.
Re-GET the service object when we process it rather than trusting the
delta. This will make for a lot more service get requests given that we
resync all the services every 5 minutes, but will avoid re-ordering of
updates and continually retrying stale updates, as has been described in
a few other issues and PRs.
2016-02-26 20:26:22 +00:00
k8s-merge-robot 2e3053a204 Merge pull request #21431 from freehan/sourcerange
Auto commit by PR queue bot
2016-02-21 16:14:42 -08:00
Minhan Xia 7ffb123abe add source range support for loadbalancer on gce 2016-02-18 17:05:02 -08:00
Chao Xu ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00
Chao Xu 97aecd002a remove underscore in imported pkg names 2016-02-16 10:54:51 -08: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
Tim Hockin 78322091f0 Better logs in service controller 2016-02-06 21:14:20 -08:00
k8s-merge-robot 17c65cee35 Merge pull request #20607 from bprashanth/svccontroller_events
Auto commit by PR queue bot
2016-02-06 10:53:27 -08:00
Mike Danese b1743a6887 this is a manual reversion of #20702
I can't revert with github which says "Sorry, this pull request couldn’t be
reverted automatically. It may have already been reverted, or the content may
have changed since it was merged."

Reverts commit: 0c191e787b
2016-02-05 16:34:02 -08:00
Chao Xu 184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
gmarek 0c191e787b Split controller flags between controllers 2016-02-05 12:17:51 +01:00
Chao Xu 1b047f8e67 rename legacy to core 2016-02-04 14:26:56 -08:00
Prashanth Balasubramanian 33654c8b4e Send update events from service-controller. 2016-02-03 16:50:13 -08:00
Chao Xu f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
Chao Xu fe7887f1ec replace the client with clientset in controllers 2016-02-02 20:28:45 -08:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Chao Xu 90b4662d8d Add services/status path, and let the service controller uses Services.UpdateStatus() 2016-01-31 12:39:45 -08:00
Zach Loafman f3a638de31 Merge pull request #16067 from smarterclayton/backoff_conflict
Provide a RetryOnConflict helper for client libraries
2016-01-22 10:23:19 -08:00