Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate caches in OpenShift master #8229

Closed
smarterclayton opened this issue Mar 23, 2016 · 72 comments · Fixed by #14579
Closed

Duplicate caches in OpenShift master #8229

smarterclayton opened this issue Mar 23, 2016 · 72 comments · Fixed by #14579

Comments

@smarterclayton
Copy link
Contributor

Here is a list of all unique reflector caches, their type, and the location that initializes them in origin.

*api.Build from github.com/openshift/origin/pkg/build/controller/factory/factory.go:125
*api.Build from github.com/openshift/origin/pkg/build/controller/factory/factory.go:186
*api.Build from github.com/openshift/origin/pkg/build/controller/factory/factory.go:74
*api.BuildConfig from github.com/openshift/origin/pkg/build/controller/factory/factory.go:282
*api.BuildConfig from github.com/openshift/origin/pkg/build/controller/factory/factory.go:317
*api.ClusterPolicy from github.com/openshift/origin/pkg/authorization/cache/clusterpolicy.go:32
*api.ClusterPolicyBinding from github.com/openshift/origin/pkg/authorization/cache/clusterpolicybinding.go:32
*api.ConfigMap from controller/resourcequota/resource_quota_controller.go:185
*api.DeploymentConfig from github.com/openshift/origin/pkg/deploy/controller/configchange/factory.go:43
*api.DeploymentConfig from github.com/openshift/origin/pkg/deploy/controller/deploymentconfig/factory.go:43
*api.DeploymentConfig from github.com/openshift/origin/pkg/deploy/controller/imagechange/factory.go:48
*api.Group from github.com/openshift/origin/pkg/user/cache/groups.go:38
*api.ImageStream from controller/resourcequota/resource_quota_controller.go:185
*api.ImageStream from github.com/openshift/origin/pkg/build/controller/factory/factory.go:279
*api.ImageStream from github.com/openshift/origin/pkg/deploy/controller/imagechange/factory.go:37
*api.ImageStream from github.com/openshift/origin/pkg/image/controller/factory.go:40
*api.LimitRange from k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go:156
*api.LimitRange from k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go:156
*api.Namespace from controller/namespace/namespace_controller.go:168
*api.Namespace from controller/serviceaccount/serviceaccounts_controller.go:140
*api.Namespace from github.com/openshift/origin/pkg/project/auth/cache.go:154
*api.Namespace from github.com/openshift/origin/pkg/project/cache/cache.go:84
*api.Namespace from github.com/openshift/origin/pkg/project/controller/factory.go:37
*api.Namespace from github.com/openshift/origin/pkg/security/controller/factory.go:40
*api.Namespace from k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle/admission.go:114
*api.Node from controller/daemon/controller.go:212
*api.Node from controller/node/nodecontroller.go:222
*api.Node from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:220
*api.PersistentVolume from controller/persistentvolume/persistentvolume_claim_binder_controller.go:459
*api.PersistentVolume from controller/persistentvolume/persistentvolume_recycler_controller.go:325
*api.PersistentVolume from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:224
*api.PersistentVolumeClaim from controller/persistentvolume/persistentvolume_claim_binder_controller.go:464
*api.PersistentVolumeClaim from controller/resourcequota/resource_quota_controller.go:185
*api.PersistentVolumeClaim from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:225
*api.Pod from controller/daemon/controller.go:211
*api.Pod from controller/endpoint/endpoints_controller.go:130
*api.Pod from controller/gc/gc_controller.go:81
*api.Pod from controller/job/controller.go:141
*api.Pod from controller/node/nodecontroller.go:223
*api.Pod from controller/replication/replication_controller.go:210
*api.Pod from controller/resourcequota/resource_quota_controller.go:185
*api.Pod from github.com/openshift/origin/pkg/build/controller/factory/factory.go:189
*api.Pod from github.com/openshift/origin/pkg/build/controller/factory/factory.go:240
*api.Pod from github.com/openshift/origin/pkg/deploy/controller/deployerpod/factory.go:57
*api.Pod from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:213
*api.Pod from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:216
*api.Policy from github.com/openshift/origin/pkg/authorization/cache/policy.go:32
*api.PolicyBinding from github.com/openshift/origin/pkg/authorization/cache/policybinding.go:32
*api.ReplicationController from controller/replication/replication_controller.go:209
*api.ReplicationController from controller/resourcequota/resource_quota_controller.go:185
*api.ReplicationController from github.com/openshift/origin/pkg/deploy/controller/deployerpod/factory.go:39
*api.ReplicationController from github.com/openshift/origin/pkg/deploy/controller/deployment/factory.go:50
*api.ReplicationController from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:235
*api.ResourceQuota from controller/resourcequota/resource_quota_controller.go:182
*api.ResourceQuota from controller/resourcequota/resource_quota_controller.go:182
*api.ResourceQuota from k8s.io/kubernetes/plugin/pkg/admission/resourcequota/admission.go:86
*api.ResourceQuota from k8s.io/kubernetes/plugin/pkg/admission/resourcequota/admission.go:86
*api.Secret from controller/resourcequota/resource_quota_controller.go:185
*api.Secret from controller/serviceaccount/tokens_controller.go:145
*api.Secret from github.com/openshift/origin/pkg/serviceaccounts/controllers/deleted_dockercfg_secrets.go:73
*api.Secret from github.com/openshift/origin/pkg/serviceaccounts/controllers/deleted_token_secrets.go:67
*api.Secret from k8s.io/kubernetes/plugin/pkg/admission/serviceaccount/admission.go:118
*api.SecurityContextConstraints from github.com/openshift/origin/pkg/security/admission/admission.go:51
*api.SecurityContextConstraints from github.com/openshift/origin/pkg/security/admission/admission.go:51
*api.SecurityContextConstraints from github.com/openshift/origin/pkg/security/admission/admission.go:51
*api.Service from controller/endpoint/endpoints_controller.go:129
*api.Service from controller/resourcequota/resource_quota_controller.go:185
*api.Service from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:85
*api.Service from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:230
*api.ServiceAccount from controller/serviceaccount/serviceaccounts_controller.go:139
*api.ServiceAccount from controller/serviceaccount/tokens_controller.go:144
*api.ServiceAccount from github.com/openshift/origin/pkg/serviceaccounts/controllers/create_dockercfg_secrets.go:83
*api.ServiceAccount from k8s.io/kubernetes/plugin/pkg/admission/serviceaccount/admission.go:102
*extensions.DaemonSet from controller/daemon/controller.go:210
*extensions.DaemonSet from controller/node/nodecontroller.go:224
*extensions.HorizontalPodAutoscaler from controller/podautoscaler/horizontal.go:121
*extensions.Job from controller/job/controller.go:140
*extensions.ReplicaSet from k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:240
  12 *api.Pod
   7 *api.Namespace
   5 *api.ReplicationController
   5 *api.Secret
   4 *api.ImageStream
   4 *api.ResourceQuota
   4 *api.Service
   4 *api.ServiceAccount
   3 *api.Build
   3 *api.DeploymentConfig
   3 *api.Node
   3 *api.PersistentVolume
   3 *api.PersistentVolumeClaim
   3 *api.SecurityContextConstraints
   2 *api.BuildConfig
   2 *api.LimitRange
   2 *extensions.DaemonSet
   1 *api.ClusterPolicy
   1 *api.ClusterPolicyBinding
   1 *api.ConfigMap
   1 *api.Group
   1 *api.Policy
   1 *api.PolicyBinding
   1 *extensions.HorizontalPodAutoscaler
   1 *extensions.Job
   1 *extensions.ReplicaSet
