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

Failing to run the operator-service in Kubernetes #85

Open
MehdiKallel opened this issue Nov 15, 2023 · 3 comments
Open

Failing to run the operator-service in Kubernetes #85

MehdiKallel opened this issue Nov 15, 2023 · 3 comments
Labels
Type: Bug Something isn't working

Comments

@MehdiKallel
Copy link

Hello,
I am trying to run the operator-service in my kubernetes environment but get the following error logs in container:
"/operator-service/docker-entrypoint.sh: line 4: can't create /operator-service/config.ini: Permission denied"
"TypeError: argument of type 'NoneType' is not iterable"
You can see the error in the attached screenshot. My container doesn't have root privileges so any suggestion would be appreciated to fix both errors. Thanks!
Unbenannt

@MehdiKallel MehdiKallel added the Type: Bug Something isn't working label Nov 15, 2023
@LoznianuAnamaria
Copy link

That's an interesting error... @alexcos20 why do you think this is happening?

@LoznianuAnamaria
Copy link

Hi, I just discussed this with the team and got more info. Your problem is mainly caused by the fact that you don't have root permissions. This is something we have on the roadmap but it's for the beginning of the next year. Thanks for opening this and let us know if we can support with anything else

@MehdiKallel
Copy link
Author

Hello @AnaLoznianu,

thanks for the update.

I managed to resolve this issue by dowing the following:

  • Modifying the Dockerfile: First, I updated the Dockerfile to include commands for creating a dedicated user and group for the service and set them as the owners of the /operator-service directory.
    RUN groupadd -r operatorgroup && \ useradd -r -g operatorgroup operatoruser && \ chown -R operatoruser:operatorgroup /operator-service

  • Updating the Kubernetes Deployment YAML: I added a security context.
    securityContext: runAsUser: <UID_of_operatoruser> runAsGroup: <GID_of_operatorgroup>

Now my operator api container logs look as follow:
image

I was able to initiliaze the database using this endpoint "/api/v1/operator/pgsqlinit".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants