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

Run Sample Apps as Non Root #61

Open
danielhelfand opened this issue Aug 13, 2020 · 4 comments
Open

Run Sample Apps as Non Root #61

danielhelfand opened this issue Aug 13, 2020 · 4 comments

Comments

@danielhelfand
Copy link

danielhelfand commented Aug 13, 2020

When testing out the guestbook sample app on a cluster in a restricted environment, the deployment fails due to the guestbook container being run as root. It would be nice to specify a securityContext for the deployment since it should not need privileged permissions.

While this is a sample app, it would be nice to promote the practice of not running containers as root and also help to prevent running into the issue of the Getting Started tutorial not working in certain Kubernetes environments.

@komish
Copy link

komish commented Mar 17, 2021

Bump! It would nice to see restricted-friendly examples.

Would prefer to see the guestbook example use a high-numbered port at the very least as it seems like the quickest path.

@hect1995
Copy link

Do you know how can we easily avoid this issue? As I am running the examples on Openshift 4 and I am getting all the time the error:

(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80

@komish
Copy link

komish commented Apr 28, 2021

@hect1995 The simplest way I've found is just to bind to a high-numbered port in the sample application, and pass that through to the manifests.

@vajravelu1
Copy link

vajravelu1 commented Feb 10, 2024

for those looking for quick fix for the solution
oc adm policy add-scc-to-user anyuid -z default

which will give the service account default permission to run service on privileged ports like 80

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

No branches or pull requests

4 participants