steveteuber / kubectl-graph

A kubectl plugin to visualize Kubernetes resources and relationships.
Apache License 2.0
588 stars 29 forks source link

Add kubectl-graph to krew-index #1

Closed ishantanu closed 4 years ago

ishantanu commented 4 years ago

Hi 👋

Maintainer of the awesome-kubectl-plugins here. I recently discovered this kubectl plugin and I was curious if you would like to make this available to a larger userbase via krew.

The reference issue for adding this plugin to krew via krew-index is https://github.com/kubernetes-sigs/krew-index/issues/503. The plugins added to krew-index are available to install via krew CLI.

steveteuber commented 4 years ago

Hi @ishantanu,

Thank you for opening the #1 "issue". This repository is not even a week old ;-) And yes, I would like to make this plugin available via krew.

But first I need to create a fully working kubectl plugin. When everything works as expected, then I create a release and add it to the krew-index.

ishantanu commented 4 years ago

Sure, no problem. Looking forward to trying this plugin when it's ready. 🙂

corneliusweig commented 4 years ago

Hey @steveteuber, what's the status on your project? Is it ready for krew?

steveteuber commented 4 years ago

Hey @corneliusweig,

Thanks for asking. Last weekend I had a first look at goreleaser and its working like a sharm. After the virtual #KubeCon I want to take a look into krew so we can finally close the issues #1 and https://github.com/kubernetes-sigs/krew-index/issues/503.

jmorcar commented 4 years ago

Hi @steveteuber , How to install/use this plugin without Krew tool? I would like to test your plugin but I don't want install another tool too. Thanks!!

steveteuber commented 4 years ago

Hi @jmorcar,

To install this plugin without krew, simply download a release and move the executable file kubectl-graph to anywhere on your PATH. Then you can check if the plugin listed under available plugins:

$ kubectl plugin list
The following compatible plugins are available:

/usr/local/bin/kubectl-graph
...
jmorcar commented 4 years ago

To visualize via cypher format What requirements I need?

I have checked these:

docker run --detach -p 7687:7687 -e NEO4J_AUTH=none neo4j:3.0

steveteuber commented 4 years ago

Sorry, I don't have any experience with running a local Neo4j database via docker. I prefer to use the Neo4j Desktop.app installed via brew cask install neo4j.

steveteuber commented 4 years ago

Hey @jmorcar,

I had a short look into running a Neo4j database via docker. If you also open the HTTP port (7474), everything is working as expected:

$ docker run --rm -d -p 7474:7474 -p 7687:7687 -e NEO4J_AUTH=none neo4j:4.1
9db959349bf905408ef4a088fe330bae6ac857c0ae879fd30022636260a19a53

After the container is up and running the Neo4j Browser interface is available at http://localhost:7474/browser/. Then you can start to visualize your Kubernetes resources:

kubectl graph pods --all-namespaces -o cypher | cypher-shell
corneliusweig commented 4 years ago

Maybe you can also bring up Neo4j in the kubernetes cluster itself. This would be really nice, because kubectl-graph would then be self-contained and only have kubectl + k8s cluster as a dependency. WDYT?

steveteuber commented 4 years ago

@corneliusweig I think that sounds like a great idea. I will take a look into it!

But first things first, here is the pull request to add kubectl-graph to the krew-index: https://github.com/kubernetes-sigs/krew-index/pull/773

steveteuber commented 4 years ago

The plugin is available via krew, so I will close this issue.

$ kubectl krew search graph
NAME   DESCRIPTION                                        INSTALLED
graph  Visualize Kubernetes resources and relationships.  yes