From f3daf70d2159554129394d37b6ada52e30d30ccf Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:51:26 +0200 Subject: [PATCH] fix chroot module mount path --- charts/ingress-nginx/templates/controller-deployment.yaml | 4 ++++ rootfs/Dockerfile-chroot | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/ingress-nginx/templates/controller-deployment.yaml b/charts/ingress-nginx/templates/controller-deployment.yaml index 5ad1867945..c193f776c2 100644 --- a/charts/ingress-nginx/templates/controller-deployment.yaml +++ b/charts/ingress-nginx/templates/controller-deployment.yaml @@ -147,7 +147,11 @@ spec: volumeMounts: {{- if .Values.controller.extraModules }} - name: modules + {{ if .Values.controller.image.chroot }} + mountPath: /chroot/modules_mount + {{ else }} mountPath: /modules_mount + {{ end }} {{- end }} {{- if .Values.controller.customTemplate.configMapName }} - mountPath: /etc/nginx/template diff --git a/rootfs/Dockerfile-chroot b/rootfs/Dockerfile-chroot index 64b2228901..4805909d5d 100644 --- a/rootfs/Dockerfile-chroot +++ b/rootfs/Dockerfile-chroot @@ -84,7 +84,7 @@ RUN bash -xeu -c ' \ # LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules # Put libs of newer modules under `/modules_mount//lib` and add that path below # Could get complicated arch specific paths become a need - && echo "/lib:/usr/lib:/usr/local/lib:/modules_mount/otel/lib" > /etc/ld-musl-x86_64.path + && echo "/lib:/usr/lib:/usr/local/lib:/modules_mount/etc/nginx/modules/otel" > /chroot/etc/ld-musl-x86_64.path RUN apk add --no-cache libcap \ && setcap cap_sys_chroot,cap_net_bind_service=+ep /nginx-ingress-controller \ @@ -113,6 +113,10 @@ RUN ln -sf /chroot/etc/nginx /etc/nginx \ && mknod -m 0666 /chroot/dev/zero c 1 5 \ && mknod -m 0666 /chroot/dev/tty c 5 0 +RUN mkdir -p /chroot/modules_mount \ + && mkdir -p modules_mount \ + && ln -s /modules_mount /chroot/modules_mount + USER www-data EXPOSE 80 443