krew

module
v0.3.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2019 License: Apache-2.0

README

krew

Build Status Code Coverage Go Report Card LICENSE Releases GitHub stars

krew is the package manager for kubectl plugins.

What is krew?

krew is a tool that makes it easy to use kubectl plugins. krew helps you discover plugins, install and manage them on your machine. It is similar to tools like apt, dnf or brew.

  • For kubectl users: krew helps you find, install and manage kubectl plugins in a consistent way.
  • For plugin developers: krew helps you package and distribute your plugins on multiple platforms and makes them discoverable.

krew is easy to use:

kubectl krew search                 # show all plugins
kubectl krew install view-secret    # install a plugin named "view-secret"
kubectl view-secret                 # use the plugin
kubectl krew upgrade                # upgrade installed plugins
kubectl krew uninstall view-secret  # uninstall a plugin

Read the User Guide for detailed documentation.

Check out the list of kubectl plugins available on krew or just run kubectl krew search to discover plugins available on your OS.

Installation

Warning: krew is only compatible with kubectl v1.12 or higher.

macOS and Linux:

Bash and ZSH
  1. Make sure that git is installed.

  2. Run this command in your terminal to download and install krew:

    (
      set -x; cd "$(mktemp -d)" &&
      curl -fsSLO "https://storage.googleapis.com/krew/v0.2.1/krew.{tar.gz,yaml}" &&
      tar zxvf krew.tar.gz &&
      ./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" install \
        --manifest=krew.yaml --archive=krew.tar.gz
    )
    
  3. Add $HOME/.krew/bin directory to your PATH environment variable. To do this, update your .bashrc or .zshrc file and append the following line:

    export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
    

    and restart your shell.

Fish
  1. Make sure that git is installed.

  2. Run this command in your terminal to download and install krew:

    begin
      set -x; set temp_dir (mktemp -d); cd "$temp_dir" &&
      curl -fsSLO "https://storage.googleapis.com/krew/v0.2.1/krew.{tar.gz,yaml}" &&
      tar zxvf krew.tar.gz &&
      set KREWNAME krew-(uname | tr '[:upper:]' '[:lower:]')_amd64 &&
      ./$KREWNAME install \
        --manifest=krew.yaml --archive=krew.tar.gz &&
      set -e KREWNAME; set -e temp_dir
    end
    
  3. Add $HOME/.krew/bin directory to your PATH environment variable. To do this, update your config.fish file and append the following line:

    set -gx PATH $PATH $HOME/.krew/bin
    

    and restart your shell.

Windows:

  1. Make sure git is installed on your system.

  2. Download krew.zip and krew.yaml from the Releases page.

  3. Extract the krew.zip archive to a directory, navigate to the directory.

  4. Launch a command-line window (cmd.exe) in that directory.

  5. Run the following command to install krew (pass the correct paths to krew.yaml and krew.zip below):

    .\krew-windows_amd64.exe install --manifest=krew.yaml --archive=krew.zip
    
  6. Add %USERPROFILE%\.krew\bin to your PATH environment variable (how?)

Verifying installation

Run kubectl plugin list command to see installed plugins. This command should show kubectl-krew in the results. You can now use kubectl krew command.

Upgrading krew

Since krew itself is installed as a "kubectl plugin" managed by krew, it can be upgraded like a plugin by running the kubectl krew upgrade command.

Documentation

  • Users:
  • Plugin Developers:
  • Krew Developers:

Visit ./docs for all documentation.

Roadmap

Please check out the Issue Tracker to see the plan of record for new features and changes.

Community

Bug reports
  • If you have a problem with the Krew itself, please file an issue in this repository.
  • If you're having a problem with a particular plugin's installation or upgrades, file an issue at krew-index repository.
  • If you're having an issue with an installed plugin, file an issue for the repository the plugin's source code is hosted at.
Communication channels
Contributing

Interested in contributing to Krew? Please refer to our Contributing Guidelines for more details

Code of Conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

Directories

Path Synopsis
cmd
validate-krew-manifest
validate-krew-manifest makes sure a manifest file is valid.
validate-krew-manifest makes sure a manifest file is valid.
pkg
index/validation
Package validation implements functions to validate Krew plugin types.
Package validation implements functions to validate Krew plugin types.
installation/semver
Package semver is a wrapper for handling of semantic version (https://semver.org) values.
Package semver is a wrapper for handling of semantic version (https://semver.org) values.
receiptsmigration
todo(corneliusweig) remove migration code with v0.4
todo(corneliusweig) remove migration code with v0.4
receiptsmigration/oldenvironment
todo(corneliusweig) remove migration code with v0.4 oldenvironment is a copy of the relevant function in environment before the index migration.
todo(corneliusweig) remove migration code with v0.4 oldenvironment is a copy of the relevant function in environment before the index migration.
testutil
Package testutil contains test utilities for krew.
Package testutil contains test utilities for krew.
version
Package version contains the version information of the krew binary.
Package version contains the version information of the krew binary.
site
functions Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL