From 9bb3acb693ef537c7c4a1de0b554d4957e17a5ba Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sun, 22 Dec 2024 12:07:56 +0100 Subject: [PATCH] feat(krew): add krew manifest to manually setup plugin --- krew/README.md | 11 +++++++++++ krew/ctx.yaml | 35 +++++++++++++++++++++++++++++++++++ krew/ns.yaml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 krew/README.md create mode 100644 krew/ctx.yaml create mode 100644 krew/ns.yaml diff --git a/krew/README.md b/krew/README.md new file mode 100644 index 0000000..35f0a11 --- /dev/null +++ b/krew/README.md @@ -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 +``` + diff --git a/krew/ctx.yaml b/krew/ctx.yaml new file mode 100644 index 0000000..da0ef81 --- /dev/null +++ b/krew/ctx.yaml @@ -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-1 + 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/RouxAntoine/kubectx for customization and details. + platforms: + - selector: + matchExpressions: + - key: os + operator: In + values: + - darwin + - linux + uri: https://github.com/ahmetb/RouxAntoine/archive/v0.9.5-1.tar.gz + sha256: c94392fba8dfc5c8075161246749ef71c18f45da82759084664eb96027970004 + bin: kubectx + files: + - from: kubectx-*/kubectx + to: . + - from: kubectx-*/LICENSE + to: . + - from: kubectx-*/completion/plugins/kubectl_complete-ctx + to: completion + diff --git a/krew/ns.yaml b/krew/ns.yaml new file mode 100644 index 0000000..0a8d8e4 --- /dev/null +++ b/krew/ns.yaml @@ -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-1 + 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/RouxAntoine/kubectx/archive/v0.9.5-1.tar.gz + sha256: c94392fba8dfc5c8075161246749ef71c18f45da82759084664eb96027970004 + bin: kubens + files: + - from: kubectx-*/kubens + to: . + - from: kubectx-*/LICENSE + to: . + - from: kubectx-*/completion/plugins/kubectl_complete-ns + to: completion +