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

Support for startup settings #90

Open
diegosucaria opened this issue May 6, 2020 · 6 comments
Open

Support for startup settings #90

diegosucaria opened this issue May 6, 2020 · 6 comments
Labels

Comments

@diegosucaria
Copy link

Hello! thank you for writing this nice piece of code! it is awesomeee!!!

I know that perhaps it is not supported, but can you point me on what to do to start kubebox with a pod terminal opened?

I'm trying to have a url that you can open in the browser and get a terminal to a certain container without having to select/click/press anything.
If I can disable moving away from that pod, it would be great.

@astefanutti
Copy link
Owner

Thanks a lot for the kind feedback.

Your understanding is correct, it is not currently supported.

If I understand correctly, you're using the Web version. We could rely on a fragment that would identify the view to be open and its parameters.

I really like the idea. Thanks for the suggestion!

@diegosucaria
Copy link
Author

Thanks for considering my idea!

The main goal of this is that I could give another person a shell inside a container, without giving access to the rest of the containers running on the same cluster.

I'm doing some tests myself...
Since it is the first time I read this code and I am not used to working with the elements that this project uses, I found it too difficult to do what I wanted to achieve first....

Instead, I am capping the kubebox pod listing function to the values set by these two variables:
RESTRICT_NAMESPACE="somenamespace"
RESTRICT_CONTAINER_NAME="somecontainernameregex"

That kind of works well, but now I am trying to remove the graphics and display the shell there instead.... still working on it.

Thank you again!

@astefanutti
Copy link
Owner

astefanutti commented May 7, 2020

Ah, it seems it's more about sharing a shell into a container with someone else then.

One idea, would be to use Kubebox as a side-car of the container to share, and rely on the Kubernetes Downward API to inject the namespace and pod information as environment variables automatically: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api. That would be a very cool way to use Kubebox!

Do not hesitate if you need any help on the code. You can even create a draft PR if you think that helps.

@diegosucaria
Copy link
Author

diegosucaria commented May 7, 2020

Yes, that is exactly what I am trying to do...

It could be two things:
1- single shell startup (it could be sidecar or not): just open the shell in the main screen. do not allow exiting or moving away.
2- limited shell use: open kubebox, display the shell instead of graphs, and restrict pod listing to certain namespace and certain pod name or regex.

I managed to start a shell at startup, but it displays over the main screen and exiting the shell returns you to the main screen.

I'm doing some progress with 2-, but I am not being able to focus on the shell:

Untitled

I can do a PR if you want but I've been working "destructively" let's say...

@astefanutti
Copy link
Owner

I need to think a bit more about it, but it seems option 2 could be achieve with Kubernetes RBAC, that is restricting the permissions granted to the service account that's used to run the Kubebox pod. Plus a navigation system, that would rely on the URL fragment for example to jump directly to a particular container shell.

Otherwise, 1 seems interesting to explore, as it could be used as an ephemeral container, that possibly could expose a Web shell, even without talking to the Master API...

@diegosucaria
Copy link
Author

Yes, I couldn't agree more!

I'll keep working on my tests and I'll share a PR if I reach something useful :)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants