Skip to content

Commit 1e14589

Browse files
committed
Add Gateway API CRDs to the repo with kustomize
1 parent 0ecd7d0 commit 1e14589

File tree

16 files changed

+68
-100
lines changed

16 files changed

+68
-100
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ jobs:
309309
make create-kind-cluster KIND_KUBE_CONFIG=${kube_config}
310310
echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV"
311311
kind load docker-image ghcr.io/nginxinc/nginx-gateway-fabric:${{ steps.ngf-meta.outputs.version }} ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${{ steps.nginx-meta.outputs.version }}
312-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
312+
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f -
313313
314314
- name: Install Chart
315315
run: >

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ TELEMETRY_REPORT_PERIOD = 24h
1717
TELEMETRY_ENDPOINT=# if empty, NGF will report telemetry in its logs at debug level.
1818
TELEMETRY_ENDPOINT_INSECURE = false
1919

20-
GW_API_VERSION = 1.1.0
2120
ENABLE_EXPERIMENTAL ?= false
2221
NODE_VERSION = $(shell cat .nvmrc)
2322

@@ -112,15 +111,15 @@ generate-crds: ## Generate CRDs and Go types using kubebuilder
112111

113112
.PHONY: install-crds
114113
install-crds: ## Install CRDs
115-
kubectl kustomize config/crd | kubectl apply -f -
114+
kubectl kustomize $(SELF_DIR)config/crd | kubectl apply -f -
116115

117116
.PHONY: install-gateway-crds
118117
install-gateway-crds: ## Install Gateway API CRDs
119-
$(SELF_DIR)tests/scripts/install-gateway.sh $(GW_API_VERSION) $(ENABLE_EXPERIMENTAL)
118+
kubectl kustomize $(SELF_DIR)config/crd/gateway-api/$(if $(filter true,$(ENABLE_EXPERIMENTAL)),experimental,standard) | kubectl apply -f -
120119

121120
.PHONY: uninstall-gateway-crds
122121
uninstall-gateway-crds: ## Uninstall Gateway API CRDs
123-
$(SELF_DIR)tests/scripts/uninstall-gateway.sh $(GW_API_VERSION) $(ENABLE_EXPERIMENTAL)
122+
kubectl kustomize $(SELF_DIR)config/crd/gateway-api/$(if $(filter true,$(ENABLE_EXPERIMENTAL)),experimental,standard) | kubectl delete -f -
124123

125124
.PHONY: generate-manifests
126125
generate-manifests: ## Generate manifests using Helm.

