csi-release-tools
csi-release-tools copied to clipboard
Combining sidecars
Opening this issue to discuss the feasibility, benefits, and drawbacks of combining CSI controller sidecars and maintaining less repos and images.
One downside of the current "microservices" model of maintaining one controller per repo/image is that an update to a common library, csi-lib-utils for example, requires manual changes that are sometimes duplicated across multiple controllers. One possible solution is to combine controllers into one binary, modeling after kube-controller-manager.
Combining sidecars is non-trivial and would require a strong signal that the improvements are worth the engineering effort. To make such a signal more visible, this bug could be used to collect potential pain points in the current model that are hard to address by other means.
AFAIK there has been some thoughts and work in this area in the past. If you have thought about this, let us know what you think. Thanks!
/cc @chrishenzie
Here's reasons I can think of:
Pros of combining sidecars:
- can use shared informers
- can consolidate common parameters like
--leader-electionwhere we've had consistency issues in the past - eliminate golang binary size overhead
- updating common libraries simpler
- combine metrics, health ports
- reduced release toil
- less confusion for driver authors on which combination of sidecars to use
Cons/challenges:
- How to organize sidecar-specific flags? Do we want to provide fine-grained control of worker threads, timeouts, etc per controller?
- How to hande repos like snapshotter which is more than a sidecar
- Need ability to turn on/off controllers based on what the driver supports, testing matrix, rbac managment
- Development of experimental/alpha features constrained by mature sidecars (probably solvable with feature gating)
- We still need separate common library repos and tooling since csi drivers are using them
Instead of going from one sidecar per repo to all sidecars in one repo, should we also consider something in the middle where we combine some sidecars into one repo but leave others in their own repos?
This something we discussed way back in Kubecon San Diego 2019 F2F. Here is an (now old) example: https://github.com/lpabon/csi-controller
We still need separate common library repos and tooling since csi drivers are using them
Those could be included in a single repo via individual go.mod files in sub-directories.
Let me add another Pro:
- Storage capacity tracking can react to all operations that may affect cacpacity, like resizing. Currently it is limited to volume provisioning and deletion.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
Instead of going from one sidecar per repo to all sidecars in one repo, should we also consider something in the middle where we combine some sidecars into one repo
Another approach I've seen is a single repo with multiple packages like what https://lerna.js.org/ manages, we'd keep the source code of each project isolated in its own directory (minus the common code which would be another package in the repo) and still having the same artifacts as if they were on their own.
In lerna versioning has two modes, fixed where there's a single shared version for all the packages (like a repo version) and independent where each package can have its own release cycle. We could have something similar for go modules.
The directory structure could be something like:
.cloudbuild.yml
Makefile
release-tools/
packages/
csi-lib-utils/
external-attacher/
external-provisioner/
external-resizer/
external-snapshotter/
The sidecars would refer to csi-lib-utils with a go replace line in their go.mod file.
Pros:
- In the fixed mode we could test all of these sidecars as a single unit, that would echo on @msau42's
less confusion for driver authors on which combination of sidecars to usebecause there would be a single version for all of them
Cons:
- Building, I don't think it'd be feasible to build the projects in serial, probably should consider building with
make -j - Versioning, in the fixed mode if there's a fix in one package that means a bump in all of the other ones
Storage capacity tracking can react to all operations that may affect capacity, like resizing. Currently it is limited to volume provisioning and deletion.
With a single repo we could test both images (provisioner and resizer) on presubmit
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue or PR with
/reopen - Mark this issue or PR as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue or PR with
/reopen- Mark this issue or PR as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/remove-lifecycle rotten /reopen
@mauriciopoppe: Reopened this issue.
In response to this:
/remove-lifecycle rotten /reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/lifecycle frozen