Commit Graph

145 Commits (f33e5e8f7a3776cb7cedf44d12bc96ca6a8ebe4f)

Author SHA1 Message Date
Davanum Srinivas 954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Mikhail Mazurskiy 468655b76a
Use typed events client directly 2018-04-01 18:57:29 +10:00
Anthony Yeh 2c7ef5ad4f
Deduplicate RC/RS controller code.
The code was already 99% similar between RC and RS.
This is a wild idea to try to deduplicate the two controllers
in a type-safe manner without adding tons of boilerplate,
and without using code generation.

They are still separate resources. This is a refactor that isn't
intended to change any behavior.
2017-11-07 14:48:32 -08:00
Kevin 4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Joel Smith 1889a6ef52 Slow-start batch pod creation of rs, rc, ds, jobs
Prevent too-large replicas from generating enormous numbers
of events by creating only a few pods at a time, then increasing
the batch size when pod creations succeed. Stop creating batches
of pods when any pod creation errors are encountered.
2017-09-01 09:23:43 -06:00
Dr. Stefan Schimanski 1d053c4f7c controllers: simplify deepcopy calls 2017-08-29 19:21:24 +02:00
Mikhail Mazurskiy b28a83a4cf
Migrate to GetControllerOf from meta/v1 package 2017-08-06 22:41:58 +10:00
Chao Xu 97e07e5b52 Let controllers ignore initialization timeout error when creating a pod. 2017-08-03 15:28:08 -07:00
Kubernetes Submit Queue 9350afd772 Merge pull request #48976 from supereagle/cleanup-api-package
Automatic merge from submit-queue (batch tested with PRs 48976, 49474, 40050, 49426, 49430)

Remove duplicated import and wrong alias name of api package

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

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

**Special notes for your reviewer**:
/assign @caesarxuchao

**Release note**:
```release-note
NONE
```
2017-07-25 12:14:38 -07:00
supereagle adc0eef43e remove duplicated import and wrong alias name of api package 2017-07-25 10:04:25 +08:00
jianglingxia 88828cc777 [trival] fix typo 2017-07-21 16:38:08 +08:00
Jacob Simpson a765b8cfca Migrate api.Scheme to scheme.Scheme 2017-07-17 15:05:38 -07:00
Jacob Simpson 29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Klaus Ma c55f30ba70 Removed TODO that renaming ReplicationManager. 2017-04-30 19:37:47 +08:00
Andy Goldstein 4a47c47650 More RC/RS controller logging updates
We were comparing the address of the old and new RC.spec.replicas and we
have to compare the values. This only affects logging.

Update RS controller to match RC controller to log when spec.replicas
changes, not status.replicas.
2017-04-21 08:07:18 -04:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -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
Andy Goldstein ebd22526b1 Reduce replication_controller log spam
Decrease verbosity and reword 'Observed updated replication controller
...' now that the issue it was added for has been fixed.
2017-04-12 10:23:06 -04:00
Michail Kargakis 68b78282d7 controller: work around milliseconds skew in AddAfter 2017-03-21 16:39:32 -04:00
Anthony Yeh f4ee44eb39 RC/RS: Check that ControllerRef UID matches found controller.
Otherwise, we may confuse a former controller by that name with a new
one that has the same name.
2017-03-20 08:57:42 -07:00
Anthony Yeh b4b8fdbca3 GC: Fix re-adoption race when orphaning dependents.
The GC expects that once it sees a controller with a non-nil
DeletionTimestamp, that controller will not attempt any adoption.
There was a known race condition that could cause a controller to
re-adopt something orphaned by the GC, because the controller is using a
cached value of its own spec from before DeletionTimestamp was set.

This fixes that race by doing an uncached quorum read of the controller
spec just before the first adoption attempt. It's important that this
read occurs after listing potential orphans. Note that this uncached
read is skipped if no adoptions are attempted (i.e. at steady state).
2017-03-17 15:39:26 -07:00
Anthony Yeh e9e8fe6c32 RC/RS: Fix ignoring inactive Pods. 2017-03-06 15:51:53 -08:00
Anthony Yeh 2c2fc9c707 RC/RS: Don't log Pod events unless some RC/RS actually cares. 2017-03-01 15:43:51 -08:00
Anthony Yeh 01d025a7cc ControllerRefManager: Don't always filter inactive Pods.
Some controllers, like DaemonSet, want to see all Pods.
2017-03-01 15:43:51 -08:00
Anthony Yeh db6665251a RC/RS: Don't requeue on error inside sync function.
Returning an error from the sync function already triggers a requeue
in processNextWorkItem().
2017-03-01 15:43:51 -08:00
Anthony Yeh ca13b9e532 RC/RS: Use ControllerRef to route watch events.
This is part of the completion of ControllerRef, as described here:

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md#watches

This also removes the need for the Pod->Controller mapping cache in RC
and RS. This mapping is now persisted in the Pod's ControllerRef
instead.
2017-03-01 15:43:50 -08:00
Chao Xu c3baf402f5 gc changes 2017-02-28 23:05:41 -08:00
Kubernetes Submit Queue 2681e38d3a Merge pull request #42097 from kargakis/address-mismatched-available-replicas
Automatic merge from submit-queue

Enqueue controllers after minreadyseconds when all pods are ready

@janetkuo this should address https://github.com/kubernetes/kubernetes/issues/41697#issuecomment-281851377. Impossible to unit test this but it should stabilize some of our deployment e2e tests that occasionally fail because of availableReplicas not being updated.

It should also fix https://github.com/kubernetes/kubernetes/issues/41641

Eventually I would like AddAfter to be able to cancel previous invocations of the same key so I opened https://github.com/kubernetes/client-go/issues/131

@kubernetes/sig-apps-bugs
2017-02-27 22:09:46 -08:00
Michail Kargakis 9eab226947 Enqueue controllers after minreadyseconds when all pods are ready 2017-02-27 19:28:15 +01:00
Mayank Kumar 6b35ff72ce Enable Garbage collection by default for RS and RC 2017-02-23 22:37:52 -08:00
Anthony Yeh 70bd5fdfe5 Refactor ControllerRefManager
To prepare for implementing ControllerRef across all controllers,
this pushes the common adopt/orphan logic into ControllerRefManager
so each controller doesn't have to duplicate it.

This also shares the adopt/orphan logic between Pods and ReplicaSets,
so it lives in only one place.
2017-02-16 15:09:17 -08:00
Kubernetes Submit Queue b3a34af30f Merge pull request #41300 from kargakis/minor-fixes
Automatic merge from submit-queue (batch tested with PRs 41196, 41252, 41300, 39179, 41449)

controller: cleanup workload controllers a bit

* Switches glog.Errorf to utilruntime.HandleError in DS and RC controllers
* Drops a couple of unused variables in the DS, SS, and Deployment controllers
* Updates some comments

@kubernetes/sig-apps-misc
2017-02-15 04:14:14 -08:00
deads2k fd34b11e13 react to informer updates 2017-02-13 09:18:32 -05:00
Michail Kargakis 10b4ec7b47 controller: cleanup workload controllers a bit
* Switches glog.Errorf to utilruntime.HandleError in DS and RC controllers
* Drops a couple of unused variables in the DS, SS, and Deployment controllers
* Updates some comments
2017-02-12 17:52:28 +01:00
Andy Goldstein 70c6087600 Replace hand-written informers with generated ones
Replace existing uses of hand-written informers with generated ones.
 Follow-up commits will switch the use of one-off informers to shared
 informers.
2017-02-06 13:49:27 -05: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
Dr. Stefan Schimanski a12c661773 pkg/util: move trace.go to k8s.io/apiserver/pkg/util/trace 2017-01-29 21:41:44 +01:00
deads2k b0b156b381 make tools/cache authoritative 2017-01-25 08:29:45 -05:00
deads2k 1ce0637b27 move listers out of cache to reduce import tree 2017-01-20 15:01:38 -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
Michail Kargakis e5b586b5b0 Share rc cache from the rc manager 2017-01-03 16:59:09 +01:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Kubernetes Submit Queue 15f9572b8c Merge pull request #38613 from kargakis/do-not-adopt-when-deleted
Automatic merge from submit-queue

controller: adopt pods only when controller is not deleted

When a replica set is deleted it will continue adopting pods thus driving the worker that handles it in erroring out because the adoption is [always cancelled](59c313730c/pkg/controller/controller_ref_manager.go (L110)) in the controller reference manager.
```
E1212 14:40:31.245773    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.258462    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.259131    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.259149    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-wrmt8_791e3d46-c070-11e6-a234-68f72840e7df because the controlller is being deleted
I1212 14:40:31.268012    7964 deployment_controller.go:314] Error syncing deployment e2e-tests-deployment-2rr3m/test-rollover-deployment: Operation cannot be fulfilled on deployments.extensions "test-rollover-deployment": the object has been modified; please apply your changes to the latest version and try again
E1212 14:40:31.277252    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.277276    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-wrmt8_791e3d46-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.277287    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-bmqpn_81482114-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289148    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-b6s4x_82fa8343-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289169    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289176    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-wrmt8_791e3d46-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289181    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-bmqpn_81482114-c070-11e6-a234-68f72840e7df because the controlller is being deleted
```

@kubernetes/deployment @caesarxuchao
2016-12-13 04:57:49 -08:00