[K8s] Run default runtime image as non-root user (uid 1000)#1469
Open
mskuratowski wants to merge 1 commit into
Open
[K8s] Run default runtime image as non-root user (uid 1000)#1469mskuratowski wants to merge 1 commit into
mskuratowski wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1463 - completes the runtime-image side of the security context work.
What
runtime/kubernetes/Dockerfileand the auto-builtDOCKERFILE_DEFAULTnow create alithopsuser (uid/gid 1000) and end withUSER 1000:1000.docs/source/compute_config/kubernetes.mdworks directly with the bundled and auto-built images — no custom rebuild needed.PIP_CONSTRAINT=setuptools<81so legacy sdists that importpkg_resources(e.g.ibm-cos-sdkfamily, which only ships sdist) still build under setuptools 81+.Why
The PSS Restricted recipe added in #1463 currently requires users to fork the runtime image to add a non-root
USERdirective. Doing it upstream removes that step. uid 1000 matches the docs example.Verified locally on macOS arm64 / Rancher Desktop:
lithops runtime build -b k8s -f runtime/kubernetes/Dockerfile <user>/img:tagsucceeds. Previously failed atpkg_resourcesimport while buildingibm-cos-sdksdists in the PEP 517 build env.lithops runtime deployandlithops hello -b k8s -s miniopass; meta and worker pods run under uid 1000.lithops hellowithpod_security_context: {runAsNonRoot: true, runAsUser: 1000, runAsGroup: 1000, seccompProfile: {type: RuntimeDefault}}. Pods start under PSS Restricted constraints and the function returns successfully.Developer's Certificate of Origin 1.1