Testing plugin installation locally
After you have written your plugin manifest
archived your plugin into a
.tar.gz file, you can now test whether
your plugin installs correctly with Krew by running:
$ kubectl krew install --manifest=foo.yaml --archive=foo.tar.gz
--manifest flag specifies a custom manifest rather than picking it up from
the default [krew index][index]
--archive overrides the download
uri: specified in the plugin manifest and
uses a local
.tar.gz file instead.
If the installation fails, run the command again with
-v=4 flag to see the
verbose logs and inspect what went wrong.
If your installation succeeds, you should now be able to run your plugin.
If you made your archive file available to download on the Internet, run the
same command without the
--archive option and actually test downloading the
file from the specified
uri and validate its
sha256 sum is correct.
After you have tested your plugin, uninstall it with
kubectl krew uninstall foo.
Testing other platforms
If you need other
platforms definitions that don’t match your current machine,
you can use
KREW_ARCH environment variables to override what
OS/architecture Krew thinks it’s running on.
For example, if you’re on a Linux machine, you can test Windows installation
$ KREW_OS=windows KREW_ARCH=amd64 krew install --manifest=[...]