@@ -6,9 +6,8 @@ plugins, read the [User Guide](./USER_GUIDE.md) to learn how to use krew.
66This guide explains how to package, test, run plugins locally and make them
77available on the krew index.
88
9- <!-- TOC -->
9+ <!-- TOC depthFrom:2 -->
1010
11- - [ Developer Guide] ( #developer-guide )
1211- [ Developing a Plugin] ( #developing-a-plugin )
1312 - [ Packaging plugins for krew] ( #packaging-plugins-for-krew )
1413 - [ Writing a plugin manifest] ( #writing-a-plugin-manifest )
@@ -23,7 +22,7 @@ available on the krew index.
2322
2423<!-- /TOC -->
2524
26- # Developing a Plugin
25+ ## Developing a Plugin
2726
2827Before creating a plugin, read the [ Kubernetes Plugins documentation] [ plugins ] .
2928
@@ -51,8 +50,7 @@ should be able to call it like:
5150
5251 kubectl foo
5352
54-
55- ## Packaging plugins for krew
53+ ### Packaging plugins for krew
5654
5755To make a plugin installable via krew, you need to:
5856
@@ -67,7 +65,7 @@ is recommended.
6765It is also possible to get the latest release for a GitHub repository from the
6866URL: ` https://github.com/<user>/<project>/archive/master.zip ` .
6967
70- ## Writing a plugin manifest
68+ ### Writing a plugin manifest
7169
7270Each krew plugin has a "plugin manifest" file that lives in the [ krew index
7371repository] [ krew ] .
@@ -108,7 +106,7 @@ spec:
108106 description and example usages.
109107` ` `
110108
111- ### Specifying platform-specific instructions
109+ #### Specifying platform-specific instructions
112110
113111krew makes it possible to install the same plugin on different operating systems
114112(like ` windows`, `darwin` (macOS), and `linux`) and different architectures
@@ -150,7 +148,7 @@ architectures using the keys `os` and `arch` respectively.
150148The possible values for `os` and `arch` come from the Go runtime. Run
151149` go tool dist list` to see all possible platforms and architectures.
152150
153- # ## Specifying files to install
151+ # ### Specifying files to install
154152
155153Each operating system may require a different set of files from the archive to
156154be installed. You can use the `files` field in the plugin manifest to specify
@@ -182,12 +180,13 @@ this:
182180` ` `
183181
184182The resulting installation directory would up just with :
185- ` ` `
183+
184+ ` ` ` text
186185.
187186└── krew-foo-windows.exe
188187` ` `
189188
190- # ## Specifying plugin executable
189+ # ### Specifying plugin executable
191190
192191Each `platform` field requires a path to the plugin executable in the plugin's
193192installation directory.
@@ -215,7 +214,7 @@ plugin name.
215214> For example, if your is named `view-logs` and your plugin binary is named
216215> `run.sh`, krew will create a symbolic named `kubectl-view_logs` automatically.
217216
218- # ## Specifying a plugin download URL
217+ # ### Specifying a plugin download URL
219218
220219krew plugins must be packaged as `.zip` or `.tar.gz` archives and should be made
221220available to download publicly.
@@ -233,16 +232,15 @@ Downloading from a versioned URL requires fields:
233232- `uri` : URL to the archive file (`.zip` or `.tar.gz`)
234233- `sha256` : sha256 sum of the archive file
235234
236-
237235Specifying `head` field makes it possible to install a file without verifying
238236its checksum. If you are downloading from `master` branch of a GitHub
239237repository, this can be useful. Users can install a plugin using the `head`
240238with :
241239
242240 kubectl krew install --HEAD <PLUGIN>
243241
244- It is possible to specify only the `head`, as well as alongside `uri` and `sha256`. In
245- this case, the `uri` and `sha256` fields will be used by default :
242+ It is possible to specify only the `head`, as well as alongside `uri` and
243+ `sha256`. In this case, the `uri` and `sha256` fields will be used by default :
246244
247245` ` ` yaml
248246 platforms:
@@ -252,9 +250,10 @@ this case, the `uri` and `sha256` fields will be used by default:
252250 ...
253251` ` `
254252
255- # Installing Plugins Locally
253+ # # Installing Plugins Locally
256254
257255After you have :
256+
258257- written your `<PLUGIN>.yaml`
259258- archived your plugin into a `.zip` or `.tar.gz` file
260259
@@ -286,9 +285,9 @@ if you're on a Linux machine, you can test Windows installation with:
286285
287286After you have tested your plugin, remove it with `kubectl krew remove foo`.
288287
289- # Publishing Plugins
288+ # # Publishing Plugins
290289
291- # # Submitting a plugin to krew
290+ # ## Submitting a plugin to krew
292291
293292After you have tested that the plugin can be installed and works you should
294293create a pull request to the [Krew Index][index] with your `<PLUGIN>.yaml`
@@ -303,7 +302,7 @@ available for all users.
303302Please make sure to include dependencies of your plugin and extra configuration
304303needed to run the plugin in the `caveats:` field.
305304
306- # # Updating existing plugins
305+ # ## Updating existing plugins
307306
308307When you have a newer version of your plugin, create a new pull request that
309308updates `uri` and `sha256` fields of the plugin manifest file.
0 commit comments