+ approval no approvals usefulness and stability no restrictions hosted in kubectl codebase (Go only) any language tied to Kubernetes release cycles release at your own pace has to be consistent with kubectl has room for creativity takes O(months)...O(years) from alpha→beta→stable develop & distribute in O(hours)
kubectl get-all ksort → kubectl sort-manifests ✓ Plugin names are more intuitive ✓ Calling via kubectl looks more natural ✓ You can discover available plugins Why #3: plugin vs standalone
kubectl force-drain ✓ Install these on all your developers’ machines ✓ All scripts are organized under kubectl umbrella for discoverability Why #4: encapsulate workflows
with your plugin executable) Plugin process will: ✓ inherit the environment variables ✓ inherit the standard streams ✓ determine the exit code of the kubectl invocation How plugins work?
-o/--output=[json,yaml,jsonpath,...] ◦ --kubeconfig ◦ idiomatic naming for subcommands and flags ◦ minimal to no docs How to be consistent? git.k8s.io/cli-runtime: set of helpers for creating commands ↬ reading configuration + clients ↬ printing flags + utils ↬ polymorphic helpers Consistency
install plugins • keep them up to date • remove plugins cleanly ...developers to: • make their plugins discoverable by users • package their plugins for multiple platforms so we had to do something... Problem: plugin management
an intern project. Krew simplifies plugin usage and distribution for users and developers. It's a SIG CLI sub-project since April'19. sigs.k8s.io/krew Meet Krew
the latest version • Has a centralized plugin index. ◦ great for discoverability, slower curation, more enforcement ◦ doesn’t come with any security guarantees ◦ soon to allow decentralized repos • Supports Windows, macOS, Linux