Skip to content

Commit

Permalink
Fix var/lib volume for N+
Browse files Browse the repository at this point in the history
  • Loading branch information
sjberman committed Nov 11, 2024
1 parent 36f245b commit 8624530
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 51 deletions.
4 changes: 2 additions & 2 deletions build/Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.nginxplus
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions charts/nginx-gateway-fabric/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions config/tests/static-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -164,8 +162,6 @@ spec:
emptyDir: {}
- name: nginx-cache
emptyDir: {}
- name: nginx-lib
emptyDir: {}
- name: nginx-includes
emptyDir: {}
- name: nginx-includes-bootstrap
Expand Down
4 changes: 0 additions & 4 deletions deploy/aws-nlb/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -351,8 +349,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down
4 changes: 0 additions & 4 deletions deploy/azure/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -350,8 +348,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down
4 changes: 0 additions & 4 deletions deploy/default/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -348,8 +346,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down
8 changes: 4 additions & 4 deletions deploy/experimental-nginx-plus/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions deploy/experimental/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -354,8 +352,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down
8 changes: 4 additions & 4 deletions deploy/nginx-plus/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions deploy/nodeport/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -348,8 +346,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down
4 changes: 0 additions & 4 deletions deploy/openshift/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -356,8 +354,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down
8 changes: 4 additions & 4 deletions deploy/snippets-filters-nginx-plus/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions deploy/snippets-filters/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -351,8 +349,6 @@ spec:
name: nginx-run
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-lib
- emptyDir: {}
name: nginx-includes
- configMap:
Expand Down

0 comments on commit 8624530

Please sign in to comment.