Skip to content

Commit cbbd5ff

Browse files
authored
Merge branch 'main' into cors4ingress
2 parents 45e791c + 39eefc4 commit cbbd5ff

File tree

221 files changed

+4352
-1915
lines changed

Some content is hidden

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

221 files changed

+4352
-1915
lines changed

.dockerignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ grafana
44
tests/.pytest_cache
55
tests/__pycache__
66
hack
7-
.git*
7+
.git/modules
8+
.git/rr-cache
9+
.git/logs
810
*.md
911
*.crt
1012
*.key

.github/actions/smoke-tests/action.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ runs:
6464
IC_VERSION=CI
6565
${{ contains(inputs.image, 'nap') && 'NAP_MODULES=dos' || '' }}
6666
secrets: |
67-
"nginx-repo.crt=${{ inputs.nginx-crt }}"
68-
"nginx-repo.key=${{ inputs.nginx-key }}"
67+
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', inputs.nginx-crt) || '' }}
68+
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', inputs.nginx-key) || '' }}
6969
7070
- name: Build Test-Runner Container
7171
uses: docker/build-push-action@v2
@@ -112,6 +112,7 @@ runs:
112112
--service=nodeport --node-ip=${{ steps.k8s.outputs.cluster_ip }} \
113113
--html=tests-${{ steps.k8s.outputs.cluster }}.html \
114114
--self-contained-html \
115+
--durations=10 \
115116
--show-ic-logs=yes \
116117
-m ${{ inputs.marker != '' && inputs.marker || '""' }}
117118
working-directory: ./tests

.github/labeler.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
enhancement:
2+
- branch: ['feature/**', 'feat/**', 'enhancement/**', 'enh/**']
3+
4+
bug:
5+
- branch: ['fix/**', 'bug/**']
6+
7+
chore:
8+
- branch: ['chore/**']
9+
10+
tests:
11+
- branch: ['tests/**', 'test/**']
12+
- tests/**/*
13+
- perf-tests/**/*
14+
15+
documentation:
16+
- branch: ['docs/**', 'doc/**']
17+
- '**/*.md'
18+
19+
dependencies:
20+
- branch: ['deps/**', 'dep/**', 'dependabot/**']
21+
- go.mod
22+
- go.sum

.github/release-drafter.yml

-33
This file was deleted.

.github/workflows/ci.yml

+89-61
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,89 @@ jobs:
123123
with:
124124
files: ./coverage.txt
125125

