Skip to content

Latest commit

History

History
78 lines (53 loc) 路 2.7 KB

NAMING_GUIDE.md

File metadata and controls

78 lines (53 loc) 路 2.7 KB

Plugin Naming Style Guide

This document explain the best practices and recommendations for naming kubectl plugins. These guidelines are used for reviewing the plugins submitted to krew-index repository.

Punctuation

Plugin names must be all lowercase and separate words with hyphens. Don't use camelCase, PascalCase, or snake_case; use kebab-case.

  • DON'T: kubectl plugin OpenSvc
    DO: kubectl plugin open-svc

Be specific

Plugin names should not be verbs/nouns that are generic, already overloaded, or possibly can be used for broader purposes by another plugin.

  • DON'T: kubectl plugin login: Tries to put dibs on the word.
    DO: kubectl plugin gke-login.

  • DON'T: kubectl plugin ui: Should be used only for Kubernetes Dashboard.
    DO: kubectl plugin gke-ui.

Be unique

Try to find a unique name for your plugin that differentiates you from other possible plugins doing the same job.

  • DON'T: kubectl plugin logs: Unclear how it is different than the builtin "logs" command, or many other tools for viewing logs.
    DO: kubectl plugin multilogs: Unique name, points to the underlying tool name.

Use Verbs/Resource Types

If the name does not make it clear (a) what verb the plugin is doing on a resource, or (b) what kind of resource it's doing the action on, consider clarifying unless it is obvious.

  • DON'T: kubectl plugin service: Unclear what this plugin is doing with service.
    DON'T: kubectl plugin open: Unclear what it is opening.
    DO: kubectl plugin open-svc: It is clear the plugin will open a service.

Prefix Vendor Identifiers

Use the vendor-specific strings as prefix, separated with a dash. This makes it easier to search/group plugins that are about a specific vendor.

  • DON'T: kubectl plugin ui-gke: Makes it harder to search or locate in a plugin list.
    DO: kubectl plugin gke-ui: Will show up next to other gke-* plugins.

Avoid repeating kube[rnetes]

Plugin names should not repeat kube- or kubernetes- prefixes to avoid stuttering.

  • DON'T: kubectl plugin kube-node-admin: "kubectl " already has "kube" in it.
    DO: kubectl plugin node-admin.

Avoid Resource Acronyms

Using kubectl acronyms for API resources (e.g. svc, ing, deploy, cm) reduces readability and discoverability of a plugin more than it is saving keystrokes.

  • DON'T: kubectl plugin new-ing: Hard to spot and the plugin is for Ingress.
    DO: kubectl plugin debug-ingress.

If you have suggestions to this guide, open an issue or send a pull request.