fix chroot module mount path (#9090)

This commit is contained in:
Ehsan Saei 2022-09-28 23:02:30 +02:00 committed by GitHub
parent 261ce42517
commit 1a078af307
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -147,7 +147,11 @@ spec:
volumeMounts: volumeMounts:
{{- if .Values.controller.extraModules }} {{- if .Values.controller.extraModules }}
- name: modules - name: modules
{{ if .Values.controller.image.chroot }}
mountPath: /chroot/modules_mount
{{ else }}
mountPath: /modules_mount mountPath: /modules_mount
{{ end }}
{{- end }} {{- end }}
{{- if .Values.controller.customTemplate.configMapName }} {{- if .Values.controller.customTemplate.configMapName }}
- mountPath: /etc/nginx/template - mountPath: /etc/nginx/template

View file

@ -84,7 +84,7 @@ RUN bash -xeu -c ' \
# LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules # LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules
# Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below # Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below
# Could get complicated arch specific paths become a need # 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 \ RUN apk add --no-cache libcap \
&& setcap cap_sys_chroot,cap_net_bind_service=+ep /nginx-ingress-controller \ && 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/zero c 1 5 \
&& mknod -m 0666 /chroot/dev/tty c 5 0 && 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 USER www-data
EXPOSE 80 443 EXPOSE 80 443