charts/nginx-gateway-fabric/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This chart deploys the NGINX Gateway Fabric in your Kubernetes cluster.
4040
> [see the Technical Specifications](https://github.com/nginxinc/nginx-gateway-fabric/blob/main/README.md#technical-specifications).
4141
4242
```shell
43-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
43+
kubectl kustomize https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard | kubectl apply -f -
4444
```
4545

4646
## Installing the Chart
@@ -128,7 +128,7 @@ Gateway Fabric - [see the Technical Specifications](../../README.md#technical-sp
128128
To upgrade the Gateway CRDs from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:
129129

130130
```shell
131-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
131+
kubectl kustomize https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard | kubectl apply -f -
132132
```
133133

134134
### Upgrading the CRDs
@@ -238,7 +238,7 @@ These commands remove all the Kubernetes components associated with the release
238238
To delete the Gateway API CRDs from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:
239239

240240
```shell
241-
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
241+
kubectl kustomize https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard | kubectl delete -f -
242242
```
243243

244244
## Configuration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- https://github.com/kubernetes-sigs/gateway-api/config/crd/experimental?timeout=120&ref=v1.1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- https://github.com/kubernetes-sigs/gateway-api/config/crd?timeout=120&ref=v1.1.0

config/crd/kustomization.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
13
resources:
24
- bases/gateway.nginx.org_clientsettingspolicies.yaml
35
- bases/gateway.nginx.org_nginxgateways.yaml

docs/developer/quickstart.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ This will build the docker images `nginx-gateway-fabric:<your-user>` and `nginx-
133133
3. Install Gateway API CRDs:
134134

135135
```shell
136-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
136+
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f -
137137
```
138138

139139
If you're implementing experimental Gateway API features, install Gateway API CRDs from the experimental channel:
140140

141141
```shell
142-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml
142+
kubectl kustomize config/crd/gateway-api/experimental | kubectl apply -f -
143143
```
144144

145145
4. Install NGF using your custom image and expose NGF with a NodePort Service:

docs/developer/release-process.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ To create a new release, follow these steps:
3737
7. Create a release branch following the `release-X.Y` naming convention.
3838
8. Run the [Release PR](./../../.github/workflows/release-pr.yml) workflow to update the repo files for the release. Then there are a few manual steps to complete:
3939
1. Update the tag of NGF container images used in the [provisioner manifest](/tests/conformance/provisioner/provisioner.yaml).
40-
2. Update any installation instructions to ensure that the supported Gateway API is correct.
41-
Specifically, helm README and `site/content/includes/installation/install-gateway-api-resources.md`.
42-
3. Update the [README](/README.md) to include information about the release.
43-
4. Update the [changelog](/CHANGELOG.md). There is going to be a new blank section generated by the automation that needs to be adjusted accordingly.
40+
2. Update the [README](/README.md) to include information about the release.
41+
3. Update the [changelog](/CHANGELOG.md). There is going to be a new blank section generated by the automation that needs to be adjusted accordingly.
4442
The changelog includes only important (from the user perspective)
4543
changes to NGF. This is in contrast with the autogenerated full changelog, which is created in the next
4644
step. As a starting point, copy the important features, bug fixes, and dependencies from the autogenerated
@@ -51,14 +49,13 @@ To create a new release, follow these steps:
5149
- Build NGF, NGINX and NGINX Plus container images with the release tag `X.Y.Z` and push them to the registries.
5250
- Package and publish the Helm chart to the registry.
5351
- Create a GitHub release with an autogenerated changelog and attached release artifacts.
54-
10. Prepare and merge a PR into the main branch to update with similar information that you did in the release
55-
branch docs PR. Specifically:
56-
1. [README](/README.md) to include the information about the latest release.
57-
2. [changelog](/CHANGELOG.md).
58-
3. Helm chart `version` field.
59-
4. `VERSION` in top-level Makefile.
60-
5. Any references in the docs to the previous release.
61-
6. Any installation instructions to ensure that the supported Gateway API and NGF versions are correct.Specifically, helm README and `site/content/includes/installation/install-gateway-api-resources.md`.
52+
10. Prepare and merge a PR into the main branch to update with similar information that you did in the release branch docs PR. Specifically:
53+
1. [README](/README.md) to include the information about the latest release.
54+
2. [changelog](/CHANGELOG.md).
55+
3. Helm chart `version` field.
56+
4. `VERSION` in top-level Makefile.
57+
5. Any references in the docs to the previous release.
58+
6. Any installation instructions to ensure that the supported Gateway API and NGF versions are correct. Specifically, helm README.
6259
11. Ask the docs team to update the production branch for NGF in Netlify to our latest release branch and run the deployment pipeline.
6360
12. Close the issue created in Step 1.
6461
13. Ensure that the [associated milestone](https://github.com/nginxinc/nginx-gateway-fabric/milestones) is closed.

site/content/includes/installation/install-gateway-api-resources.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ docs: "DOCS-1438"
77
To install the Gateway API resources, run the following:
88

99
```shell
10-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
10+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard?ref=v1.2.0" | kubectl apply -f -
1111
```
1212

13+
{{<note>}}If you plan to use the `edge` version of NGINX Gateway Fabric, you can replace the vesion in `ref` with `main`, for example `ref=main`.{{</note>}}
14+
1315
Alternatively, you can install the Gateway API resources from the experimental channel. We support a subset of the
1416
additional features provided by the experimental channel. To install from the experimental channel, run the following:
1517

1618
```shell
17-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml
19+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/experimental?ref=v1.2.0" | kubectl apply -f -
1820
```

site/content/includes/installation/uninstall-gateway-api-resources.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
docs: "DOCS-1436"
33
---
44

5-
{{<warning>}}This will remove all corresponding custom resources in your entire cluster, across all namespaces. Double-check to make sure you don't have any custom resources you need to keep, and confirm that there are no other Gateway API implementations active in your cluster.{{</warning>}}
5+
{{<warning>}}This will remove all corresponding custom resources in your entire cluster, across all namespaces. Double-check to make sure you don't have any custom resources you need to keep, and confirm that there are no other Gateway API implementations active in your cluster.{{</warning>}}
66

7-
To uninstall the Gateway API resources, run the following:
7+
To uninstall the Gateway API resources, run the following:
88

9-
```shell
10-
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
11-
```
9+
```shell
10+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/experimental?ref=v1.2.0" | kubectl delete -f -
11+
```
1212

13-
Alternatively, if you installed the Gateway APIs from the experimental channel, run the following:
13+
Alternatively, if you installed the Gateway APIs from the experimental channel, run the following:
1414

15-
```shell
16-
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml
17-
```
15+
```shell
16+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/experimental?ref=v1.2.0" | kubectl delete -f -
17+
```

site/content/installation/installing-ngf/helm.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@ To upgrade NGINX Gateway Fabric and get the latest features and improvements, ta
126126
To upgrade your Gateway API resources, take the following steps:
127127

128128
- Verify the Gateway API resources are compatible with your NGINX Gateway Fabric version. Refer to the [Technical Specifications]({{< relref "reference/technical-specifications.md" >}}) for details.
129-
- Review the [release notes](https://github.com/kubernetes-sigs/gateway-api/releases/tag/v1.1.0) for any important upgrade-specific information.
129+
- Review the [release notes](https://github.com/kubernetes-sigs/gateway-api/releases) for any important upgrade-specific information.
130130
- To upgrade the Gateway API resources, run:
131131

132132
```shell
133-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
133+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard?ref=v1.2.0" | kubectl apply -f -
134134
```
135135

136136
or, if you installed the from the experimental channel:
137137

138138
```shell
139-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml
139+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/experimental?ref=v1.2.0" | kubectl apply -f -
140140
```
141141

142142
### Upgrade NGINX Gateway Fabric CRDs

site/content/installation/installing-ngf/manifests.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ To upgrade NGINX Gateway Fabric and get the latest features and improvements, ta
131131
- To upgrade the Gateway API resources, run:
132132

133133
```shell
134-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
134+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard?ref=v1.2.0" | kubectl apply -f -
135135
```
136136

137137
or, if you installed the from the experimental channel:
138138

139139
```shell
140-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml
140+
kubectl kustomize "https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/experimental?ref=v1.2.0" | kubectl apply -f -
141141
```
142142

143143
1. **Upgrade NGINX Gateway Fabric CRDs:**

tests/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CONFORMANCE_TAG = latest## Tag for the conformance test runner image
44
GATEWAY_CLASS = nginx## Gateway class to use
55
GINKGO_FLAGS =
66
GINKGO_LABEL =
7+
GW_API_VERSION ?= $(shell yq eval '.resources[0] | split("ref=v") | .[1]' ../config/crd/gateway-api/standard/kustomization.yaml)## Supported Gateway API version from current NGF
78
GW_API_PREV_VERSION ?= 1.0.0## Supported Gateway API version from previous NGF release
89
GW_SERVICE_TYPE=NodePort## Service type to use for the gateway
910
GW_SVC_GKE_INTERNAL=false
@@ -159,6 +160,13 @@ deploy-updated-provisioner: ## Update provisioner manifest and deploy to the con
159160
generate-static-deployment:
160161
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) --set nginx.plus=$(PLUS_ENABLED) > $(SELF_DIR)config/tests/static-deployment.yaml
161162

163+
# this target is used to install the gateway-api CRDs from the main branch (only used in the nightly CI job)
164+
# it overrides the target in the main Makefile when the GW_API_VERSION is set to main
165+
ifeq ($(GW_API_VERSION),main)
166+
install-gateway-crds:
167+
kubectl kustomize "https://github.com/kubernetes-sigs/gateway-api/config/crd/$(if $(filter true,$(ENABLE_EXPERIMENTAL)),experimental,)?timeout=120&ref=main" | kubectl apply -f -
168+
endif
169+
162170
.PHONY: install-ngf-local-build
163171
install-ngf-local-build: deploy-updated-provisioner
164172

tests/reconfig/setup.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424

2525
## Test Environment
2626

27-
The following cluster will be sufficient:
27+
The following cluster will be sufficient:
2828

2929
- A Kubernetes cluster with 4 nodes on GKE
3030
- Node: e2-medium (2 vCPU, 4GB memory)
3131

3232
## Setup
3333

3434
1. Create cloud cluster
35-
2. Deploy CRDs:
35+
2. Install Gateway API Resources:
3636

3737
```bash
38-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
38+
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f -
3939
```
4040

4141
3. Deploy NGF from edge using Helm install and wait for LoadBalancer Service to be ready
@@ -59,16 +59,17 @@
5959
fixtures `scripts/delete-multiple.sh` which takes a number (needs to be the same number as what was used in the
6060
create script.)
6161
5. After each individual test:
62-
- Describe the Gateway resource and make sure the status is correct.
63-
- Check the logs of both NGF containers for errors.
64-
- Parse the logs for TimeToReady numbers (see steps 6-7 below).
65-
- Grab metrics.
66-
Note: You can expose metrics by running the below snippet and then navigating to `127.0.0.1:9113/metrics`:
67-
68-
```console
69-
GW_POD=$(k get pods -n nginx-gateway | sed -n '2s/^\([^[:space:]]*\).*$/\1/p')
70-
kubectl port-forward $GW_POD -n nginx-gateway 9113:9113 &
71-
```
62+
63+
- Describe the Gateway resource and make sure the status is correct.
64+
- Check the logs of both NGF containers for errors.
65+
- Parse the logs for TimeToReady numbers (see steps 6-7 below).
66+
- Grab metrics.
67+
Note: You can expose metrics by running the below snippet and then navigating to `127.0.0.1:9113/metrics`:
68+
69+
```console
70+
GW_POD=$(k get pods -n nginx-gateway | sed -n '2s/^\([^[:space:]]*\).*$/\1/p')
71+
kubectl port-forward $GW_POD -n nginx-gateway 9113:9113 &
72+
```
7273

7374
6. Measure NGINX Reloads and Time to Ready Results
7475
1. TimeToReadyTotal as described in each test - NGF logs.

tests/scripts/install-gateway.sh

-24
This file was deleted.

tests/scripts/uninstall-gateway.sh

-25
This file was deleted.

0 commit comments

Comments
 (0)