-
Notifications
You must be signed in to change notification settings - Fork 41
Hook into kubectl commandline as extension #28
Comments
First off, @surajssd the issue is very detailed and has all the relevant links, it saved me a lot of time, thanks for that 👍 So, this behavior has no documentation, and reading through various PRs and commits, I figured out that Doing the following on kubectl >= v1.7.0 works - $ cat ~/.kube/plugins/kedge/plugin.yaml
name: "kedge"
shortDesc: "Concise Application Definition for Kubernetes"
command: "./kedge"
$ kubectl plugin kedge
Define Kubernetes applications using Kubernetes constructs
Usage:
kedge [command]
Available Commands:
apply Apply a configuration to a resource on the Kubernetes cluster. This resource will be created if it doesn't exist yet.
create Create the resource on the Kubernetes cluster
delete Delete the resource from the Kubernetes cluster
generate Generate Kubernetes resources from App definition
version Print the version of Kedge
Flags:
-h, --help help for kedge
-v, --verbose verbose output
Use "kedge [command] --help" for more information about a command. But now what? Using kedge as part of a plugin, we can run some scripts before executing the kedge commands and make informed decisions, but we need to decide on the behavior that we want. e.g. -
These are just random examples to give an idea on the sort of behavior we need to define. So, what behavior do we want? ping @kedgeproject/maintainers |
First off: WDYT ? |
@surajssd yeah, I put in generate in there just to try it out. We need to decide on the input that we want from the cluster, parse it and then execute relevant commands. |
Use cases for kubernetes plugin:
If you look at these use-cases most of them are referring to things from other resources, here it becomes easy for user since she does not define bunch of things assuming it will exist in cluster with certain name, and we do checks. |
Let's wait for this to become more stable and figure out the exact use cases for the plugin behavior. Lowering priority and unassigned myself for now. |
We do not have a use case for this, yet. |
kubectl
now has a way to allow any third party binary to hook into it to do advanced stuff. Using this we will have an ability to do conversion which is cluster aware.For e.g. places where someone is referring to a
secret
orconfigMap
we can check if it already exists in the cluster. Here we can also createsecrets
like passwords which is some random string and everyone wanted to use it refer to the same thing.Related discussion around this can be found in this issue redhat-developer/opencompose#161
Another use case could be when someone wants to expose a kubernetes service we could simply look at the cluster and do our best possible thing to expose an app with least information given by user.
Related discussion around this can be found in this comment #22 (comment)
And tons of benefits that we get from being cluster aware as opposed to be a static convertor.
The text was updated successfully, but these errors were encountered: