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

passing service-account flag gives the message there isn't a valid docker environment #105

Open
Daniel-Jacob opened this issue Dec 6, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Daniel-Jacob
Copy link

Daniel-Jacob commented Dec 6, 2024

I am trying to setup kubedock. When i don't pass the service account flag I run into the issue that the basic service account doesn't have privileges to create the pod. When i pass the service account flag in a gitlab pipeline like this:

services:

  • name: some-kubedock-image # --> official image
    command: ["server", "--reverse-proxy", "--service-account my-serviceaccount"]

it throws the exception that no valid docker environment can be found. Docker is not installed on our cluster. We use job to build images and push them to kubernetes.

@joyrex2001
Copy link
Owner

I think the error is in the arguments:
["server", "--reverse-proxy", "--service-account my-serviceaccount"] should be ["server", "--reverse-proxy", "--service-account", "my-serviceaccount"]

@joyrex2001 joyrex2001 added the question Further information is requested label Dec 7, 2024
@Daniel-Jacob
Copy link
Author

I just tried but i am still getting the following exception:

com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"pods is forbidden: User "system:serviceaccount:namespace:default" cannot create resource "pods" in API group "" in the namespace "namespace""}

It doesn't seem to be setting the service account.

@joyrex2001
Copy link
Owner

The service account argument makes sure the pods that are created by kubedock hade the specified service account configured. Your error is about kubedock itself not having the permissions of creating pods. The token kubedock is using, should have the proper rbac as well.

@Daniel-Jacob
Copy link
Author

true, but i see in the logs it is grabbing the default service account and not the one i specified. I have created a service account with the rbac permissions and tied the permissions to the service account.

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

No branches or pull requests

2 participants