-
Notifications
You must be signed in to change notification settings - Fork 7
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
The username (string) should be admitted in AppDefinition for container creation #43
Comments
The UID to use can be set via the AppDefinition: https://github.com/eclipsesource/theia-cloud-helm/blob/2c7fe9eb083c4223fafafea1967df3924a4d5088/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml#L41 Since you specify your docker image there as well you can align the UID with the user that works for your image. The reason why we don't use the name but the id is because the value is used to configure the pod's security context on kubernetes side: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podsecuritycontext-v1-core This asks for an integer |
According to the docs in your link:
So it could be left unspecified and it would always start as the user specified in the workspace image. This is even more straightforward as specifying the username in the AppDefinition. Note that also runAsGroup should be left empty in this case. To enforce good practices and check for non-root containers, the parameter runAsNonRoot could be added.
|
So, my proposal would be:
|
Our current convention is to also use the |
It should be possible to start containers with a username as string instead of user id (integer).
See:
https://github.com/eclipsesource/theia-cloud-helm/blob/2c7fe9eb083c4223fafafea1967df3924a4d5088/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml#L42C19-L42C32
In some cases, (theia) images are created with e.g.
RUN adduser theia
, leaving the responsibility of assigning a UID to the underlying OS. Although uncommon, it could also be the case that this is not the first user that is created. So, the Custom Resource should accept the username as parameter to create the resources.I have had the case where user 'theia' was assigned the UID 104 during image build for some reason I do not know. And 'messagebus' was UID 101. Theia Cloud initiated the workspace with uid ('messagebus'), but the workspace owner was 'theia'. As a user, it was impossible to modify any file in the workspace due to "Permission denied". The workaround is to force selection of UID 101 in the workspace dockerfile by using
RUN adduser --system --uid 101 --group theia
, because passing the username 'theia' to Theia Cloud is currently not possible.The text was updated successfully, but these errors were encountered: