Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subctl as kubectl plugin #182

Closed
8 tasks done
Jaanki opened this issue Apr 25, 2023 · 1 comment · Fixed by #195
Closed
8 tasks done

Add subctl as kubectl plugin #182

Jaanki opened this issue Apr 25, 2023 · 1 comment · Fixed by #195
Assignees
Labels

Comments

@Jaanki
Copy link
Contributor

Jaanki commented Apr 25, 2023

A plugin is a standalone executable file, whose name begins with kubectl-. To install a plugin, move its executable file to anywhere on your PATH.

kubectl provides a command kubectl plugin list that searches your PATH for valid plugin executables.

More information can be found on extending kubectl with plugins page.

You can also discover and install kubectl plugins available in the open source using Krew. Krew works across all major platforms, like macOS, Linux and Windows.

On the surface, installing a kubectl plugin seems simple enough – all you need to do is to place an executable in the user’s PATH prefixed with kubectl- – that you may be considering some other alternatives to Krew, such as:

  1. Having the user manually download the plugin executable and move it to some directory in the PATH
  2. Distributing the plugin executable using an OS package manager, like Homebrew (macOS), apt/yum (Linux), or Chocolatey (Windows)
  3. Distributing the plugin executable using a language package manager (e.g. npm or go get)

While these approaches are not necessarily unworkable, potential drawbacks to consider include:

  1. How to get updates to users (in the case of manual installation)
  2. How to package a plugin for multiple platforms (macOS, Linux, and Windows)
  3. How to ensure your users have the appropriate language package manager (go, npm)
  4. How to handle a change to the implementation language (e.g. a move from npm to another package manager)

Krew solves these problems cleanly for all kubectl plugins, since it’s designed specifically to address these shortcomings. With Krew, after you write a plugin manifest once your plugin can be installed on all platforms without having to deal with their package managers.

Action items:

Once this is done, users would be able to install subctl via krew. Few of krew command examples are:
kubectl krew install subctl
kubectl krew upgrade subctl

None of the existing subctl command's behaviour will change except that they would need to be prefixed by kubectl.

$ kubectl subctl --help
An installer for Submariner

Usage:
  subctl [command]

Available Commands:
  benchmark           Benchmark tests
  cloud               Cloud operations
  completion          Generate the autocompletion script for the specified shell
  deploy-broker       Deploys the broker
  diagnose            Run diagnostic checks on the Submariner deployment and report any issues
  export              Exports a resource to other clusters
  gather              Gather troubleshooting information from a cluster
  help                Help about any command
  join                Connect a cluster to an existing broker
  recover-broker-info Recovers the broker-info.subm file from the installed Broker
  show                Show information about Submariner
  unexport            Stop a resource from being exported to other clusters
  uninstall           Uninstall Submariner and its components
  upgrade             Upgrades Submariner
  verify              Run verifications between two clusters
  version             Get version information on subctl

Flags:
  -h, --help   help for subctl

Use "subctl [command] --help" for more information about a command.

This would particularly be need to be done if and when we decide to ship subctl as part of OpenShift CLI manager.

@Jaanki Jaanki added the enhancement New feature or request label Apr 25, 2023
@Jaanki Jaanki self-assigned this May 3, 2023
@maayanf24 maayanf24 moved this to Schedule and Epics in Submariner 0.16 May 3, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue May 8, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue May 9, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue May 15, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue May 15, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue May 26, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue Jun 6, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue Jun 6, 2023
Jaanki added a commit to Jaanki/enhancements that referenced this issue Jun 7, 2023
Jaanki added a commit to Jaanki/subctl that referenced this issue Jun 12, 2023
Add a make target to create checksums for all subctl binaries created
under dist/ directory. Add this new target to `build-cross` target so
that the checksums are generated during the automated release process.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/subctl that referenced this issue Jun 12, 2023
Add a make target to create checksums for all subctl binaries created
under dist/ directory. Add this new target to `build-cross` target so
that the checksums are generated during the automated release process.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to submariner-io/subctl that referenced this issue Jun 15, 2023
Add a make target to create checksums for all subctl binaries created
under dist/ directory. Add this new target to `build-cross` target so
that the checksums are generated during the automated release process.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/subctl that referenced this issue Jun 19, 2023
so that the help can display proper output when subctl is used as a
standalone CLI or as kubectl-plugin.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
sridhargaddam pushed a commit to submariner-io/subctl that referenced this issue Jul 3, 2023
so that the help can display proper output when subctl is used as a
standalone CLI or as kubectl-plugin.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
@skitt skitt closed this as completed in #195 Jul 4, 2023
skitt pushed a commit that referenced this issue Jul 4, 2023
@Jaanki Jaanki reopened this Jul 5, 2023
Jaanki added a commit to Jaanki/subctl that referenced this issue Jul 5, 2023
Currently while building a subctl is binary is named as
`subctl-$version-$arch`. This PR does following changes while creating a
tar of the binary:

1. Rename the binary to just `subctl`. This is one of the requirements
   of Krew.
2. Remove the redundant child directory so that on untar'ing the binary
   is at `subctl-$version-$arch/` path instead of
   `subctl-$version-$arch/subctl-$version`

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/subctl that referenced this issue Jul 5, 2023
Currently while building a subctl is binary is named as
`subctl-$version-$arch`. This PR does following changes while creating a
tar of the binary:

1. Rename the binary to just `subctl`. This is one of the requirements
   of Krew.
2. Remove the redundant child directory so that on untar'ing the binary
   is at `subctl-$version-$arch/` path instead of
   `subctl-$version-$arch/subctl-$version`

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/subctl that referenced this issue Jul 5, 2023
Currently while building a subctl is binary is named as
`subctl-$version-$arch`. This PR does following changes while creating a
tar of the binary:

1. Rename the binary to just `subctl`. This is one of the requirements
   of Krew.
2. Remove the redundant child directory so that on untar'ing the binary
   is at `subctl-$version-$arch/` path instead of
   `subctl-$version-$arch/subctl-$version`

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/get.submariner.io that referenced this issue Jul 17, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
@maayanf24 maayanf24 moved this from Done to Schedule and Epics in Submariner 0.16 Jul 18, 2023
Jaanki added a commit to Jaanki/get.submariner.io that referenced this issue Jul 18, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/get.submariner.io that referenced this issue Jul 18, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Depends on submariner-io/subctl#837

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/subctl that referenced this issue Jul 18, 2023
Currently while building a subctl is binary is named as
`subctl-$version-$arch`. This PR renames the binary to just
`subctl`. This is one of the requirements of Krew.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/get.submariner.io that referenced this issue Jul 19, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Depends on submariner-io/subctl#837

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/get.submariner.io that referenced this issue Jul 19, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Depends on submariner-io/subctl#837

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/get.submariner.io that referenced this issue Jul 19, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Depends on submariner-io/subctl#837

Signed-off-by: Janki Chhatbar <[email protected]>
sridhargaddam pushed a commit to submariner-io/get.submariner.io that referenced this issue Jul 19, 2023
in accordance with submariner-io/subctl#837 changing the
`subctl` binary location.

Epic: submariner-io/enhancements#182

Depends on submariner-io/subctl#837

Signed-off-by: Janki Chhatbar <[email protected]>
tpantelis pushed a commit to submariner-io/subctl that referenced this issue Jul 19, 2023
Currently while building a subctl is binary is named as
`subctl-$version-$arch`. This PR renames the binary to just
`subctl`. This is one of the requirements of Krew.

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
@Jaanki Jaanki moved this from Schedule and Epics to In Progress in Submariner 0.16 Oct 10, 2023
@Jaanki Jaanki moved this from In Progress to Done in Submariner 0.16 Oct 10, 2023
@dfarrell07 dfarrell07 moved this from Todo to In Progress in Submariner 0.17 Oct 24, 2023
Jaanki added a commit to Jaanki/releases that referenced this issue Nov 30, 2023
Now that subctl is available as a krew plugin, a PR needs to be sent to
krew-index repo to update subctl version when a new version is released.
krew-release-bot automates this process by adding a .krew.yaml file and
a GHA to our release process.

This PR adds a GHA that automatically pushes a PR to krew-index repo
updating the subctl version, by rendering .krew.yaml file, after a new
submariner version is tagged.

For detailed read: https://github.com/rajatjindal/krew-release-bot

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/releases that referenced this issue Dec 1, 2023
Now that subctl is available as a krew plugin, a PR needs to be sent to
krew-index repo to update subctl version when a new version is released.
krew-release-bot automates this process by adding a .krew.yaml file and
a GHA to our release process.

This PR adds a GHA that automatically pushes a PR to krew-index repo
updating the subctl version, by rendering .krew.yaml file, after a new
submariner version is tagged.

For detailed read: https://github.com/rajatjindal/krew-release-bot

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
sridhargaddam pushed a commit to submariner-io/releases that referenced this issue Dec 4, 2023
Now that subctl is available as a krew plugin, a PR needs to be sent to
krew-index repo to update subctl version when a new version is released.
krew-release-bot automates this process by adding a .krew.yaml file and
a GHA to our release process.

This PR adds a GHA that automatically pushes a PR to krew-index repo
updating the subctl version, by rendering .krew.yaml file, after a new
submariner version is tagged.

For detailed read: https://github.com/rajatjindal/krew-release-bot

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
@github-actions github-actions bot removed the dependent label Dec 4, 2023
@Jaanki Jaanki closed this as completed Dec 4, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Submariner 0.17 Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants