Skip to content

Commit

Permalink
feat(krew): add krew manifest to manually setup plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
RouxAntoine committed Dec 22, 2024
1 parent a475769 commit 8fb3a1a
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
11 changes: 11 additions & 0 deletions krew/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Setup kubectx and kubens


manually install kubectx and kubens from manifest file
this add autocomplete plugin capabilities

```shell
$ kubectl krew install --manifest=ns.yaml
$ kubectl krew install --manifest=ctx.yaml
```

35 changes: 35 additions & 0 deletions krew/ctx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: ctx
spec:
homepage: https://github.com/ahmetb/kubectx
shortDescription: Switch between contexts in your kubeconfig
version: v0.9.5
description: |
Also known as "kubectx", a utility to switch between context entries in
your kubeconfig file efficiently.
caveats: |
If fzf is installed on your machine, you can interactively choose
between the entries using the arrow keys, or by fuzzy searching
as you type.
See https://github.com/ahmetb/kubectx for customization and details.
platforms:
- selector:
matchExpressions:
- key: os
operator: In
values:
- darwin
- linux
uri: https://github.com/ahmetb/kubectx/archive/v0.9.5.tar.gz
sha256: c94392fba8dfc5c8075161246749ef71c18f45da82759084664eb96027970004
bin: kubectx
files:
- from: kubectx-*/kubectx
to: .
- from: kubectx-*/LICENSE
to: .
- from: kubectx-*/completion/plugins/kubectl_complete-ctx
to: completion

34 changes: 34 additions & 0 deletions krew/ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: ns
spec:
homepage: https://github.com/ahmetb/kubectx
shortDescription: Switch between Kubernetes namespaces
version: v0.9.5
description: |
Also known as "kubens", a utility to set your current namespace and switch
between them.
caveats: |
If fzf is installed on your machine, you can interactively choose
between the entries using the arrow keys, or by fuzzy searching
as you type.
platforms:
- selector:
matchExpressions:
- key: os
operator: In
values:
- darwin
- linux
uri: https://github.com/ahmetb/kubectx/archive/v0.9.5.tar.gz
sha256: c94392fba8dfc5c8075161246749ef71c18f45da82759084664eb96027970004
bin: kubens
files:
- from: kubectx-*/kubens
to: .
- from: kubectx-*/LICENSE
to: .
- from: kubectx-*/completion/plugins/kubectl_complete-ns
to: completion

0 comments on commit 8fb3a1a

Please sign in to comment.