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

Find home for shared k8s-specific libraries #50475

Closed
monopole opened this issue Aug 10, 2017 · 8 comments
Closed

Find home for shared k8s-specific libraries #50475

monopole opened this issue Aug 10, 2017 · 8 comments
Labels
kind/design Categorizes issue or PR as related to design. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.

Comments

@monopole
Copy link
Contributor

As the core repo splits into multiple repos, shared packages need a home, as the core isn't intended for vendoring.

Proposal #48209 established the utils repository, specifically defining it as a repository with no k8s dependence. The utils repo may be viewed as supplementing https://golang.org/pkg, and be of interest to non-k8s projects.

The discussion left open the question of where to put shared packages specific to k8s . E.g.

  • k8s.io/kubernetes/pkg/api/v1/helper
  • k8s.io/kubernetes/pkg/controller/deployment/util
  • k8s.io/kubernetes/pkg/client/retry
  • k8s.io/kubernetes/pkg/printers

Even if these particular examples don’t end up in a common repo, some shared k8s code will exist. Some options to deal with it are:

  • Copy the code to multiple repos rather than link to one library. The copies then evolve independently.
  • Stop linking the code; access it via RPC to live service. The code goes into the repo for that service.
  • Relax the no-k8s constraint on utils and throw all shared packages in there.
  • Per @smarterclayton 's idea, make a new repo https://github.com/kubernetes/common.

This proposal opens the road for the last option.

Proposed README for the new repo:

Common

Go libraries shared by various Kubernetes repositories. See also utils, which has the same purpose but different commit criteria.

Purpose

As Kubernetes grows and spins functionality out of its core and into cooperating repositories (apiserver, kubectl, kubeadm, etc.) that communicate with each other via known API types, the need arises for leaf repositories to house shared code.

This repository is intended to hold shared utilities specific to Kubernetes, e.g. code that depends on Kubernetes API types. The utils repository, a sibling to this repository, holds shared utilities that have no Kubernetes dependence.

Criteria for committing code here

  • Used by multiple Kubernetes repositories.

  • Full unit test coverage.

  • Go tools compliant (go get, go test, etc.).

  • Complex enough to be worth vendoring, rather than copying.

  • Stable, or backward compatible, API.

  • With respect to Kubernetes repositories, this common repository may only depend on repositories intended for external use, e.g. api and utils are OK, core is not OK.

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Aug 10, 2017
@monopole
Copy link
Contributor Author

@kubernetes/sig-architecture-proposals

@k8s-ci-robot k8s-ci-robot added sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. kind/design Categorizes issue or PR as related to design. labels Aug 10, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Aug 10, 2017
@bgrant0607
Copy link
Member

@monopole Thanks for working through these details.

Why shouldn't k8s.io/kubernetes/pkg/client/retry move to client-go or another repo in kubernetes-client?

I'd like other functionality that's applicable to arbitrary K8s-compatible resources to go into kubernetes-client repos/libraries, also. (Ref #7311)

The functionality corresponding to specific Kubernetes APIs, such as k8s.io/kubernetes/pkg/controller/deployment/util, will eventually need to be separated into layers along with other functionality, but starting with kubernetes/common is fine by me. Any time we're ready to do this, email kubernetes-dev according to the incubator process, under the moving-code-out-of-k/k clause.

@bgrant0607
Copy link
Member

@monopole

https://github.com/kubernetes/common now exists

common-admins has admin privilege.

Please also create common-maintainers (write) and common-reviewers (read).

@bgrant0607
Copy link
Member

The client code should live somewhere in API machinery though.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 11, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 11, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@ecebuzz
Copy link

ecebuzz commented Jun 6, 2018

Has there been any update on this project? I am looking for the feature removed in client-go mentioned in kubernetes/client-go#290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Categorizes issue or PR as related to design. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.
Projects
None yet
Development

No branches or pull requests

6 participants