@smarterclayton
Copy link
Contributor Author

  • We shouldn't have to cache replica set yet
  • ProjectCache looks like we are properly sharing (Only one watcher on Policy)
  • Pod is low hanging fruit - large cache, frequently changed, too many copies
  • We should audit the non-reactive caches (caches that are pure store) and share those first
  • We should be able to share namespace caches for most admission controllers - verify we are doing that

This is without Node watches or any extended admission controllers enabled.

@smarterclayton
Copy link
Contributor Author

30s sync loops:

*api.Service from controller/endpoint/endpoints_controller.go:129
*extensions.Job from controller/job/controller.go:140
*api.ReplicationController from controller/replication/replication_controller.go:209
*extensions.DaemonSet from controller/daemon/controller.go:210
*extensions.HorizontalPodAutoscaler from controller/podautoscaler/horizontal.go:121

1m sync loops:

*api.Namespace from github.com/openshift/origin/pkg/project/controller/factory.go:37

2m sync loop:

*api.Build from github.com/openshift/origin/pkg/build/controller/factory/factory.go:186
*api.Build from github.com/openshift/origin/pkg/build/controller/factory/factory.go:74
*api.BuildConfig from github.com/openshift/origin/pkg/build/controller/factory/factory.go:282
*api.BuildConfig from github.com/openshift/origin/pkg/build/controller/factory/factory.go:317
*api.ClusterPolicy from github.com/openshift/origin/pkg/authorization/cache/clusterpolicy.go:32
*api.ClusterPolicyBinding from github.com/openshift/origin/pkg/authorization/cache/clusterpolicybinding.go:32
*api.DeploymentConfig from github.com/openshift/origin/pkg/deploy/controller/deploymentconfig/factory.go:43
*api.DeploymentConfig from github.com/openshift/origin/pkg/deploy/controller/imagechange/factory.go:48
*api.DeploymentConfig from github.com/openshift/origin/pkg/deploy/controller/configchange/factory.go:43
*api.Group from github.com/openshift/origin/pkg/user/cache/groups.go:38
*api.ImageStream from github.com/openshift/origin/pkg/build/controller/factory/factory.go:279
*api.ImageStream from github.com/openshift/origin/pkg/deploy/controller/imagechange/factory.go:37
*api.Namespace from github.com/openshift/origin/pkg/project/auth/cache.go:154
*api.Pod from github.com/openshift/origin/pkg/build/controller/factory/factory.go:189
*api.Pod from github.com/openshift/origin/pkg/deploy/controller/deployerpod/factory.go:57
*api.Policy from github.com/openshift/origin/pkg/authorization/cache/policy.go:32
*api.PolicyBinding from github.com/openshift/origin/pkg/authorization/cache/policybinding.go:32
*api.ReplicationController from github.com/openshift/origin/pkg/deploy/controller/deployment/factory.go:50
*api.ReplicationController from github.com/openshift/origin/pkg/deploy/controller/deployerpod/factory.go:39

For anything with a short list interval (<5m) instead of re-listing, we should be scanning the list again. We need to investigate whether any controllers mutate the in-memory store as part of normal operations in a way that they need the store to be refreshed, and separate those out.

@smarterclayton
Copy link
Contributor Author

@jeremyeder @timothysc duplicated caches are the likely cause of controller problems on startup and excessive memory use on the controllers. This is not all admission controllers enabled (so there are probably others), but there is plenty of dead weight here. Sync loops should also be adjusted to avoid doing a list (there is no need in most cases). Will spawn appropriate issues.

@timothysc
Copy link

ack, this makes sense.

/cc @rrati

@pweil- pweil- assigned deads2k and unassigned pweil- Mar 24, 2016
@deads2k
Copy link
Contributor

deads2k commented Mar 24, 2016

@smarterclayton admission plugins probably only need caches, so those shouldn't be too hard. I'll think about how to refactor the controllers to share nicely.

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Mar 24, 2016 via email

@timothysc
Copy link

Data also rides across the scheduler as well. Per conversations today we need ~= L2 / L4 equiv cache. There is a ton of data in the objects that are not needed for caching.

@smarterclayton
Copy link
Contributor Author

We had discussed the use of flyweight caches in a few other areas in
earlier issues but I agree.

On Thu, Mar 24, 2016 at 1:39 PM, Timothy St. Clair <[email protected]

wrote:

Data also rides across the scheduler as well. Per conversations today we
need ~= L2 / L4 equiv cache. There is a ton of data in the objects that are
not needed for caching.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8229 (comment)

@deads2k
Copy link
Contributor

deads2k commented Mar 28, 2016

Admission plugin caches are largely an upstream problem. We'd need to do surgery upstream to collapse our caches. @derekwaynecarr

  1. limitranger (kube) - limitranges (contained by origin admission plugins)
  2. namespaceautoprovisioner (kube) - namespaces
  3. namespacexists (kube) - namespaces
  4. namespacelifecycle (kube) - namespaces
  5. resourcequota (kube) - resourcequotas (contained by origin admission plugins)
  6. serviceaccount (kube) - serviceaccounts,secrets
  7. securitycontextcontraints (origin) - sccs (contained by others) This is a small set, so it doesn't much matter.

@derekwaynecarr
Copy link
Member

I am +1 in porting the wants pattern we added in origin into upstream.

I think we can ignore NamespaceExists and NamespaceAutoProvision.

@smarterclayton
Copy link
Contributor Author

In 1.4.0-alpha.0:

