diff --git a/build/Dockerfile.nginx b/build/Dockerfile.nginx index 3dee0258a..359370903 100644 --- a/build/Dockerfile.nginx +++ b/build/Dockerfile.nginx @@ -6,7 +6,7 @@ ARG NGINX_CONF_DIR ARG BUILD_AGENT RUN apk add --no-cache libcap \ - && mkdir -p /var/lib/nginx /usr/lib/nginx/modules \ + && mkdir -p /usr/lib/nginx/modules \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ && setcap -v 'cap_net_bind_service=+ep' /usr/sbin/nginx \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \ @@ -18,7 +18,7 @@ COPY ${NGINX_CONF_DIR}/nginx.conf /etc/nginx/nginx.conf COPY ${NGINX_CONF_DIR}/grpc-error-locations.conf /etc/nginx/grpc-error-locations.conf COPY ${NGINX_CONF_DIR}/grpc-error-pages.conf /etc/nginx/grpc-error-pages.conf -RUN chown -R 101:1001 /etc/nginx /var/cache/nginx /var/lib/nginx +RUN chown -R 101:1001 /etc/nginx /var/cache/nginx LABEL org.nginx.ngf.image.build.agent="${BUILD_AGENT}" diff --git a/build/Dockerfile.nginxplus b/build/Dockerfile.nginxplus index 192f7839f..83ab1cce5 100644 --- a/build/Dockerfile.nginxplus +++ b/build/Dockerfile.nginxplus @@ -19,7 +19,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/apk/cert.pem,mode=0644 \ && adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx \ && printf "%s\n" "https://pkgs.nginx.com/plus/${NGINX_PLUS_VERSION}/alpine/v$(grep -E -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \ && apk add --no-cache nginx-plus nginx-plus-module-njs nginx-plus-module-otel libcap \ - && mkdir -p /var/lib/nginx /usr/lib/nginx/modules \ + && mkdir -p /usr/lib/nginx/modules \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ && setcap -v 'cap_net_bind_service=+ep' /usr/sbin/nginx \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \ diff --git a/charts/nginx-gateway-fabric/templates/deployment.yaml b/charts/nginx-gateway-fabric/templates/deployment.yaml index 92ee1eb7c..0985a5bc2 100644 --- a/charts/nginx-gateway-fabric/templates/deployment.yaml +++ b/charts/nginx-gateway-fabric/templates/deployment.yaml @@ -222,11 +222,11 @@ spec: mountPath: /var/run/nginx - name: nginx-cache mountPath: /var/cache/nginx - - name: nginx-lib - mountPath: /var/lib/nginx - name: nginx-includes mountPath: /etc/nginx/includes {{- if .Values.nginx.plus }} + - name: nginx-lib + mountPath: /var/lib/nginx/state {{- if .Values.nginx.usage.secretName }} - name: nginx-plus-license mountPath: /etc/nginx/license.jwt @@ -278,14 +278,14 @@ spec: emptyDir: {} - name: nginx-cache emptyDir: {} - - name: nginx-lib - emptyDir: {} - name: nginx-includes emptyDir: {} - name: nginx-includes-bootstrap configMap: name: nginx-includes-bootstrap {{- if .Values.nginx.plus }} + - name: nginx-lib + emptyDir: {} {{- if .Values.nginx.usage.secretName }} - name: nginx-plus-license secret: diff --git a/config/tests/static-deployment.yaml b/config/tests/static-deployment.yaml index c1aac6dff..0ae1bcfc0 100644 --- a/config/tests/static-deployment.yaml +++ b/config/tests/static-deployment.yaml @@ -141,8 +141,6 @@ spec: mountPath: /var/run/nginx - name: nginx-cache mountPath: /var/cache/nginx - - name: nginx-lib - mountPath: /var/lib/nginx - name: nginx-includes mountPath: /etc/nginx/includes terminationGracePeriodSeconds: 30 @@ -164,8 +162,6 @@ spec: emptyDir: {} - name: nginx-cache emptyDir: {} - - name: nginx-lib - emptyDir: {} - name: nginx-includes emptyDir: {} - name: nginx-includes-bootstrap diff --git a/deploy/aws-nlb/deploy.yaml b/deploy/aws-nlb/deploy.yaml index 53de84437..4f367638b 100644 --- a/deploy/aws-nlb/deploy.yaml +++ b/deploy/aws-nlb/deploy.yaml @@ -301,8 +301,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -351,8 +349,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: diff --git a/deploy/azure/deploy.yaml b/deploy/azure/deploy.yaml index 1b365b557..f4916da3f 100644 --- a/deploy/azure/deploy.yaml +++ b/deploy/azure/deploy.yaml @@ -298,8 +298,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -350,8 +348,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: diff --git a/deploy/default/deploy.yaml b/deploy/default/deploy.yaml index 189252059..88aae1eed 100644 --- a/deploy/default/deploy.yaml +++ b/deploy/default/deploy.yaml @@ -298,8 +298,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -348,8 +346,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: diff --git a/deploy/experimental-nginx-plus/deploy.yaml b/deploy/experimental-nginx-plus/deploy.yaml index 0b155ec02..c2bcbafe0 100644 --- a/deploy/experimental-nginx-plus/deploy.yaml +++ b/deploy/experimental-nginx-plus/deploy.yaml @@ -318,10 +318,10 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes + - mountPath: /var/lib/nginx/state + name: nginx-lib - mountPath: /etc/nginx/license.jwt name: nginx-plus-license subPath: license.jwt @@ -373,13 +373,13 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: name: nginx-includes-bootstrap name: nginx-includes-bootstrap + - emptyDir: {} + name: nginx-lib - name: nginx-plus-license secret: secretName: nplus-license diff --git a/deploy/experimental/deploy.yaml b/deploy/experimental/deploy.yaml index 6580c470e..be6220747 100644 --- a/deploy/experimental/deploy.yaml +++ b/deploy/experimental/deploy.yaml @@ -304,8 +304,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -354,8 +352,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: diff --git a/deploy/nginx-plus/deploy.yaml b/deploy/nginx-plus/deploy.yaml index 145c89722..f31b0da07 100644 --- a/deploy/nginx-plus/deploy.yaml +++ b/deploy/nginx-plus/deploy.yaml @@ -312,10 +312,10 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes + - mountPath: /var/lib/nginx/state + name: nginx-lib - mountPath: /etc/nginx/license.jwt name: nginx-plus-license subPath: license.jwt @@ -367,13 +367,13 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: name: nginx-includes-bootstrap name: nginx-includes-bootstrap + - emptyDir: {} + name: nginx-lib - name: nginx-plus-license secret: secretName: nplus-license diff --git a/deploy/nodeport/deploy.yaml b/deploy/nodeport/deploy.yaml index 8ba5d32da..25b6210ed 100644 --- a/deploy/nodeport/deploy.yaml +++ b/deploy/nodeport/deploy.yaml @@ -298,8 +298,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -348,8 +346,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: diff --git a/deploy/openshift/deploy.yaml b/deploy/openshift/deploy.yaml index 7ed4a4a17..8231de661 100644 --- a/deploy/openshift/deploy.yaml +++ b/deploy/openshift/deploy.yaml @@ -306,8 +306,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -356,8 +354,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: diff --git a/deploy/snippets-filters-nginx-plus/deploy.yaml b/deploy/snippets-filters-nginx-plus/deploy.yaml index 8bbb1a127..4a68115cc 100644 --- a/deploy/snippets-filters-nginx-plus/deploy.yaml +++ b/deploy/snippets-filters-nginx-plus/deploy.yaml @@ -315,10 +315,10 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes + - mountPath: /var/lib/nginx/state + name: nginx-lib - mountPath: /etc/nginx/license.jwt name: nginx-plus-license subPath: license.jwt @@ -370,13 +370,13 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: name: nginx-includes-bootstrap name: nginx-includes-bootstrap + - emptyDir: {} + name: nginx-lib - name: nginx-plus-license secret: secretName: nplus-license diff --git a/deploy/snippets-filters/deploy.yaml b/deploy/snippets-filters/deploy.yaml index b623a668f..e6fd79ce2 100644 --- a/deploy/snippets-filters/deploy.yaml +++ b/deploy/snippets-filters/deploy.yaml @@ -301,8 +301,6 @@ spec: name: nginx-run - mountPath: /var/cache/nginx name: nginx-cache - - mountPath: /var/lib/nginx - name: nginx-lib - mountPath: /etc/nginx/includes name: nginx-includes initContainers: @@ -351,8 +349,6 @@ spec: name: nginx-run - emptyDir: {} name: nginx-cache - - emptyDir: {} - name: nginx-lib - emptyDir: {} name: nginx-includes - configMap: