camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Test and document how to use the kamel cmd as a kubectl plugin

Open astefanutti opened this issue 5 years ago • 11 comments

See https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/

astefanutti avatar Feb 20 '19 15:02 astefanutti

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Apr 01 '22 00:04 github-actions[bot]

Is this issue being assigned to someone? @astefanutti , If not could you assign this to me

Komal7209 avatar Apr 17 '22 14:04 Komal7209

Hi @astefanutti Could you give me link to some other document according to which I need to document all the things which are mentioned in above document or is there some template for the same?

Komal7209 avatar Apr 17 '22 14:04 Komal7209

I think you can make some example similar to what is done in the example directory. As a structure, have a look for instance at this example: https://github.com/apache/camel-k/tree/main/examples/kamelets/error-handler - you can make a step by step sort of tutorial to show some basic usage.

squakez avatar Apr 18 '22 09:04 squakez

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.

You can also discover and install kubectl plugins available in the open source using Krew. Krew is a plugin manager maintained by the Kubernetes SIG CLI community.

https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/#installing-kubectl-plugins

Do we already have such a binary? git grep kubectl-camel and the krew-index show nothing.

tdiesler avatar Apr 18 '24 08:04 tdiesler

Probably the goal of the issue was to create and document it. I am not aware of such a plugin either.

squakez avatar Apr 18 '24 09:04 squakez

Ok, let me take care of that - it seems a good task to get in touch with many things.

I can see two possible approaches ...

  1. Plugin is a thin wrapper and calls an already existing kamel binary
  2. Plugin is a standalone binary that delegates to pkg/cmd and possibly other API

The first approach is cheap, but would require an external dependency. The second approach opens a new distribution channel (i.e. kubectl krew install camel) and gives the stuff that we have already more visibility. The plugin would inherently share the same lifecycle as camel-k

I'd prefer the second approach

tdiesler avatar Apr 18 '24 09:04 tdiesler

Mind that the CLI is meant to disappear any time soon and we've limited the development to bug fix only. Any CLI related effort has to be done on Camel JBang side. Please check with @christophd if/how it would be possible to join the effort toward that project.

squakez avatar Apr 18 '24 09:04 squakez

Will do

tdiesler avatar Apr 18 '24 09:04 tdiesler

I would look like this ... Screenshot 2024-04-19 at 17 45 21 https://github.com/tdiesler/camel-k/tree/ghi471

tdiesler avatar Apr 19 '24 15:04 tdiesler

@tdiesler but this would still use kamel CLI. Given the effort we're moving everything to camel (jbang) I'd strongly encourage to make any development targeting such a CLI instead.

squakez avatar Apr 22 '24 06:04 squakez