*api.Build (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:191
*api.Build (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:77
*api.Build (5m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:130
*api.BuildConfig (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:288
*api.BuildConfig (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:324
*api.ClusterPolicy (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:103
*api.ClusterPolicyBinding (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:103
*api.ClusterResourceQuota (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:103
*api.ConfigMap (12h0m0s) from github.com/openshift/origin/pkg/quota/controller/
*api.Group (2m0s) from github.com/openshift/origin/pkg/user/cache/groups.go:51
*api.ImageStream (10m0s) from github.com/openshift/origin/pkg/image/controller/factory.go:40
*api.ImageStream (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:285
*api.LimitRange (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go:154
*api.LimitRange (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go:154
*api.LimitRange (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:91
*api.Namespace (0s) from github.com/openshift/origin/pkg/project/cache/cache.go:96
*api.Namespace (0s) from pkg/controller/serviceaccount/serviceaccounts_controller.go:143
*api.Namespace (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:91
*api.Namespace (10m0s) from github.com/openshift/origin/pkg/security/controller/factory.go:40
*api.Namespace (1m0s) from github.com/openshift/origin/pkg/project/controller/factory.go:37
*api.Namespace (2m0s) from github.com/openshift/origin/pkg/project/auth/cache.go:200
*api.Namespace (5m0s) from pkg/controller/namespace/namespace_controller.go:199
*api.Node (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:395
*api.Node (0s) from pkg/controller/node/nodecontroller.go:389
*api.Node (21h43m39.27814564s) from pkg/controller/daemon/daemoncontroller.go:239
*api.PersistentVolume (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:399
*api.PersistentVolume (15s) from pkg/controller/volume/persistentvolume/controller_base.go:448
*api.PersistentVolumeClaim (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:400
*api.PersistentVolumeClaim (12h0m0s) from pkg/controller/resourcequota/resource_quota_controller.go:233
*api.PersistentVolumeClaim (15s) from pkg/controller/volume/persistentvolume/controller_base.go:449
*api.Pod (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:389
*api.Pod (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:392
*api.Pod (12h25m58.182480836s) from pkg/controller/podgc/gc_controller.go:89
*api.Pod (15h1m32.428210675s) from pkg/controller/deployment/deployment_controller.go:183
*api.Pod (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:194
*api.Pod (5m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:246
*api.Policy (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:103
*api.PolicyBinding (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:103
*api.ReplicationController (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:410
*api.ReplicationController (10m0s) from pkg/controller/replication/replication_controller.go:221
*api.ReplicationController (12h0m0s) from pkg/controller/resourcequota/resource_quota_controller.go:233
*api.ReplicationController (30s) from pkg/controller/disruption/disruption.go:266
*api.ResourceQuota (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/resourcequota/resource_access.go:83
*api.ResourceQuota (5m0s) from pkg/controller/resourcequota/resource_quota_controller.go:230
*api.Secret (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/deleted_dockercfg_secrets.go:73
*api.Secret (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/deleted_token_secrets.go:67
*api.Secret (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:134
*api.Secret (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/serviceaccount/admission.go:119
*api.Secret (0s) from pkg/controller/serviceaccount/tokens_controller.go:179
*api.Secret (12h0m0s) from pkg/controller/resourcequota/resource_quota_controller.go:233
*api.SecurityContextConstraints (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:91
*api.Service (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:133
*api.Service (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:405
*api.Service (12h0m0s) from pkg/controller/resourcequota/resource_quota_controller.go:233
*api.Service (30m0s) from github.com/openshift/origin/pkg/dns/serviceaccessor.go:45
*api.Service (30s) from pkg/controller/endpoint/endpoints_controller.go:158
*api.ServiceAccount (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/create_dockercfg_secrets.go:121
*api.ServiceAccount (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/serviceaccount/admission.go:103
*api.ServiceAccount (0s) from pkg/controller/serviceaccount/serviceaccounts_controller.go:142
*api.ServiceAccount (0s) from pkg/controller/serviceaccount/tokens_controller.go:178
*apps.PetSet (30s) from pkg/controller/petset/pet_set.go:147
*autoscaling.HorizontalPodAutoscaler (30s) from pkg/controller/podautoscaler/horizontal.go:128
*batch.Job (10m0s) from pkg/controller/job/jobcontroller.go:148
*extensions.DaemonSet (0s) from pkg/controller/node/nodecontroller.go:391
*extensions.DaemonSet (30s) from pkg/controller/daemon/daemoncontroller.go:237
*extensions.Deployment (30s) from pkg/controller/deployment/deployment_controller.go:181
*extensions.Deployment (30s) from pkg/controller/disruption/disruption.go:268
*extensions.ReplicaSet (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/scheduler/factory/factory.go:415
*extensions.ReplicaSet (14h10m6.612471037s) from pkg/controller/deployment/deployment_controller.go:182
*extensions.ReplicaSet (30s) from pkg/controller/disruption/disruption.go:267
*extensions.ReplicaSet (30s) from pkg/controller/replicaset/replica_set.go:205
*policy.PodDisruptionBudget (30s) from pkg/controller/disruption/disruption.go:264
*storage.StorageClass (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/storageclass/default/admission.go:74
*storage.StorageClass (15s) from pkg/controller/volume/persistentvolume/controller_base.go:153

Which is:

   3 *api.Build
   2 *api.BuildConfig
   1 *api.ClusterPolicy
   1 *api.ClusterPolicyBinding
   1 *api.ClusterResourceQuota
   1 *api.ConfigMap
   1 *api.Group
   2 *api.ImageStream
   3 *api.LimitRange
   7 *api.Namespace
   3 *api.Node
   2 *api.PersistentVolume
   3 *api.PersistentVolumeClaim
   6 *api.Pod
   1 *api.Policy
   1 *api.PolicyBinding
   4 *api.ReplicationController
   2 *api.ResourceQuota
   6 *api.Secret
   1 *api.SecurityContextConstraints
   5 *api.Service
   4 *api.ServiceAccount
   1 *apps.PetSet
   1 *autoscaling.HorizontalPodAutoscaler
   1 *batch.Job
   2 *extensions.DaemonSet
   2 *extensions.Deployment
   4 *extensions.ReplicaSet
   1 *policy.PodDisruptionBudget
   2 *storage.StorageClass

@smarterclayton
Copy link
Contributor Author

Which is 74 total.

@smarterclayton
Copy link
Contributor Author

14 upstream reflectors (started in the /vendor/ package) and 60 downstream.

@eparis eparis modified the milestone: 1.5.0 Oct 27, 2016
@pweil-
Copy link
Contributor

pweil- commented Nov 8, 2016

@deads2k - bump. Currently a 3.4 blocker, will this make Friday or is this too risky?

@mfojtik FYI

@deads2k
Copy link
Contributor

deads2k commented Nov 8, 2016

@deads2k - bump. Currently a 3.4 blocker, will this make Friday or is this too risky?

This is a long running effort. No, it will not be resolved in 3.4 or 3.5. Maybe 3.6.

@smarterclayton
Copy link
Contributor Author

Lists of actual dynamic resources left. Projects shouldn't be in this list. ScheduledJobs shouldn't be in this list.

I0528 10:55:51.846979   91779 graph_builder.go:88] Listing and watching dynamic resource {authorization.openshift.io v1 clusterpolicies}
I0528 10:55:51.847052   91779 graph_builder.go:88] Listing and watching dynamic resource {oauth.openshift.io v1 oauthaccesstokens}
I0528 10:55:51.847154   91779 graph_builder.go:88] Listing and watching dynamic resource {batch v2alpha1 scheduledjobs}
I0528 10:55:51.847226   91779 graph_builder.go:88] Listing and watching dynamic resource {user.openshift.io v1 identities}
I0528 10:55:51.847254   91779 graph_builder.go:88] Listing and watching dynamic resource {user.openshift.io v1 users}
I0528 10:55:51.847311   91779 graph_builder.go:88] Listing and watching dynamic resource {template.openshift.io v1 templates}
I0528 10:55:51.847357   91779 graph_builder.go:88] Listing and watching dynamic resource {oauth.openshift.io v1 oauthclients}
I0528 10:55:51.847468   91779 graph_builder.go:88] Listing and watching dynamic resource {apps.openshift.io v1 deploymentconfigs}
I0528 10:55:51.847586   91779 graph_builder.go:88] Listing and watching dynamic resource {build.openshift.io v1 buildconfigs}
I0528 10:55:51.847612   91779 graph_builder.go:88] Listing and watching dynamic resource {build.openshift.io v1 builds}
I0528 10:55:51.847730   91779 graph_builder.go:88] Listing and watching dynamic resource {image.openshift.io v1 images}
I0528 10:55:51.847785   91779 graph_builder.go:88] Listing and watching dynamic resource {network.openshift.io v1 netnamespaces}
I0528 10:55:51.847841   91779 graph_builder.go:88] Listing and watching dynamic resource {authorization.openshift.io v1 clusterpolicybindings}
I0528 10:55:51.847975   91779 graph_builder.go:88] Listing and watching dynamic resource {authorization.openshift.io v1 policybindings}
I0528 10:55:51.848073   91779 graph_builder.go:88] Listing and watching dynamic resource {image.openshift.io v1 imagestreams}
I0528 10:55:51.848146   91779 graph_builder.go:88] Listing and watching dynamic resource {oauth.openshift.io v1 oauthclientauthorizations}
I0528 10:55:51.848191   91779 graph_builder.go:88] Listing and watching dynamic resource {network.openshift.io v1 egressnetworkpolicies}
I0528 10:55:51.848763   91779 graph_builder.go:88] Listing and watching dynamic resource {network.openshift.io v1 hostsubnets}
I0528 10:55:51.848950   91779 graph_builder.go:88] Listing and watching dynamic resource {project.openshift.io v1 projects}
I0528 10:55:51.849010   91779 graph_builder.go:88] Listing and watching dynamic resource {quota.openshift.io v1 clusterresourcequotas}
I0528 10:55:51.849124   91779 graph_builder.go:88] Listing and watching dynamic resource {network.openshift.io v1 clusternetworks}
I0528 10:55:51.849152   91779 graph_builder.go:88] Listing and watching dynamic resource {authorization.openshift.io v1 rolebindingrestrictions}
I0528 10:55:51.849353   91779 graph_builder.go:88] Listing and watching dynamic resource {extensions v1beta1 networkpolicies}
I0528 10:55:51.849385   91779 graph_builder.go:88] Listing and watching dynamic resource {oauth.openshift.io v1 oauthauthorizetokens}
I0528 10:55:51.849461   91779 graph_builder.go:88] Listing and watching dynamic resource {extensions v1beta1 horizontalpodautoscalers}
I0528 10:55:51.849510   91779 graph_builder.go:88] Listing and watching dynamic resource {authorization.openshift.io v1 policies}
I0528 10:55:51.849598   91779 graph_builder.go:88] Listing and watching dynamic resource {route.openshift.io v1 routes}
I0528 10:55:51.849626   91779 graph_builder.go:88] Listing and watching dynamic resource {user.openshift.io v1 groups}

@smarterclayton
Copy link
Contributor Author

I fixed a few of these by reusing ForResource and wrapping in #14391. I think the next step is to split the openshift shared informer

Listing and watching dynamic resource {apps.openshift.io v1 deploymentconfigs}
Listing and watching dynamic resource {authorization.openshift.io v1 rolebindingrestrictions}
Listing and watching dynamic resource {batch v2alpha1 scheduledjobs}
Listing and watching dynamic resource {build.openshift.io v1 buildconfigs}
Listing and watching dynamic resource {build.openshift.io v1 builds}
Listing and watching dynamic resource {extensions v1beta1 horizontalpodautoscalers}
Listing and watching dynamic resource {extensions v1beta1 networkpolicies}
Listing and watching dynamic resource {image.openshift.io v1 imagestreams}
Listing and watching dynamic resource {image.openshift.io v1 images}
Listing and watching dynamic resource {network.openshift.io v1 clusternetworks}
Listing and watching dynamic resource {network.openshift.io v1 egressnetworkpolicies}
Listing and watching dynamic resource {network.openshift.io v1 hostsubnets}
Listing and watching dynamic resource {network.openshift.io v1 netnamespaces}
Listing and watching dynamic resource {oauth.openshift.io v1 oauthaccesstokens}
Listing and watching dynamic resource {oauth.openshift.io v1 oauthauthorizetokens}
Listing and watching dynamic resource {oauth.openshift.io v1 oauthclientauthorizations}
Listing and watching dynamic resource {oauth.openshift.io v1 oauthclients}
Listing and watching dynamic resource {project.openshift.io v1 projects}
Listing and watching dynamic resource {quota.openshift.io v1 clusterresourcequotas}
Listing and watching dynamic resource {route.openshift.io v1 routes}
Listing and watching dynamic resource {user.openshift.io v1 groups}
Listing and watching dynamic resource {user.openshift.io v1 identities}
Listing and watching dynamic resource {user.openshift.io v1 users}

@smarterclayton
Copy link
Contributor Author

smarterclayton commented May 28, 2017

Looks like we need a bug for GC tracking multiple resources that are backed by the same resource, as well as resources in multiple group versions. HPA is an example.

@smarterclayton
Copy link
Contributor Author

Remaining after excluding projects and authorization token types

{apps.openshift.io v1 deploymentconfigs}
{authorization.openshift.io v1 rolebindingrestrictions}
{batch v2alpha1 scheduledjobs}
{build.openshift.io v1 buildconfigs}
{build.openshift.io v1 builds}
{extensions v1beta1 horizontalpodautoscalers}
{extensions v1beta1 networkpolicies}
{image.openshift.io v1 imagestreams}
{image.openshift.io v1 images}
{network.openshift.io v1 clusternetworks}
{network.openshift.io v1 egressnetworkpolicies}
{network.openshift.io v1 hostsubnets}
{network.openshift.io v1 netnamespaces}
{oauth.openshift.io v1 oauthclientauthorizations}
{oauth.openshift.io v1 oauthclients}
{quota.openshift.io v1 clusterresourcequotas}
{route.openshift.io v1 routes}
{user.openshift.io v1 groups}
{user.openshift.io v1 identities}
{user.openshift.io v1 users}

@smarterclayton
Copy link
Contributor Author

@bparees @mfojtik @pweil- for us to not regress peak memory use in 3.6 we need to

  1. fix the bug in GC that registers duplicate listeners for resources in two versions (hpa, cronjobs)
  2. share informers in the comment above that already exist (create and start generated informers for those groups, then use the generated informers for both our own code plus the code above).

Right now we've grown the number of caches by 20% from 1.5 -> 3.6

@smarterclayton
Copy link
Contributor Author

@deads2k still need to know why we have two informers for RBAC

@smarterclayton
Copy link
Contributor Author

#14562, #14391, and #14289 should get us to approximately 56:

*api.Build (5m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:150
*api.BuildConfig (2m0s) from github.com/openshift/origin/pkg/build/controller/factory/factory.go:235
*api.ClusterPolicy (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:111
*api.ClusterPolicyBinding (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:111
*api.ClusterResourceQuota (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:111
*api.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Event (2h0m0s) from github.com/openshift/origin/pkg/unidling/controller/unidling_controller.go:195
*api.Group (2m0s) from github.com/openshift/origin/pkg/user/cache/groups.go:54
*api.ImageStream (10m0s) from github.com/openshift/origin/pkg/image/generated/informers/internalversion/factory.go:45
*api.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Namespace (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Policy (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:111
*api.PolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.PolicyBinding (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:111
*api.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.ResourceQuota (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.SecurityContextConstraints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Service (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:122
*api.Service (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Template (10m0s) from github.com/openshift/origin/pkg/template/generated/informers/internalversion/factory.go:45
*rbac.ClusterRole (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*rbac.ClusterRoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*rbac.Role (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*rbac.RoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*storage.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*v1.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Job (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Namespace (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Node (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.PersistentVolume (15s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Service (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.CertificateSigningRequest (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.ClusterRoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.DaemonSet (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.Deployment (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.Deployment (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.Ingress (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.PodSecurityPolicy (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/
*v1beta1.ReplicaSet (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.RoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.StatefulSet (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.ThirdPartyResource (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
for resource {build.openshift.io v1 buildconfigs}
for resource {build.openshift.io v1 builds}
for resource {extensions v1beta1 horizontalpodautoscalers}
for resource {extensions v1beta1 networkpolicies}
for resource {route.openshift.io v1 routes}

and then I'll do the last one to switch builds to generated informers and we'll cut two more out to 54.

@smarterclayton
Copy link
Contributor Author

The policy part was fixed

@smarterclayton
Copy link
Contributor Author

Well, except for policy binding, will look.

kube-proxy is still using internal in 1.6 so there's not much point to fixing service and endpoints. I think we can turn all SA and secrets to v1, and possibly the namespace informers. That could give us 3 more back.

@smarterclayton
Copy link
Contributor Author

Caches when we only start master api:

*api.ClusterPolicy (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.ClusterPolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.ClusterResourceQuota (10m0s) from github.com/openshift/origin/pkg/quota/generated/informers/internalversion/factory.go:45
*api.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Group (2m0s) from github.com/openshift/origin/pkg/user/cache/groups.go:54
*api.ImageStream (10m0s) from github.com/openshift/origin/pkg/image/generated/informers/internalversion/factory.go:45
*api.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Namespace (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Policy (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.PolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.ResourceQuota (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.SecurityContextConstraints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Service (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Template (10m0s) from github.com/openshift/origin/pkg/template/generated/informers/internalversion/factory.go:45
*storage.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70

Templates is because of #14216, I added a comment. Secrets is because of service account admission and enforce mountable secrets, which we rarely turn on.

Service and endpoints are DNS, which ideally we move back to the nodes post 3.6.

@smarterclayton
Copy link
Contributor Author

Looks like we're back up to 68, mostly due to aggregation:

*api.Build (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:87
*api.BuildConfig (10m0s) from github.com/openshift/origin/pkg/controller/shared/shared_informer.go:87
*api.ClusterPolicy (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.ClusterPolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.ClusterResourceQuota (10m0s) from github.com/openshift/origin/pkg/quota/generated/informers/internalversion/factory.go:45
*api.DeploymentConfig (10m0s) from github.com/openshift/origin/pkg/deploy/generated/informers/internalversion/factory.go:45
*api.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Event (2h0m0s) from github.com/openshift/origin/pkg/unidling/controller/unidling_controller.go:195
*api.Group (2m0s) from github.com/openshift/origin/pkg/user/cache/groups.go:54
*api.ImageStream (10m0s) from github.com/openshift/origin/pkg/image/generated/informers/internalversion/factory.go:45
*api.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Namespace (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Policy (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.PolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
*api.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.ResourceQuota (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.SecurityContextConstraints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Service (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:122
*api.Service (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*api.Template (10m0s) from github.com/openshift/origin/pkg/template/generated/informers/internalversion/factory.go:45
*rbac.ClusterRole (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*rbac.ClusterRoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*rbac.Role (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*rbac.RoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*storage.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
*v1.ConfigMap (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.HorizontalPodAutoscaler (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Job (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Namespace (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Node (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.PersistentVolume (15s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.PersistentVolumeClaim (15s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.PodTemplate (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.ResourceQuota (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.SecurityContextConstraints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.Service (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1alpha1.PodPreset (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.CertificateSigningRequest (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.ClusterRole (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.ClusterRoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.DaemonSet (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.Deployment (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.Ingress (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.PodDisruptionBudget (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.PodSecurityPolicy (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.ReplicaSet (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.Role (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.RoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.StatefulSet (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v1beta1.ThirdPartyResource (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
*v2alpha1.CronJob (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214
<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214
<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214
<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214
<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214

Worst one is endpoints and services - aggregation is using v1, upstream kube-proxy hasn't moved to to it yet, so we're on it for DNS as well.

@smarterclayton
Copy link
Contributor Author

Looks like ClusterRole, Role, ClusterRoleBinding, and RoleBinding are also new.

@smarterclayton
Copy link
Contributor Author

StorageClass is also duplicated.

@smarterclayton
Copy link
Contributor Author

This may be because of ordering with the started informers (aggregation I'm going to put up a patch, because endpoints are expensive and huge).

@smarterclayton
Copy link
Contributor Author

#14694

@smarterclayton
Copy link
Contributor Author

#14679

@smarterclayton
Copy link
Contributor Author

Looking at controllers directly, we can shave a few more off (docker cfg service accounts and secrets). And then this is basically done.

@smarterclayton
Copy link
Contributor Author

Found duplication mostly because of GC double loading, going to open a PR to avoid that. There's a set of remaining I have to triage. We have 35 singleton caches, and then a set of duplicates (the duplicates are all large and high volume). Each of those will get its own issue and then I'll close this.

<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214
<nil> (0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:214

Triage
  *api.ResourceQuota (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.ResourceQuota (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.Namespace (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Namespace (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.Service (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:122
  *api.Service (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Service (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

  *api.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Triaged

Small
  Has Hardcoded references
    *v1beta1.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
    *v1.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
    *storage.StorageClass (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70

Singleton
  *v1beta1.ReplicaSet (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.StatefulSet (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v2alpha1.CronJob (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.PodDisruptionBudget (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.Ingress (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.DaemonSet (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.Deployment (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1alpha1.PodPreset (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.ConfigMap (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.PodTemplate (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.PersistentVolume (15s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.PersistentVolumeClaim (15s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.HorizontalPodAutoscaler (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.Node (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1.Job (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.PodSecurityPolicy (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *v1beta1.CertificateSigningRequest (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *api.Build (10m0s) from github.com/openshift/origin/pkg/build/generated/informers/internalversion/factory.go:45
  *api.BuildConfig (10m0s) from github.com/openshift/origin/pkg/build/generated/informers/internalversion/factory.go:45
  *api.ClusterPolicy (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
  *api.ClusterPolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
  *api.ClusterResourceQuota (10m0s) from github.com/openshift/origin/pkg/quota/generated/informers/internalversion/factory.go:45
  *api.DeploymentConfig (10m0s) from github.com/openshift/origin/pkg/deploy/generated/informers/internalversion/factory.go:45
  *api.Event (2h0m0s) from github.com/openshift/origin/pkg/unidling/controller/unidling_controller.go:195
  *api.Group (2m0s) from github.com/openshift/origin/pkg/user/cache/groups.go:54
  *api.ImageStream (10m0s) from github.com/openshift/origin/pkg/image/generated/informers/internalversion/factory.go:45
  *api.Policy (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
  *api.PolicyBinding (10m0s) from github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/factory.go:45
  *api.SecurityContextConstraints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *api.Template (10m0s) from github.com/openshift/origin/pkg/template/generated/informers/internalversion/factory.go:45
  *extensions.NetworkPolicy (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *rbac.ClusterRole (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *rbac.ClusterRoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *rbac.Role (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *rbac.RoleBinding (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70

@smarterclayton
Copy link
Contributor Author

  *api.ResourceQuota (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.ResourceQuota (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Should be good

  *api.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.ReplicationController (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Deployments, going to try to refactor.

  *api.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Pod (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Builds, I'm going to try to refactor.

  *api.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.LimitRange (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Should be ok - only admission uses the internal version

  *api.Namespace (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Namespace (5m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Everything in API should be using internal, everything in controller should be using namespace.

  *api.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Secret (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Several controllers in origin using internal can be converted to v1, should mean we can get to no internal secret.

  *api.Service (0s) from github.com/openshift/origin/pkg/serviceaccounts/controllers/docker_registry_service.go:122
  *api.Service (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Service (30s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70
  *api.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.Endpoints (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

kube-proxy in 1.6 uses internal, which means dns must use internal, which means API aggregation must use internal. In 1.7 kube-proxy will switch to versioned, and the others should switch.

  *api.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70
  *v1.ServiceAccount (10m0s) from github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/factory.go:70

Upstream uses Internal for admission, we use an internal for controller manager. Can be fixed

@smarterclayton
Copy link
Contributor Author

Done, will investigate other wins in future releass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.