Skip to content

Commit

Permalink
Merge branch 'main' into docs/generate-api-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Jun 10, 2024
2 parents 4ad03f6 + d7f63b8 commit 0a5137b
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: Build Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || '' }}
context: "."
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ jobs:
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: latest
args: build --snapshot --clean
args: build --single-target --snapshot --clean
env:
TELEMETRY_ENDPOINT: "" # disables sending telemetry
TELEMETRY_ENDPOINT_INSECURE: "false"

- name: Build NGF Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile
tags: ${{ steps.ngf-meta.outputs.tags }}
Expand All @@ -97,7 +97,7 @@ jobs:
pull: true

- name: Build NGINX Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || ''}}
tags: ${{ steps.nginx-meta.outputs.tags }}
Expand All @@ -116,7 +116,7 @@ jobs:
working-directory: ./tests

- name: Build Test Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: tests/conformance/Dockerfile
tags: conformance-test-runner:${{ github.sha }}
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ jobs:
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: latest
args: build --snapshot --clean
args: build --single-target --snapshot --clean
env:
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317
TELEMETRY_ENDPOINT_INSECURE: "true"

- name: Build NGF Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile
tags: ${{ steps.ngf-meta.outputs.tags }}
Expand All @@ -85,7 +85,7 @@ jobs:
target: goreleaser

- name: Build NGINX Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || ''}}
tags: ${{ steps.nginx-meta.outputs.tags }}
Expand All @@ -98,6 +98,14 @@ jobs:
NGINX_CONF_DIR=internal/mode/static/nginx/conf
BUILD_AGENT=gha
- name: Install cloud-provider-kind
run: |
curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.2.0/cloud-provider-kind_0.2.0_linux_amd64.tar.gz
tar -xvf cloud-provider-kind_0.2.0_linux_amd64.tar.gz
- name: Run cloud-provider-kind
run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1

- name: Deploy Kubernetes
id: k8s
run: |
Expand All @@ -108,12 +116,12 @@ jobs:
run: |
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
ngf_tag=${{ steps.ngf-meta.outputs.version }}
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry GW_SERVICE_TYPE=LoadBalancer
working-directory: ./tests

- name: Run functional tests
run: |
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
ngf_tag=${{ steps.ngf-meta.outputs.version }}
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GW_SERVICE_TYPE=LoadBalancer
working-directory: ./tests
4 changes: 2 additions & 2 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
- name: Build NGF Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile
tags: ${{ steps.ngf-meta.outputs.tags }}
Expand All @@ -71,7 +71,7 @@ jobs:
pull: true

- name: Build NGINX Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || ''}}
tags: ${{ steps.nginx-meta.outputs.tags }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nfr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

- name: Build NGINX Plus Docker Image
if: ${{ inputs.nginx_plus == true }}
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
file: build/Dockerfile.nginxplus
tags: ${{ steps.nginx-meta.outputs.tags }}
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN make build

FROM golang:1.22 as ca-certs-provider

FROM alpine:3.19 as capabilizer
FROM alpine:3.20 as capabilizer
RUN apk add --no-cache libcap

FROM capabilizer as local-capabilizer
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.nginxplus
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM scratch as nginx-files
ADD --link --chown=101:1001 https://cs.nginx.com/static/keys/nginx_signing.rsa.pub nginx_signing.rsa.pub


FROM alpine:3.19
FROM alpine:3.20

ARG NGINX_PLUS_VERSION=R32
ARG NJS_DIR
Expand Down
110 changes: 110 additions & 0 deletions tests/reconfig/results/1.3.0/1.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Reconfiguration testing Results

<!-- TOC -->
- [Reconfiguration testing Results](#reconfiguration-testing-results)
- [Summary](#summary)
- [Test environment](#test-environment)
- [Results Tables](#results-tables)
- [NGINX Reloads and Time to Ready](#nginx-reloads-and-time-to-ready)
- [Event Batch Processing](#event-batch-processing)
- [NumResources to Total Resources](#numresources-to-total-resources)
- [Observations](#observations)
- [Future Improvements](#future-improvements)
<!-- TOC -->

## Summary

- Due to fix https://github.com/nginxinc/nginx-gateway-fabric/issues/1107, time to ready, reload time, and event batch processing
time increased for all 150 resource tests.
- For all 30 resource tests, results were mostly consistent to prior results.

## Test environment

GKE cluster:

- Node count: 3
- Instance Type: e2-medium
- k8s version: 1.28.9-gke.1000000
- Zone: us-central1-c
- Total vCPUs: 6
- Total RAM: 12GB
- Max pods per node: 110

NGF deployment:

- NGF version: edge - git commit 7c9bf23ed89861c9ce7b725f2c1686f4c24ef2f9
- NGINX OSS Version: 1.27.0
- NGINX Plus Version: R32

## Results Tables

### NGINX Reloads and Time to Ready

#### OSS

| Test number | NumResources | TimeToReadyTotal (s) | TimeToReadyAvgSingle (s) | NGINX reloads | NGINX reload avg time (ms) | <= 500ms | <= 1000ms |
|-------------|--------------|----------------------|--------------------------|---------------|----------------------------|----------|-----------|
| 1 | 30 | 2 | <1 | 2 | 190 | 100% | 100% |
| 1 | 150 | 2 | <1 | 2 | 542 | 50% | 100% |
| 2 | 30 | 37 | <1 | 94 | 169 | 100% | 100% |
| 2 | 150 | 204 | <1 | 387 | 326 | 88% | 100% |
| 3 | 30 | <1 | <1 | 94 | 129 | 100% | 100% |
| 3 | 150 | <1 | <1 | 454 | 130 | 100% | 100% |

#### Plus

| Test number | NumResources | TimeToReadyTotal (s) | TimeToReadyAvgSingle (s) | NGINX reloads | NGINX reload avg time (ms) | <= 500ms | <= 1000ms |
|-------------|--------------|----------------------|--------------------------|---------------|----------------------------|----------|-----------|
| 1 | 30 | 1 | <1 | 2 | 220.5 | 100% | 100% |
| 1 | 150 | 1.5 | <1 | 2 | 528.5 | 50% | 100% |
| 2 | 30 | 41 | <1 | 94 | 176.8 | 100% | 100% |
| 2 | 150 | 199 | <1 | 391 | 320.56 | 94.1% | 100% |
| 3 | 30 | <1 | <1 | 94 | 128.5 | 100% | 100% |
| 3 | 150 | <1 | <1 | 454 | 129.2 | 100% | 100% |

### Event Batch Processing

#### OSS

| Test number | NumResources | Event Batch Total | Event Batch Processing avg time (ms) | <= 500ms | <= 1000ms | <= 5000ms | <= 10000ms | <= 30000ms |
|-------------|--------------|-------------------|--------------------------------------|----------|-----------|-----------|------------|------------|
| 1 | 30 | 5 | 726.6 | 80% | 80% | 100% | 100% | 100% |
| 1 | 150 | 5 | 4457 | 40% | 80% | 80% | 80% | 100% |
| 2 | 30 | 371 | 59.5 | 99.7% | 100% | 100% | 100% | 100% |
| 2 | 150 | 1742 | 93.5 | 92.9% | 99.99% | 100% | 100% | 100% |
| 3 | 30 | 370 | 43.9 | 99.85% | 99.85% | 100% | 100% | 100% |
| 3 | 150 | 1810 | 44.8 | 99.99% | 99.99% | 99.99% | 100% | 100% |

#### Plus

| Test number | NumResources | Event Batch Total | Event Batch Processing avg time (ms) | <= 500ms | <= 1000ms | <= 5000ms | <= 10000ms | <= 30000ms |
|-------------|--------------|-------------------|--------------------------------------|----------|-----------|-----------|------------|--------------|
| 1 | 30 | 6 | 84 | 100% | 100% | 100% | 100% | 100% |
| 1 | 150 | 5 | 4544.3 | 40% | 80% | 80% | 80% | 100% |
| 2 | 30 | 370 | 59.1 | 100% | 100% | 100% | 100% | 100% |
| 2 | 150 | 1747 | 93.2 | 94.1% | 99.99% | 100% | 100% | 100% |
| 3 | 30 | 370 | 41.33 | 99.99% | 99.99% | 100% | 100% | 100% |
| 3 | 150 | 1809 | 44.88 | 99.99% | 99.99% | 99.99% | 99.99% | 100% |

## NumResources to Total Resources

| NumResources | Gateways | Secrets | ReferenceGrants | Namespaces | application Pods | application Services | HTTPRoutes | Total Resources |
|--------------|----------|---------|-----------------|------------|------------------|----------------------|------------|-----------------|
| x | 1 | 1 | 1 | x+1 | 2x | 2x | 3x | <total> |
| 30 | 1 | 1 | 1 | 31 | 60 | 60 | 90 | 244 |
| 150 | 1 | 1 | 1 | 151 | 300 | 300 | 450 | 1204 |

## Observations

1. Reload time and time to ready have increased in 150 resource tests. This is probably due, in part, to the fix of https://github.com/nginxinc/nginx-gateway-fabric/issues/1107 causing the prior
test to only attach 2x of the HTTPRoutes while this test attaches all of them. In the 30 resource tests, results were mostly consistent to prior results.

2. Event batch processing time increased notably in the 150 resource tests, probably for the same reason mentioned in observation #1.
In the 30 resource tests, results were mostly consistent to prior results.

3. No errors in the logs.


## Future Improvements

None.
6 changes: 3 additions & 3 deletions tests/reconfig/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The following cluster will be sufficient:

```console
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric --version 0.0.0-edge \
--create-namespace --wait -n nginx-gateway --set nginxGateway.config.logging.level=debug
--create-namespace --wait -n nginx-gateway --set nginxGateway.productTelemetry.enable=false
```

4. Run tests:
Expand All @@ -67,7 +67,7 @@ The following cluster will be sufficient:
Note: You can expose metrics by running the below snippet and then navigating to `127.0.0.1:9113/metrics`:

```console
GW_POD=$(k get pods -n nginx-gateway | sed -n '2s/^\([^[:space:]]*\).*$/\1/p')
GW_POD=$(kubectl get pods -n nginx-gateway | sed -n '2s/^\([^[:space:]]*\).*$/\1/p')
kubectl port-forward $GW_POD -n nginx-gateway 9113:9113 &
```

Expand Down Expand Up @@ -105,7 +105,7 @@ The following cluster will be sufficient:
2. Run the provided script with the required number of resources,
e.g. `cd scripts && bash create-resources-routes-last.sh 30`. The script will deploy backend apps and services,
wait 60 seconds for them to be ready, and deploy 1 Gateway, 1 Secret, 1 RefGrant, and HTTPRoutes at the same time.
3. Measure TimeToReadyTotal as the time it takes from NGF receiving the first HTTPRoute resource update -> final
3. Measure TimeToReadyTotal as the time it takes from NGF receiving the first HTTPRoute resource update (logs will say "reconciling") -> final
config written and NGINX reloaded. Measure the other results as described in steps 6-7 of the [Setup](#setup) section.

### Test 3: Start NGF, create many resources attached to a Gateway, deploy the Gateway
Expand Down

0 comments on commit 0a5137b

Please sign in to comment.