1Panel-dev / webkubectl

Run kubectl command in Web Browser.
Apache License 2.0
854 stars 117 forks source link

how to use this with OpenShift #26

Closed jainpratik163 closed 1 year ago

jainpratik163 commented 2 years ago

we have many openshift clusters and we want to give this tool to people who wish to run some kubectl command from the backend how we can do this. we don't want to create a config file for all users. and how we can also implement security.

liqiang-fit2cloud commented 2 years ago

Hi Jain,

we have many openshift clusters and we want to give this tool to people who wish to run some kubectl command from the backend how we can do this

I think this is the best choice for you, see advantages You can do it like this. image

we don't want to create a config file for all users.

Not sure what you mean. Every user can manage his own config files in this tool and they are invisible to each others. But if you wish users to have different privileges, you have to create different ServiceAccount.

how we can also implement security.

Security is fully considered in webkubectl, like session isolation and basic authentication

jainpratik163 commented 2 years ago

thanks, @liqiang-fit2cloud for the reply. in Openshift we use to get out own API tokens and with that token, we can also login from the backend, so in the same way, we can also login into this webkubectl ?

oc login --token= --server=

liqiang-fit2cloud commented 2 years ago

Never tried but I think the token and server of oc is valid to webkubectl. image But kubectl is only used with standard Kubernetes API and resources in OpenShift. See https://docs.openshift.com/container-platform/3.11/cli_reference/differences_oc_kubectl.html

jainpratik163 commented 2 years ago

ok, I will try.

jainpratik163 commented 2 years ago

thanks, it is working fine with the token. and if we want to add oc client into the docker image we can add it?

liqiang-fit2cloud commented 2 years ago

you can try, I suppose it works fine.

jainpratik163 commented 2 years ago

i tried to create new docker images with oc client add but getting the below error anything extra we also need to do ?

bash-5.1# which oc /usr/bin/oc bash-5.1# ls -lrt /usr/bin/oc -rwxrwxrwx 1 root root 72461736 Aug 23 05:05 /usr/bin/oc bash-5.1# oc bash: /usr/bin/oc: No such file or directory bash-5.1#

liqiang-fit2cloud commented 2 years ago

Seems oc cli requires glibc, you have to change base image. https://github.com/openshift/origin/issues/11135

jainpratik163 commented 2 years ago

i will try this but can we also include this oc client in same docker Image?

liqiang-fit2cloud commented 2 years ago

Sorry we have no plan to support oc cli.