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

Krew plugin criteria #152

Closed

Conversation

corneliusweig
Copy link
Contributor

Hi @ahmetb @juanvallejo,

as you all know, krew-index currently has no criteria to apply for accepting or rejecting plugins. This creates friction for both contributors and maintainers:

  • plugin contributors, because they have no idea whether their idea might be accepted.
  • krew-index maintainers, because they need to do subjective case-by-case decisions whether a plugin actually "fits".

So I put up this draft for plugin criteria to get the discussion going. It is an opinionated crude first draft and probably misses a lot of things. But maybe it helps nevertheless. Let me know what you think.

cc @garethr because you wanted to tune in

Signed-off-by: Cornelius Weig <[email protected]>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 19, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 19, 2019
@ahmetb
Copy link
Member

ahmetb commented May 20, 2019

Thanks for taking charge here. We definitely need this document, so this is gonna be a long PR.

Styling-wise: I feel like if you can put the Guidances right next to the situations (maybe markdown table, maybe just a sub-bullet point) it would be easier to read and leave review-comments.

Signed-off-by: Cornelius Weig <[email protected]>
@corneliusweig
Copy link
Contributor Author

Yeah, that looks so much nicer. Have you discussed about the plugin criteria during KubeCon?

Copy link

@garethr garethr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for kicking the conversation off. I had a good conversation at KubeCon about plugins with @ahmetb too.

Left some inline comments.

I think the main observation is to make it clear about what the criteria are for. The title says "Krew plugin" but I don't think this is defined anywhere explicitly. This should make a clear distinction between the Krew index or Krew plugins and the open Kubectl plugins.

I'd also suggestion merging this with the Naming guide, as really the naming guide is probably a subset of these criteria.


Krew is a `kubectl` plugin manager.

A plugin provides a technical solution to at least one _task_ concerning a problem around kubernetes.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first paragraph (above) is talking about Krew. This paragraph jumps to talking about "A plugin", by which I take it to mean "A kubectl plugin". The description is then very opinionated.

I think it's fine to have strong opinions about what goes in the Krew index. I don't think it's OK to try and generalise that to the open plugin system that kubectl has. Anyone can create any plugin for kubectl that they want, simply by giving it a specific name and putting it on the path. Because of that the Krew index will always be a subset of available Kubectl plugins, which I think is fine.

I'm not sure if you want to define a "Krew plugin", or whether this should read something like "A plugin +in the Krew index+" or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I fully agree. We should make clear that this is about krew plugins only. Can't do it right now, but you're welcome to suggest better wording.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend the following wording:

The centralized Krew plugin index (krew-index repository) holds plugins that are applicable to a broad set of kubectl users.

A plugin in Krew plugin index must add new functionality or enhance the existing functionality in kubectl, or capsulate a common operator/developer workflow for higher productivity.

We don't want to exclude people being creative and trying interesting things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like the approach to argue from the user-basis as opposed to kubectl-centric.

|----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1. | The task is already solved by kubectl. | Mere command wrappers are not acceptable, as those are better covered by shell aliases. However, convenience and productivity improvements are welcome (examples: `konfig`, `change-ns`, `view-secret`) |
| 2. | The task provides a different solution to a problem which is also solved by kubectl. However, the task would be impossible or very hard to reproduce with kubectl alone. Examples: `access-matrix`, `get-all`, `mtail`, `tail` | In general welcome unless it overlaps significantly with other plugins or has a bad usability. |
| 3. | The task addresses a completely different problem than any of the kubectl subcommands, but is clearly focused on k8s. | Gray area. If the task fits well into `kubectl`, it may be accepted (for example `kubectl debug`). |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example of kubectl debug would appear to be against the naming guidelines, in particular "Be Specific". It feels like the Login example provided there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 we rejected several plugins named debug.

A common task they do is: kubectl cp a busybox binary, kubectl exec to install busybox symlinks, then kubectl exec -- sh to drop user to a shell inside the container. Although I think we accepted one named pod-debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I had #135 in mind, but forgot that the agreement was to change the name.
Changed to kubectl debug-pod.

| 2. | The task provides a different solution to a problem which is also solved by kubectl. However, the task would be impossible or very hard to reproduce with kubectl alone. Examples: `access-matrix`, `get-all`, `mtail`, `tail` | In general welcome unless it overlaps significantly with other plugins or has a bad usability. |
| 3. | The task addresses a completely different problem than any of the kubectl subcommands, but is clearly focused on k8s. | Gray area. If the task fits well into `kubectl`, it may be accepted (for example `kubectl debug`). |
| 4. | The task is very dissimilar to common kubectl tasks and is not primarily focused on k8s. However, it can be useful in the k8s ecosystem. | Not acceptable. |
| 5. | The task is very dissimilar to common kubectl tasks and is not focused on k8s. Its general usefulness in the k8s ecosystem is questionable. | Not acceptable. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being arbiters if utility is bound to cause some friction. Usefulness is in the eye of the beholder. Homebrew hacks around this by saying packages have to be maintained by users, not by the original author. The gist being if a user is happy to maintain a package them by definition it's useful. Not saying Krew should follow the same pattern, but having guidelines which say "we decide based on what we think" might cause friction later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that "usefulness" is rather subjective. But I think the krew index does need some form of filtering. Otherwise, where should the line be drawn? If there is no line (like for brew), krew would be come a mere package manager and not a kubectl package manager.
Maybe you have better ideas of what could be reasonable criteria?


Usability
---
Furter required acceptance criteria:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, Furter rather than Further

---
Furter required acceptance criteria:

1. Standard look & feel: Adheres to standard kubectl best practices and in particular uses consistent (abbreviated) flag names. For example: bad `--ns`, good `--namespace` + `-n`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to link to a style guide here to avoid friction and nitpicking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. @ahmetb do you know if such a document exists?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we should probably write a separate "Style Guide for Plugins" document. We could easily fill it up.

@ahmetb
Copy link
Member

ahmetb commented May 28, 2019

Let's not merge all criteria into one document for now, it's harder to litigate all points in one PR.

@ahmetb
Copy link
Member

ahmetb commented May 29, 2019

I am thinking we can check this into krew main repo instead, since this repo ships to every krew client machine, and we already have a docs/ in the main repo.


This task should be classified in one of the categories:

| # | Classification | Recommendation |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: (hope you won't hate me for saying this) I think if we actually do this part as an HTML table, we can also do 80-char word wrap and maintain this more easily:

<table>
<thead>
<tr>
<td>column</td>
<td>column</td>
</tr>
</thead>
<tbody>
<tr>
<td>column</td>
<td>column</td>
</tr>
</tbody>
</table>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think this is absolutely necessary. Will do.

| # | Classification | Recommendation |
|----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1. | The task is already solved by kubectl. | Mere command wrappers are not acceptable, as those are better covered by shell aliases. However, convenience and productivity improvements are welcome (examples: `konfig`, `change-ns`, `view-secret`) |
| 2. | The task provides a different solution to a problem which is also solved by kubectl. However, the task would be impossible or very hard to reproduce with kubectl alone. Examples: `access-matrix`, `get-all`, `mtail`, `tail` | In general welcome unless it overlaps significantly with other plugins or has a bad usability. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can give detailed examples. Take this sentence:

For example:

  • tail plugin allows tailing logs from pods from a label selector, a namespace or all namespaces at once, whereas kubectl logs command has more limited functionality.
  • get-all plugin is a replacement for kubectl get all command which actually fetches only a subset of API resource types.

@corneliusweig
Copy link
Contributor Author

Let's not merge all criteria into one document for now, it's harder to litigate all points in one PR.

Are you referring to the idea to merge this with the naming guide?

Argue user-centric instead of kubectl-centric.

Signed-off-by: Cornelius Weig <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 29, 2019
@ahmetb
Copy link
Member

ahmetb commented May 30, 2019

Thanks for doing the html migration, looks like we need to use full html i.e. <code> once we go html tables.

I want to capture an additional criteria about plugins being more broadly usable to most Kubernetes users, but this is hard to measure and evaluate.

  • For example, oidc-login plugin is a nice plugin because there are many clusters using OIDC for authentication. [citation needed] So it's nice to have.
  • On the other hand, if we had a plugin like rancher-dashboard that launches Rancher’s UI (and submitted by Rancher), then we're looking at a plugin applicable to a small % of the users [citation needed] –––and we can't measure whether people using OIDC for authentication VS clusters managed by Rancher are more.

One of them feels right, where the other one doesn’t, and this is hard to measure.

@corneliusweig
Copy link
Contributor Author

In the end, what you suggest always boils down to: how large is the userbase for setup XY. But even if we come up with an agreement what should be the acceptable number of users, how would we measure that in practice?

Hence, I'm more with @garethr here who brought up the brew philosophy: if somebody maintains it, it's fine. (Of course it still needs to match the other to-be-determined criteria).

What I could imagine to work is a whitelist of well-known k8s projects for which plugins may be submitted. For example: knative, istio, linkerd, tekton, jenkins-x, rook.io, and so on. Of course such a list needs to be curated and be kept up to date. By default, all incubating CNCF projects should be on that list too.

Copy link
Member

@ahmetb ahmetb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is mostly good.
It would be great to get this in the plugin authoring/review path so that we can start talking more about krew in kubectl official docs.

doc/plugin-criteria.md Outdated Show resolved Hide resolved
</tr>
<tr>
<td>3.</td>
<td>The task addresses a completely different problem than any of the kubectl subcommands, but is clearly focused on k8s.</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an indicator of this is:

Most users will use this tool as a kubectl plugin.

If this is the case, then it's probably more suitable. e.g. in case of helm vs kubectl helm, there's no need to make it a plugin, because it doesn't add anything to kubectl.

Worth adding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added that to the recommendation column. Was that what you intended?


Usability
---
Further required acceptance criteria:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should relax this part a bit, and maybe make it optional to not to limit creativity too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you meant to not talk about "required" criteria?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant we should just remove the language that makes it "required". We can still list best practices, or develop a separate style guide.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, makes sense.

doc/plugin-criteria.md Outdated Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: corneliusweig

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2019
@corneliusweig
Copy link
Contributor Author

@ahmetb I've added another recommendation to consider genericclioptions for plugins in go. Can you take another look?

@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.

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 Nov 16, 2019
@corneliusweig
Copy link
Contributor Author

@ahmetb @ferhatelmas WDYT, should we give this another try or should I close this?

@ahmetb
Copy link
Member

ahmetb commented Nov 17, 2019

/remove-lifecycle stale
/lifecycle frozen

Let’s keep it open. Looks like we are gaining better confidence over time. We can take it in at some point.

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 17, 2019
@k8s-triage-robot
Copy link

The lifecycle/frozen label can not be applied to PRs.

This bot removes lifecycle/frozen from PRs because:

  • Commenting /lifecycle frozen on a PR has not worked since March 2021
  • PRs that remain open for >150 days are unlikely to be easily rebased

You can:

  • Rebase this PR and attempt to get it merged
  • Close this PR with /close

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

/remove-lifecycle frozen

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Aug 17, 2021
@k8s-triage-robot
Copy link

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/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:

  • 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

@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 Nov 15, 2021
@k8s-triage-robot
Copy link

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:

  • 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

@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 Dec 15, 2021
@k8s-triage-robot
Copy link

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

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

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

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/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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants