docker-nginx-controller icon indicating copy to clipboard operation
docker-nginx-controller copied to clipboard

Dockerfiles for OpenShift?

Open fabriziofiorucci opened this issue 2 years ago • 13 comments

Hello,

all Dockerfiles work fine with k8s but with OpenShift there is some issue on a permission denied when the agent starts, as it can't write anything in /etc/controller-agent. The dir is owned by root:root and openshift forces everything to run as non-root. Do we have some updated Dockerfile that can be used to build NGINX+agent for OpenShift as well?

fabriziofiorucci avatar Jul 28 '21 07:07 fabriziofiorucci

@brianehlert having unprivileged user dockerfiles which seems to be incomplete right now, might solve this issue? cc: @framer777

1996sajal avatar Jul 28 '21 15:07 1996sajal

I gonna do another cycle on non-root changes (https://github.com/nginxinc/docker-nginx-controller/pull/51) in order to complete the work.

framer777 avatar Jul 28 '21 16:07 framer777

@framer777 thanks.

1996sajal avatar Jul 28 '21 16:07 1996sajal

I gonna do another cycle on non-root changes (#51) in order to complete the work.

Hi, I'm sorry to push, is there an ETA for the unprivileged Dockerfile to be available? Thanks

fabriziofiorucci avatar Aug 02 '21 10:08 fabriziofiorucci

Additionally, after manually patching the exposed nginx port, I'm getting:

starting nginx ... waiting for nginx workers ... nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2 updating /etc/controller-agent/agent.conf ...

---> using api_key = xxx ---> using controller api url = https://FQDN:8443/1.4/ ---> using instance_name = nginx-agent-5cb6df74d7-nd49x ---> using instance group = nginx-openshift starting controller-agent ... time="Jul 29 2021 10:13:00.867" level="info" msg="Starting Nginx Controller (Go) Agent. Version: 3.18.1-316464192.release-3-18..." feature="main" time="Jul 29 2021 10:13:00.874" level="info" msg="Discovered nginxs" count="1" feature="main" time="Jul 29 2021 10:13:00.975" level="fatal" msg="listen tcp 0.0.0.0:514: bind: permission denied" feature="main" waiting for nginx to stop... controller-agent process has stopped, exiting

is there a way to override port 514? Changing /etc/nginx-controller/agent.conf to set:

[listener_syslog-default] address =

to something like 0.0.0.0:10514

doesn't seem to work.

Any clue here?

Thank you!

fabriziofiorucci avatar Aug 03 '21 09:08 fabriziofiorucci

I gonna do another cycle on non-root changes (#51) in order to complete the work.

Hi, I'm sorry to push, is there an ETA for the unprivileged Dockerfile to be available? Thanks

Will try to resolve it within the next two days.

framer777 avatar Aug 03 '21 14:08 framer777

Hi, is there any update on this? Thank you.

fabriziofiorucci avatar Aug 09 '21 08:08 fabriziofiorucci

@fabriziofiorucci I was able to wrap up all changes in https://github.com/nginxinc/docker-nginx-controller/pull/51 Sorry for the delay, took more than expected.

is there a way to override port 514?

yes, please refer to the updated README in the PR: https://github.com/nginxinc/docker-nginx-controller/blob/55f04f3687c1edbe620d25e8ea3a93a2dd6ff396/README.md#52-new-build-arguments

The example Dockerfile is provided as well.

framer777 avatar Aug 10 '21 02:08 framer777

Thank you! Would it be possible to get the diff for the unprivileged nap-enabled version as well?

fabriziofiorucci avatar Aug 10 '21 08:08 fabriziofiorucci

sure @fabriziofiorucci, I'll add nap-enabled diff soon.

framer777 avatar Aug 10 '21 15:08 framer777

sure @fabriziofiorucci, I'll add nap-enabled diff soon.

thank you!

fabriziofiorucci avatar Aug 10 '21 17:08 fabriziofiorucci

@fabriziofiorucci, here are the examples of unprivileged files (Dockerfile & entrypoint.sh): https://github.com/nginxinc/docker-nginx-controller/blob/e6dc7ef8bab1626302fcb24f822012c0ec478cc2/unprivileged/examples/ubuntu-nap/Dockerfile https://github.com/nginxinc/docker-nginx-controller/blob/e6dc7ef8bab1626302fcb24f822012c0ec478cc2/unprivileged/examples/ubuntu-nap/entrypoint.sh

framer777 avatar Aug 17 '21 08:08 framer777

@framer777 @brianehlert Where can i find un-privilege image based on centos/rhel for openshift?

RGanor avatar Nov 02 '21 08:11 RGanor