8000 Add OpenTelemetry support (#7642) · nginx/kubernetes-ingress@07c302f · GitHub
[go: up one dir, main page]

Skip to content

Commit 07c302f

Browse files
authored
Add OpenTelemetry support (#7642)
1 parent 1e27aeb commit 07c302f

34 files changed

+1360
-174
lines changed

.github/data/matrix-smoke-nap.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"image": "ubi-8-plus-nap",
66
"type": "plus",
77
"nap_modules": "waf",
8-
"marker": "appprotect_waf_policies_allow",
8+
"marker": "'appprotect_waf_policies_allow or otel'",
99
"platforms": "linux/amd64"
1010
},
1111
{
@@ -21,23 +21,23 @@
2121
"image": "alpine-plus-nap-fips",
2222
"type": "plus",
2323
"nap_modules": "waf",
24-
"marker": "appprotect_waf_policies_grpc",
24+
"marker": "'appprotect_waf_policies_grpc or otel'",
2525
"platforms": "linux/amd64"
2626
},
2727
{
2828
"label": "AP_WAF 4/4",
2929
"image": "debian-plus-nap",
3030
"type": "plus",
3131
"nap_modules": "waf",
32-
"marker": "'appprotect_watch or appprotect_batch or appprotect_integration or appprotect_waf_policies_vsr'",
32+
"marker": "'appprotect_watch or appprotect_batch or appprotect_integration or appprotect_waf_policies_vsr or otel'",
3333
"platforms": "linux/amd64"
3434
},
3535
{
3636
"label": "AP_WAF_V5 1/1",
3737
"image": "debian-plus-nap-v5",
3838
"type": "plus",
3939
"nap_modules": "waf",
40-
"marker": "appprotect_waf_v5",
40+
"marker": "'appprotect_waf_v5 or otel'",
4141
"platforms": "linux/amd64"
4242
},
4343
{
@@ -61,7 +61,7 @@
6161
"image": "ubi-9-plus-nap",
6262
"type": "plus",
6363
"nap_modules": "dos",
64-
"marker": "dos_learning",
64+
"marker": "'dos_learning or otel'",
6565
"platforms": "linux/amd64"
6666
},
6767
{

.github/data/matrix-smoke-oss.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,77 @@
55
"image": "debian",
66
"type": "oss",
77
"marker": "'ingresses and not annotations and not basic_auth and not hsts and not watch_namespace and not wildcard_tls'",
8-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
8+
"platforms": "linux/arm64, linux/amd64"
99
},
1010
{
1111
"label": "ingresses 2/2",
1212
"image": "debian",
1313
"type": "oss",
1414
"marker": "'annotations or basic_auth or hsts or watch_namespace or wildcard_tls'",
15-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
15+
"platforms": "linux/arm64, linux/amd64"
1616
},
1717
{
1818
"label": "VSR 1/3",
1919
"image": "alpine",
2020
"type": "oss",
2121
"marker": "'vsr and not vsr_upstream and not vsr_grpc and not vsr_status and not vsr_canary and not vsr_routing and not vsr_api and not vsr_redirects and not vsr_rewrite and not vsr_canned and not vsr_basic'",
22-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
22+
"platforms": "linux/arm64, linux/amd64"
2323
},
2424
{
2525
"label": "VSR 2/3",
2626
"image": "alpine",
2727
"type": "oss",
2828
"marker": "'vsr_basic or vsr_canned or vsr_rewrite or vsr_redirects or vsr_upstream'",
29-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
29+
"platforms": "linux/arm64, linux/amd64"
3030
},
3131
{
3232
"label": "VSR 3/3",
3333
"image": "alpine",
3434
"type": "oss",
3535
"marker": "'vsr_api or vsr_routing or vsr_canary or vsr_status or vsr_grpc'",
36-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
36+
"platforms": "linux/arm64, linux/amd64"
3737
},
3838
{
3939
"label": "policies 1/2",
4040
"image": "alpine",
4141
"type": "oss",
4242
"marker": "'policies and not policies_rl and not policies_ac and not policies_jwt and not policies_mtls'",
43-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
43+
"platforms": "linux/arm64, linux/amd64"
4444
},
4545
{
4646
"label": "policies 2/2",
4747
"image": "alpine",
4848
"type": "oss",
49-
"marker": "'policies_rl or policies_ac or policies_jwt or policies_mtls'",
50-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
49+
"marker": "'policies_rl or policies_ac or policies_jwt or policies_mtls or otel'",
50+
"platforms": "linux/arm64, linux/amd64"
5151
},
5252
{
5353
"label": "VS 1/3",
5454
"image": "debian",
5555
"type": "oss",
5656
"marker": "'vs and not vs_ipv6 and not vs_rewrite and not vs_responses and not vs_grpc and not vs_redirects and not vs_externalname and not vs_externaldns and not vs_certmanager and not vs_api and not vs_backup and not vs_use_cluster_ip and not vs_canary and not vs_upstream and not vs_config_map'",
57-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
57+
"platforms": "linux/arm64, linux/amd64"
5858
},
5959
{
6060
"label": "VS 2/3",
6161
"image": "debian",
6262
"type": "oss",
6363
"marker": "'vs_grpc or vs_redirects or vs_externalname or vs_externaldns or vs_api or vs_backup or vs_use_cluster_ip or vs_canary or vs_upstream or vs_config_map'",
64-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
64+
"platforms": "linux/arm64, linux/amd64"
6565
},
6666
{
6767
"label": "VS 3/3",
6868
"image": "debian",
6969
"type": "oss",
70-
"marker": "'vs_responses or vs_ipv6 or vs_rewrite or vs_certmanager'",
71-
"platforms": "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
70+
"marker": "'vs_responses or vs_ipv6 or vs_rewrite or vs_certmanager or otel'",
71+
"platforms": "linux/arm64, linux/amd64"
7272
},
7373
{
7474
"label": "TS",
7575
"image": "ubi",
7676
"type": "oss",
77-
"marker": "ts",
78-
"platforms": "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
77+
"marker": "'ts or otel'",
78+
"platforms": "linux/arm64, linux/amd64"
7979
}
8080
],
8181
"k8s": []

