Skip to content

Commit c2c0f47

Browse files
committed
Merge branch 'feat/ubi-base-image' into feat/pipeline-ubi-builds
2 parents 4924f3c + d9155b2 commit c2c0f47

File tree

72 files changed

+1490
-13978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1490
-13978
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ repos:
55
rev: v6.0.0
66
hooks:
77
- id: trailing-whitespace
8-
exclude: (^operators/|^tests/results/|\.avdl$|_generated.go$)
8+
exclude: (^tests/results/|\.avdl$|_generated.go$)
99
- id: end-of-file-fixer
10-
exclude: (^operators/)
1110
- id: check-yaml
1211
args: [--allow-multiple-documents]
13-
exclude: (^operators/|^charts/nginx-gateway-fabric/templates)
14-
- id: check-added-large-files
15-
exclude: (^operators/)
12+
exclude: (^charts/nginx-gateway-fabric/templates)
1613
- id: check-merge-conflict
1714
- id: check-case-conflict
1815
- id: check-vcs-permalinks
@@ -26,7 +23,7 @@ repos:
2623
args: [--fix=lf]
2724
- id: no-commit-to-branch
2825
- id: detect-private-key
29-
exclude: (^operators/|^examples/|^docs/|.*_test.go$)
26+
exclude: (^examples/|^docs/|.*_test.go$)
3027

3128
- repo: https://github.com/gitleaks/gitleaks
3229
rev: v8.28.0

.yamllint.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ ignore:
44
- config/crd/bases/
55
- deploy
66
- site/static
7-
- operators/
87

98
rules:
109
braces: enable
@@ -18,7 +17,6 @@ rules:
1817
comments-indentation:
1918
ignore: |
2019
charts/nginx-gateway-fabric/values.yaml
21-
operators/
2220
document-end: disable
2321
document-start: disable
2422
empty-lines: enable
@@ -30,7 +28,7 @@ rules:
3028
indent-sequences: consistent
3129
check-multi-line-strings: true
3230
ignore: |
33-
operators/
31+
operators/**/*
3432
key-duplicates: enable
3533
key-ordering: disable
3634
line-length:
@@ -42,6 +40,7 @@ rules:
4240
tests/suite/manifests/longevity/cronjob.yaml
4341
.goreleaser.yml
4442
charts/nginx-gateway-fabric/
43+
operators/config/crd/bases/gateway.nginx.org_nginxgatewayfabrics.yaml
4544
new-line-at-end-of-file: enable
4645
new-lines: enable
4746
octal-values: disable
@@ -50,4 +49,3 @@ rules:
5049
truthy:
5150
ignore: |
5251
.github/workflows/
53-
operators/

build/ubi/Dockerfile.nginx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ ADD --link --chown=101:1001 https://nginx.org/keys/nginx_signing.key nginx_signi
66
ADD --link --chown=101:1001 build/ubi/repos/nginx.repo nginx.repo
77
ADD --link --chown=101:1001 build/ubi/repos/agent.repo agent.repo
88

9-
FROM redhat/ubi9-minimal:9.6 AS ubi-minimal
10-
119
FROM ghcr.io/nginx/dependencies/nginx-ubi:ubi9@sha256:01a32246761b9bbe47a6a29bcd8ca6e9b6e331b3bdfa372d8987b622276f7025 AS ubi9-packages
1210

13-
FROM ubi-minimal AS ubi-nginx
11+
FROM redhat/ubi9-minimal:9.6 AS ubi-nginx
1412

1513
# renovate: datasource=github-tags depName=nginx/agent
1614
ARG NGINX_AGENT_VERSION=v3.3.1
1715
ARG NJS_DIR
1816
ARG NGINX_CONF_DIR
1917
ARG BUILD_AGENT
2018

21-
LABEL name="F5 NGINX Gateway Fabric NGINX" \
19+
LABEL name="F5 NGINX Gateway Fabric NGINX OSS" \
2220
maintainer="[email protected]" \
2321
vendor="F5 NGINX" \
2422
summary="NGINX Gateway Fabric" \
@@ -29,7 +27,7 @@ LABEL name="F5 NGINX Gateway Fabric NGINX" \
2927

3028
COPY --link --chown=101:1001 LICENSE /licenses/
3129

32-
# Install NGINX with OTEL support using the same approach as NGINX IC
30+
# Install NGINX with packages
3331
RUN --mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_signing.key \
3432
--mount=type=bind,from=nginx-files,src=nginx.repo,target=/etc/yum.repos.d/nginx.repo \
3533
--mount=type=bind,from=nginx-files,src=agent.repo,target=/etc/yum.repos.d/agent.repo \
@@ -54,20 +52,18 @@ RUN mkdir -p /usr/lib/nginx/modules /var/run/nginx /usr/lib64/nginx/modules \
5452
# Forward request and error logs to docker log collector
5553
&& ln -sf /dev/stdout /var/log/nginx/access.log \
5654
&& ln -sf /dev/stderr /var/log/nginx/error.log \
57-
&& mv /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/ \
58-
# Set proper permissions for nginx user
59-
&& chown -R 101:1001 /etc/nginx /var/cache/nginx /var/log/nginx /var/run/nginx
55+
&& mv /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/
56+
57+
# Set proper permissions for nginx user
58+
RUN chown -R 101:1001 /etc/nginx /var/cache/nginx
6059

6160
# Copy configuration files and scripts
6261
COPY build/entrypoint.sh /agent/entrypoint.sh
63-
COPY ${NJS_DIR}/httpmatches.js /usr/lib/nginx/modules/njs/httpmatches.js
62+
COPY ${NJS_DIR}/ /usr/lib/nginx/modules/njs/
6463
COPY ${NGINX_CONF_DIR}/nginx.conf /etc/nginx/nginx.conf
6564
COPY ${NGINX_CONF_DIR}/grpc-error-locations.conf /etc/nginx/grpc-error-locations.conf
6665
COPY ${NGINX_CONF_DIR}/grpc-error-pages.conf /etc/nginx/grpc-error-pages.conf
6766

68-
# Set executable permissions
69-
RUN chmod +x /agent/entrypoint.sh && chown 101:1001 /agent/entrypoint.sh
70-
7167
# Switch to non-root user
7268
USER 101:1001
7369

build/ubi/Dockerfile.nginxplus

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ ADD --link --chown=101:1001 https://cs.nginx.com/static/files/plus-9.repo nginx-
66
ADD --link --chown=101:1001 https://nginx.org/keys/nginx_signing.key nginx_signing.key
77
ADD --link --chown=101:1001 build/ubi/repos/agent.repo agent.repo
88

9-
FROM redhat/ubi9-minimal:9.6 AS ubi-minimal
10-
119
FROM ghcr.io/nginx/dependencies/nginx-ubi:ubi9@sha256:01a32246761b9bbe47a6a29bcd8ca6e9b6e331b3bdfa372d8987b622276f7025 AS ubi9-packages
1210

13-
FROM ubi-minimal AS ubi-nginx-plus
11+
FROM redhat/ubi9-minimal:9.6 AS ubi-nginx-plus
1412

1513
ARG NGINX_PLUS_VERSION=R35
1614

@@ -52,6 +50,7 @@ RUN --mount=type=bind,from=nginx-files,src=nginx-plus.repo,target=/etc/yum.repos
5250
# Install nginx-agent
5351
&& microdnf --nodocs install -y nginx-agent-${NGINX_AGENT_VERSION#v}* \
5452
# Clean up
53+
# && microdnf remove -y shadow-utils subscription-manager \
5554
&& microdnf clean all \
5655
&& rm -rf /var/cache/yum
5756

@@ -60,20 +59,22 @@ RUN mkdir -p /usr/lib/nginx/modules /var/run/nginx /usr/lib64/nginx/modules \
6059
# Forward request and error logs to docker log collector
6160
&& ln -sf /dev/stdout /var/log/nginx/access.log \
6261
&& ln -sf /dev/stderr /var/log/nginx/error.log \
63-
&& mv /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/ \
64-
# Set proper permissions for nginx user
65-
&& chown -R 101:1001 /etc/nginx /var/cache/nginx /var/log/nginx /var/run/nginx
62+
&& mv /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/
63+
64+
# Copy default html files to a writable location
65+
RUN mkdir -p /etc/nginx/html \
66+
&& cp /usr/share/nginx/html/* /etc/nginx/html/
67+
68+
# Set proper permissions for nginx user
69+
RUN chown -R 101:1001 /etc/nginx /var/cache/nginx
6670

6771
# Copy configuration files and scripts
6872
COPY build/entrypoint.sh /agent/entrypoint.sh
69-
COPY ${NJS_DIR}/httpmatches.js /usr/lib/nginx/modules/njs/httpmatches.js
73+
COPY ${NJS_DIR}/ /usr/lib/nginx/modules/njs/
7074
COPY ${NGINX_CONF_DIR}/nginx.conf /etc/nginx/nginx.conf
7175
COPY ${NGINX_CONF_DIR}/grpc-error-locations.conf /etc/nginx/grpc-error-locations.conf
7276
COPY ${NGINX_CONF_DIR}/grpc-error-pages.conf /etc/nginx/grpc-error-pages.conf
7377

74-
# Set executable permissions
75-
RUN chmod +x /agent/entrypoint.sh && chown 101:1001 /agent/entrypoint.sh
76-
7778
# Switch to non-root user
7879
USER 101:1001
7980

charts/nginx-gateway-fabric/templates/clusterrole.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,33 @@ metadata:
77
rules:
88
- apiGroups:
99
- ""
10-
- apps
11-
- autoscaling
1210
resources:
1311
- secrets
1412
- configmaps
1513
- serviceaccounts
1614
- services
15+
verbs:
16+
- create
17+
- update
18+
- delete
19+
- list
20+
- get
21+
- watch
22+
- apiGroups:
23+
- apps
24+
resources:
1725
- deployments
1826
- daemonsets
27+
verbs:
28+
- create
29+
- update
30+
- delete
31+
- list
32+
- get
33+
- watch
34+
- apiGroups:
35+
- autoscaling
36+
resources:
1937
- horizontalpodautoscalers
2038
verbs:
2139
- create

deploy/azure/deploy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,33 @@ metadata:
5555
rules:
5656
- apiGroups:
5757
- ""
58-
- apps
59-
- autoscaling
6058
resources:
6159
- secrets
6260
- configmaps
6361
- serviceaccounts
6462
- services
63+
verbs:
64+
- create
65+
- update
66+
- delete
67+
- list
68+
- get
69+
- watch
70+
- apiGroups:
71+
- apps
72+
resources:
6573
- deployments
6674
- daemonsets
75+
verbs:
76+
- create
77+
- update
78+
- delete
79+
- list
80+
- get
81+
- watch
82+
- apiGroups:
83+
- autoscaling
84+
resources:
6785
- horizontalpodautoscalers
6886
verbs:
6987
- create

deploy/default/deploy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,33 @@ metadata:
5555
rules:
5656
- apiGroups:
5757
- ""
58-
- apps
59-
- autoscaling
6058
resources:
6159
- secrets
6260
- configmaps
6361
- serviceaccounts
6462
- services
63+
verbs:
64+
- create
65+
- update
66+
- delete
67+
- list
68+
- get
69+
- watch
70+
- apiGroups:
71+
- apps
72+
resources:
6573
- deployments
6674
- daemonsets
75+
verbs:
76+
- create
77+
- update
78+
- delete
79+
- list
80+
- get
81+
- watch
82+
- apiGroups:
83+
- autoscaling
84+
resources:
6785
- horizontalpodautoscalers
6886
verbs:
6987
- create

deploy/experimental-nginx-plus/deploy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,33 @@ metadata:
5555
rules:
5656
- apiGroups:
5757
- ""
58-
- apps
59-
- autoscaling
6058
resources:
6159
- secrets
6260
- configmaps
6361
- serviceaccounts
6462
- services
63+
verbs:
64+
- create
65+
- update
66+
- delete
67+
- list
68+
- get
69+
- watch
70+
- apiGroups:
71+
- apps
72+
resources:
6573
- deployments
6674
- daemonsets
75+
verbs:
76+
- create
77+
- update
78+
- delete
79+
- list
80+
- get
81+
- watch
82+
- apiGroups:
83+
- autoscaling
84+
resources:
6785
- horizontalpodautoscalers
6886
verbs:
6987
- create

deploy/experimental/deploy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,33 @@ metadata:
5555
rules:
5656
- apiGroups:
5757
- ""
58-
- apps
59-
- autoscaling
6058
resources:
6159
- secrets
6260
- configmaps
6361
- serviceaccounts
6462
- services
63+
verbs:
64+
- create
65+
- update
66+
- delete
67+
- list
68+
- get
69+
- watch
70+
- apiGroups:
71+
- apps
72+
resources:
6573
- deployments
6674
- daemonsets
75+
verbs:
76+
- create
77+
- update
78+
- delete
79+
- list
80+
- get
81+
- watch
82+
- apiGroups:
83+
- autoscaling
84+
resources:
6785
- horizontalpodautoscalers
6886
verbs:
6987
- create

deploy/nginx-plus/deploy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,33 @@ metadata:
5555
rules:
5656
- apiGroups:
5757
- ""
58-
- apps
59-
- autoscaling
6058
resources:
6159
- secrets
6260
- configmaps
6361
- serviceaccounts
6462
- services
63+
verbs:
64+
- create
65+
- update
66+
- delete
67+
- list
68+
- get
69+
- watch
70+
- apiGroups:
71+
- apps
72+
resources:
6573
- deployments
6674
- daemonsets
75+
verbs:
76+
- create
77+
- update
78+
- delete
79+
- list
80+
- get
81+
- watch
82+
- apiGroups:
83+
- autoscaling
84+
resources:
6785
- horizontalpodautoscalers
6886
verbs:
6987
- create

0 commit comments

Comments
 (0)