kubernetes-csi / csi-release-tools

shared build and test files used by kubernetes-csi projects
Apache License 2.0
22 stars 73 forks source link

Combining sidecars #154

Open verult opened 3 years ago

verult commented 3 years ago

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

msau42 commented 3 years ago

Here's reasons I can think of:

Pros of combining sidecars:

Cons/challenges:

xing-yang commented 3 years ago

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?

lpabon commented 3 years ago

This something we discussed way back in Kubecon San Diego 2019 F2F. Here is an (now old) example: https://github.com/lpabon/csi-controller

pohly commented 3 years ago

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:

k8s-triage-robot commented 3 years ago

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:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

chrishenzie commented 3 years ago

/remove-lifecycle stale

mauriciopoppe commented 3 years ago

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:

Cons:

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

k8s-triage-robot commented 2 years ago

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:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

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:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

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:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes-csi/csi-release-tools/issues/154#issuecomment-1030926948): >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/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was 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][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
mauriciopoppe commented 1 year ago

/remove-lifecycle rotten /reopen

k8s-ci-robot commented 1 year ago

@mauriciopoppe: Reopened this issue.

In response to [this](https://github.com/kubernetes-csi/csi-release-tools/issues/154#issuecomment-1587757014): >/remove-lifecycle rotten >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
mauriciopoppe commented 1 year ago

/lifecycle frozen