.github/data/matrix-smoke-plus.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"label": "TS",
2626
"image": "debian-plus",
2727
"type": "plus",
28-
"marker": "ts",
28+
"marker": "'ts or otel'",
2929
"platforms": "linux/arm64, linux/amd64"
3030
},
3131
{
@@ -60,7 +60,7 @@
6060
"label": "VSR 3/3",
6161
"image": "alpine-plus",
6262
"type": "plus",
63-
"marker": "'vsr_api or vsr_routing or vsr_canary or vsr_status or vsr_grpc'",
63+
"marker": "'vsr_api or vsr_routing or vsr_canary or vsr_status or vsr_grpc or otel'",
6464
"platforms": "linux/arm64, linux/amd64"
6565
},
6666
{
@@ -74,7 +74,7 @@
7474
"label": "policies 2/3",
7575
"image": "ubi-9-plus",
7676
"type": "plus",
77-
"marker": "'policies_ac or policies_jwt or policies_mtls'",
77+
"marker": "'policies_ac or policies_jwt or policies_mtls or otel'",
7878
"platforms": "linux/arm64, linux/amd64, linux/s390x"
7979
},
8080
{
Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,36 @@
1-
name: Build UBI ppc64le Dependency
1+
name: Build UBI c-ares Dependency
22

33
on:
44
push:
55
branches:
66
- main
77
paths:
8-
- build/dependencies/Dockerfile.ubi
8+
- build/dependencies/Dockerfile.ubi8
9+
- build/dependencies/Dockerfile.ubi9
10+
- .github/workflows/build-ubi-dependency.yml
911
workflow_dispatch:
10-
inputs:
11-
nginx_version:
12-
type: string
13-
description: "NGINX Version to build for"
14-
required: false
15-
force:
16-
type: boolean
17-
description: "Force rebuild"
18-
required: false
19-
default: false
2012

2113
env:
22-
IMAGE_NAME: ghcr.io/nginx/dependencies/nginx-ubi-ppc64le
14+
IMAGE_NAME: ghcr.io/nginx/dependencies/nginx-ubi
2315

2416
concurrency:
25-
group: ${{ github.ref_name }}-ubi-ppc64le-build
17+
group: ${{ github.ref_name }}-ubi-build
2618
cancel-in-progress: true
2719

2820
permissions:
2921
contents: read
3022

3123
jobs:
32-
checks:
33-
name: Check versions
34-
runs-on: ubuntu-22.04
35-
permissions:
36-
packages: read
37-
contents: read
38-
strategy:
39-
fail-fast: false
40-
outputs:
41-
nginx_version: ${{ steps.var.outputs.nginx_version }}
42-
njs_version: ${{ steps.var.outputs.njs_version }}
43-
target_exists: ${{ steps.var.outputs.target_image_exists }}
44-
steps:
45-
- name: Checkout Repository
46-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47-
48-
- name: Login to GitHub Container Registry
49-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
50-
with:
51-
registry: ghcr.io
52-
username: ${{ github.repository_owner }}
53-
password: ${{ secrets.GITHUB_TOKEN }}
54-
55-
- name: Output Variables
56-
id: var
57-
run: |
58-
if [ -n "${{ inputs.nginx_version }}" ]; then
59-
nginx_v=${{ inputs.nginx_version }}
60-
else
61-
nginx_v=$(grep -m1 'FROM nginx:' <build/dependencies/Dockerfile.ubi | cut -d '@' -f1 | awk -F'[: ]' '{print $3}')
62-
fi
63-
target_image=${{ env.IMAGE_NAME }}:nginx-${nginx_v}
64-
if docker manifest inspect ${target_image}; then
65-
target_image_exists=true
66-
else
67-
target_image_exists=false
68-
fi
69-
docker pull nginx:$nginx_v || exit 1
70-
njs=$(docker run nginx:$nginx_v env | grep NJS_VERSION | cut -d= -f2)
71-
echo "> Outputs -------------------------------"
72-
echo "NJS_VERSION=$njs"
73-
echo "nginx_version=${nginx_v}"
74-
echo "njs_version=${njs}"
75-
echo "target_image_exists=${target_image_exists}"
76-
echo "nginx_version=${nginx_v}" >> $GITHUB_OUTPUT
77-
echo "njs_version=${njs}" >> $GITHUB_OUTPUT
78-
echo "target_image_exists=${target_image_exists}" >> $GITHUB_OUTPUT
79-
8024
build-binaries:
3E14
8125
name: Build Binary Container Image
82-
if: ${{ needs.checks.outputs.target_exists != 'true' || inputs.force }}
83-
needs: checks
8426
runs-on: ubuntu-22.04
8527
permissions:
8628
packages: write
8729
contents: read
8830
strategy:
8931
fail-fast: false
32+
matrix:
33+
tag: ["ubi8", "ubi9"]
9034
steps:
9135
- name: Checkout Repository
9236
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -113,28 +57,23 @@ jobs:
11357
images: |
11458
name=${{ env.IMAGE_NAME }},enable=true
11559
tags: |
116-
type=raw,value=nginx-${{ needs.checks.outputs.nginx_version }},enable=true
60+
type=raw,value=${{ matrix.tag }},enable=true
11761
env:
11862
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
11963

12064
- name: Build and push
12165
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
12266
with:
123-
file: ./build/dependencies/Dockerfile.ubi
67+
file: ./build/dependencies/Dockerfile.${{ matrix.tag }}
12468
context: "."
12569
pull: true
12670
push: true
127-
# build multi-arch so that it can be mounted from any image
128-
# even though only ppc64le will contain binaries
12971
platforms: "linux/amd64,linux/arm64"
13072
tags: ${{ steps.meta.outputs.tags }}
13173
labels: ${{ steps.meta.outputs.labels }}
13274
annotations: ${{ steps.meta.outputs.annotations }}
133-
cache-from: type=gha,scope=nginx-ubi-ppc64le
134-
cache-to: type=gha,scope=nginx-ubi-ppc64le,mode=max
75+
cache-from: type=gha,scope=nginx-${{ matrix.tag }}
76+
cache-to: type=gha,scope=nginx-${{ matrix.tag }},mode=max
13577
target: final
13678
sbom: false
13779
provenance: mode=max
138-
build-args: |
139-
NGINX=${{ needs.checks.outputs.nginx_version }}
140-
NJS=${{ needs.checks.outputs.njs_version }}

.github/workflows/update-docker-sha.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
ARGS="--exclude ${{ github.event.inputs.excludes }}"
6363
fi
6464
.github/scripts/docker-updater.sh ./build/Dockerfile $ARGS
65-
.github/scripts/docker-updater.sh ./build/dependencies/Dockerfile.ubi $ARGS
65+
.github/scripts/docker-updater.sh ./build/dependencies/Dockerfile.ubi8 $ARGS
66+
.github/scripts/docker-updater.sh ./build/dependencies/Dockerfile.ubi9 $ARGS
6667
.github/scripts/docker-updater.sh ./tests/Dockerfile $ARGS
6768
files=$(git diff --name-only)
6869
if [[ $files == *"Dockerfile"* ]]; then

0 commit comments

Comments
 (0)
0