126+
helm-tests:
127+
name: Helm Tests
128+
runs-on: ubuntu-20.04
129+
needs: [binary, unit-tests, checks]
130+
strategy:
131+
matrix:
132+
include:
133+
- image: debian
134+
type: oss
135+
- image: debian-plus
136+
type: plus
137+
steps:
138+
- name: Checkout Repository
139+
uses: actions/checkout@v3
140+
- name: Fetch Cached Artifacts
141+
uses: actions/cache@v3
142+
with:
143+
path: ${{ github.workspace }}/dist
144+
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }}-single
145+
- name: Docker Buildx
146+
uses: docker/setup-buildx-action@v2
147+
- name: Build Docker Image ${{ matrix.image }}
148+
uses: docker/build-push-action@v3
149+
with:
150+
file: build/Dockerfile
151+
context: '.'
152+
cache-from: type=gha,scope=${{ matrix.image }}
153+
cache-to: type=gha,scope=${{ matrix.image }},mode=max
154+
target: goreleaser
155+
tags: ${{ matrix.type }}:${{ github.sha }}
156+
pull: true
157+
load: true
158+
build-args: |
159+
BUILD_OS=${{ matrix.image }}
160+
IC_VERSION=CI
161+
secrets: |
162+
${{ contains(matrix.type, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
163+
${{ contains(matrix.type, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
164+
- name: Deploy Kubernetes
165+
id: k8s
166+
run: |
167+
kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ needs.checks.outputs.k8s_latest }} --wait 75s
168+
kind load docker-image ${{ matrix.type }}:${{ github.sha }} --name ${{ github.run_id }}
169+
- name: Install Chart
170+
run: >
171+
helm install
172+
${{ matrix.type }}
173+
.
174+
--set controller.image.repository=${{ matrix.type }}
175+
--set controller.image.tag=${{ github.sha }}
176+
--set controller.service.type=NodePort
177+
--set controller.nginxplus=${{ contains(matrix.type, 'plus') && 'true' || 'false' }}
178+
--wait
179+
working-directory: ${{ github.workspace }}/deployments/helm-chart
180+
- name: Expose Test Ingresses
181+
run: |
182+
kubectl port-forward service/${{ matrix.type }}-nginx-ingress 8080:80 &
183+
kubectl port-forward service/${{ matrix.type }}-nginx-ingress 8443:443 &
184+
- name: Test HTTP
185+
run: |
186+
counter=0
187+
max_attempts=5
188+
until [ $(curl --write-out %{http_code} -s --output /dev/null http://localhost:8080) -eq 404 ]; do
189+
if [ ${counter} -eq ${max_attempts} ]; then
190+
exit 1
191+
fi
192+
printf '.'; counter=$(($counter+1)); sleep 5;
193+
done
194+
- name: Test HTTPS
195+
run: |
196+
counter=0
197+
max_attempts=5
198+
until [ $(curl --write-out %{http_code} -ks --output /dev/null https://localhost:8443) -eq 404 ]; do
199+
if [ ${counter} -eq ${max_attempts} ]; then
200+
exit 1
201+
fi
202+
printf '.'; counter=$(($counter+1)); sleep 5;
203+
done
204+
126205
setup-matrix:
127206
name: Setup Matrix for Smoke Tests
128207
runs-on: ubuntu-20.04
129-
needs: [binary, unit-tests, checks]
208+
needs: [checks, helm-tests]
130209
outputs:
131210
matrix: ${{ steps.set-matrix.outputs.matrix }}
132211
steps:
@@ -147,7 +226,7 @@ jobs:
147226
{\"image\": \"debian-plus-nap\", \"marker\": \"dos\"}], \
148227
\"k8s\": [\"${{ needs.checks.outputs.k8s_latest }}\"]}"
149228
else
150-
echo "::set-output name=matrix::{\"k8s\": [\"1.19.16\", \"1.20.15\", \"1.21.12\", \"1.22.9\", \"1.23.6\", \"${{ needs.checks.outputs.k8s_latest }}\"], \
229+
echo "::set-output name=matrix::{\"k8s\": [\"1.19.16\", \"1.20.15\", \"1.21.14\", \"1.22.13\", \"1.23.10\", \"1.24.4\", \"${{ needs.checks.outputs.k8s_latest }}\"], \
151230
\"images\": [{\"image\": \"debian\"}, {\"image\": \"debian-plus\"}]}"
152231
fi
153232
@@ -177,64 +256,6 @@ jobs:
177256
path: ${{ github.workspace }}/tests/${{ steps.smoke-tests.outputs.test-results-name }}.html
178257
if: always()
179258

180-
helm-tests:
181-
name: Helm Tests
182-
runs-on: ubuntu-20.04
183-
needs: [binary, unit-tests, checks]
184-
env:
185-
NGINX_HTTP_PORT: 8080
186-
NGINX_HTTPS_PORT: 8443
187-
HELM_TEST_RETRIES: 5
188-
HELM_HTTP_POSTFIX: s
189-
steps:
190-
- name: Checkout Repository
191-
uses: actions/checkout@v3
192-
- name: Fetch Cached Artifacts
193-
uses: actions/cache@v3
194-
with:
195-
path: ${{ github.workspace }}/dist
196-
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }}-single
197-
- name: Docker Buildx
198-
uses: docker/setup-buildx-action@v2
199-
- name: Build Docker Image nginx-ingress
200-
uses: docker/build-push-action@v3
201-
with:
202-
file: build/Dockerfile
203-
context: '.'
204-
cache-from: type=gha,scope=debian
205-
cache-to: type=gha,scope=debian,mode=max
206-
target: goreleaser
207-
tags: nginx-ingress:${{ github.sha }}
208-
pull: true
209-
load: true
210-
build-args: BUILD_OS=debian
211-
- name: Deploy Kubernetes
212-
id: k8s
213-
run: |
214-
kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ needs.checks.outputs.k8s_latest }} --wait 75s
215-
kind load docker-image nginx-ingress:${{ github.sha }} --name ${{ github.run_id }}
216-
- name: Install Chart
217-
run: >
218-
helm install
219-
oss
220-
.
221-
--set controller.image.repository=nginx-ingress
222-
--set controller.image.tag=${{ github.sha }}
223-
--set controller.service.type=NodePort
224-
--set controller.nginxplus=false
225-
--wait
226-
working-directory: ${{ github.workspace }}/deployments/helm-chart
227-
- name: Expose Test Ingresses
228-
run: |
229-
kubectl port-forward service/oss-nginx-ingress ${{ env.NGINX_HTTP_PORT }}:80 &
230-
kubectl port-forward service/oss-nginx-ingress ${{ env.NGINX_HTTPS_PORT }}:443 &
231-
- name: Test HTTP
232-
run: |
233-
. tests/ci-files/helm-http-test.sh ${{ env.HELM_TEST_RETRIES }} ${{ env.NGINX_HTTP_PORT }}
234-
- name: Test HTTPS
235-
run: |
236-
. tests/ci-files/helm-http-test.sh ${{ env.HELM_TEST_RETRIES }} ${{ env.NGINX_HTTPS_PORT }} ${{ env.HELM_HTTP_POSTFIX }}
237-
238259
build-binaries:
239260
name: Build Binaries
240261
runs-on: ubuntu-20.04
@@ -306,6 +327,11 @@ jobs:
306327
GOPATH: ${{ needs.checks.outputs.go_path }}
307328
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
308329
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
330+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
331+
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
332+
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
333+
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
334+
309335
- name: Store Artifacts in Cache
310336
uses: actions/cache@v3
311337
with:
@@ -509,7 +535,9 @@ jobs:
509535
name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic${{ contains(matrix.image, 'nap') && '-dos' || '' }}/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/tags/') }}
510536
name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/staging/nginx-ic${{ contains(matrix.image, 'nap') && '-dos' || '' }}/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
511537
name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/tags/') && contains(matrix.target, 'aws') }}
512-
flavor: suffix=${{ contains(matrix.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.target, 'aws') && '-mktpl' || '' }},onlatest=true
538+
flavor: |
539+
suffix=${{ contains(matrix.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.target, 'aws') && '-mktpl' || '' }},onlatest=true
540+
latest=${{ contains(matrix.target, 'aws') && 'false' || 'auto' }}
513541
tags: |
514542
type=edge
515543
type=ref,event=branch,enable=${{ startsWith(github.ref, 'refs/heads/release') }}

.github/workflows/labeler.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: joshdales/labeler@4c74e8446142eeec7aa182f52ea24306a5479850 # if https://github.com/actions/labeler/pull/203 is merged, use the official action actions/labeler
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/release-drafter-pr.yml

-15
This file was deleted.

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
stale:
88
runs-on: ubuntu-20.04
99
steps:
10-
- uses: actions/stale@v5
10+
- uses: actions/stale@v6
1111
with:
1212
repo-token: ${{ secrets.GITHUB_TOKEN }}
1313
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.'

.goreleaser.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ builds:
4444

4545
archives:
4646
- id: kubernetes-ingress
47-
format: binary
4847
builds: [kubernetes-ingress]
4948

5049
changelog:
@@ -54,13 +53,23 @@ checksum:
5453
name_template: 'checksums.txt'
5554

5655
sboms:
57-
- artifacts: binary
56+
- artifacts: archive
5857
ids: [kubernetes-ingress]
5958

6059
release:
6160
ids: [kubernetes-ingress]
62-
extra_files:
63-
- glob: ./dist/**.sbom
61+
62+
blobs:
63+
- provider: azblob
64+
bucket: '{{.Env.AZURE_BUCKET_NAME}}'
65+
extra_files:
66+
- glob: ./dist/**.sbom
6467

6568
milestones:
6669
- close: true
70+
71+
announce:
72+
slack:
73+
enabled: true
74+
channel: '#announcements'
75+
message_template: 'NGINX Ingress Controller {{ .Tag }} is out! Check it out: {{ .ReleaseURL }}'

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
### 2.3.1
4+
5+
An automatically generated list of changes can be found on GitHub at: [2.3.1 Release](https://github.com/nginxinc/kubernetes-ingress/releases/tag/v2.3.1)
6+
7+
A curated list of changes can be found on the [Releases](http://docs.nginx.com/nginx-ingress-controller/releases/) page on the NGINX Documentation website.
8+
39
### 2.3.0
410

511
An automatically generated list of changes can be found on GitHub at: [2.3.0 Release](https://github.com/nginxinc/kubernetes-ingress/releases/tag/v2.3.0)

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ PREFIX = nginx/nginx-ingress## The name of the image. For example, nginx/nginx-i
1010
TAG = $(VERSION:v%=%)## The tag of the image. For example, 2.0.0
1111
TARGET ?= local## The target of the build. Possible values: local, container and download
1212
override DOCKER_BUILD_OPTIONS += --build-arg IC_VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT)## The options for the docker build command. For example, --pull.
13+
ARCH ?= amd64## The architecture of the image or binary. For example: amd64, arm64, ppc64le, s390x. Not all architectures are supported for all targets.
1314

1415
# final docker build command
15-
DOCKER_CMD = docker build $(strip $(DOCKER_BUILD_OPTIONS)) --target $(strip $(TARGET)) -f build/Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) .
16+
DOCKER_CMD = docker build --platform linux/$(ARCH) $(strip $(DOCKER_BUILD_OPTIONS)) --target $(strip $(TARGET)) -f build/Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) .
1617

1718
export DOCKER_BUILDKIT = 1
1819

@@ -71,7 +72,7 @@ build: ## Build Ingress Controller binary
7172
@docker -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with Docker\n"; exit $$code)
7273
ifeq (${TARGET},local)
7374
@go version || (code=$$?; printf "\033[0;31mError\033[0m: unable to build locally, try using the parameter TARGET=container or TARGET=download\n"; exit $$code)
74-
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o nginx-ingress github.com/nginxinc/kubernetes-ingress/cmd/nginx-ingress
75+
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o nginx-ingress github.com/nginxinc/kubernetes-ingress/cmd/nginx-ingress
7576
else ifeq (${TARGET},download)
7677
@$(MAKE) download-binary-docker
7778
endif
@@ -89,7 +90,7 @@ endif
8990
.PHONY: build-goreleaser
9091
build-goreleaser: ## Build Ingress Controller binary using GoReleaser
9192
@goreleaser -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with GoReleaser. Follow the docs to install it https://goreleaser.com/install\n"; exit $$code)
92-
GOOS=linux GOPATH=$(shell go env GOPATH) goreleaser build --rm-dist --debug --snapshot --id kubernetes-ingress --single-target
93+
GOOS=linux GOPATH=$(shell go env GOPATH) GOARCH=$(ARCH) goreleaser build --rm-dist --debug --snapshot --id kubernetes-ingress --single-target
9394

9495
.PHONY: debian-image
9596
debian-image: build ## Create Docker image for Ingress Controller (Debian)

0 commit comments

Comments
 (0)