update the conf to avoid perm issues in openshift#1860
Merged
dinogun merged 2 commits intokruize:mvp_demofrom Apr 7, 2026
Merged
update the conf to avoid perm issues in openshift#1860dinogun merged 2 commits intokruize:mvp_demofrom
dinogun merged 2 commits intokruize:mvp_demofrom
Conversation
Signed-off-by: bharathappali <abharath@redhat.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the embedded NGINX configuration in the OpenShift manifest so that PID and temp file paths use writable locations under /tmp, avoiding permission issues under restricted UIDs. Flow diagram for container startup before and after NGINX path changegraph TD
Start[Container_startup] --> LoadConfig[Load_nginx.conf]
LoadConfig --> CheckPaths[Check_PID_and_temp_paths]
CheckPaths --> Before[Old_paths_/run_and_/var/cache/nginx]
CheckPaths --> After[New_paths_under_/tmp]
Before --> PermissionDenied[Filesystem_permission_denied]
PermissionDenied --> Crash[Container_crash_on_startup]
After --> WritablePaths[Writable_paths_for_random_UID]
WritablePaths --> NginxStarts[NGINX_starts_successfully]
NginxStarts --> Ready[Pod_ready]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- NGINX will not create the temp directories (
/tmp/client_temp,/tmp/proxy_temp, etc.) automatically, so ensure the pod spec (e.g., an initContainer or startup command) creates these directories with the correct permissions, otherwise startup may still fail withNo such file or directoryerrors. - Since the PID file path is now non-default (
/tmp/nginx.pid), double-check that any control/health scripts or sidecars that might sendnginx -ssignals or read the PID file are either not used in this manifest or are updated to reference the new location.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- NGINX will not create the temp directories (`/tmp/client_temp`, `/tmp/proxy_temp`, etc.) automatically, so ensure the pod spec (e.g., an initContainer or startup command) creates these directories with the correct permissions, otherwise startup may still fail with `No such file or directory` errors.
- Since the PID file path is now non-default (`/tmp/nginx.pid`), double-check that any control/health scripts or sidecars that might send `nginx -s` signals or read the PID file are either not used in this manifest or are updated to reference the new location.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Signed-off-by: bharathappali <abharath@redhat.com>
shreyabiradar07
approved these changes
Apr 1, 2026
Contributor
shreyabiradar07
left a comment
There was a problem hiding this comment.
LGTM, verified the changes on OpenShift
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.
Description
This change updates the NGINX configuration to ensure compatibility with OpenShift’s restricted security model. In OpenShift, containers do not run as a fixed user like
nginxbut instead use a randomly assigned non-root UID. As a result, default NGINX paths such as/var/cache/nginxand/run/nginx.pid, which are typically owned by root, are not writable at runtime. This leads to permission denied errors and causes the container to crash during startup.To address this, the NGINX PID file location has been explicitly moved from its default path (
/run/nginx.pid) to/tmp/nginx.pid. The/tmpdirectory is universally writable inside containers, regardless of the runtime UID assigned by OpenShift, making it a safe location for runtime-generated files like PID files.In addition, all temporary file paths used by NGINX (such as
client_body_temp_path,proxy_temp_path, and others) have been redirected from/var/cache/nginxto subdirectories under/tmp. This ensures that NGINX can successfully create and manage temporary files required for request processing without encountering filesystem permission issues.These changes do not alter application functionality but instead adapt the runtime behavior of NGINX to align with OpenShift’s security constraints. By avoiding reliance on root-owned filesystem paths, the container can run successfully under the default restricted security context without requiring elevated privileges or custom security policies.
Overall, this update improves portability and robustness of the deployment, ensuring that the UI service runs reliably in OpenShift environments while adhering to container security best practices.
Fixes #1859
Type of change
How has this been tested?
Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.
Test Configuration
Checklist 🎯
Additional information
Include any additional information such as links, test results, screenshots here
Summary by Sourcery
Update NGINX configuration to use writable temporary directories for runtime files to ensure compatibility with OpenShift security constraints.
Bug Fixes: