Skip to content

Commit b3dbca2

Browse files
committed
Review feedback and add CI check
1 parent 3166dce commit b3dbca2

19 files changed

+80
-106
lines changed

.github/workflows/ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@ jobs:
5252
- name: Check if go.mod and go.sum are up to date
5353
run: go mod tidy && git diff --exit-code -- go.mod go.sum
5454

55-
- name: Check if generated files are up to date
55+
- name: Check if generated go files are up to date
5656
run: make generate && git diff --exit-code
5757

5858
- name: Check if njs-modules yaml is up to date
5959
run: make generate-njs-yaml && git diff --exit-code
6060

61+
- name: Check if generated manifests are up to date
62+
run: make generate-manifests && git diff --exit-code
63+
6164
unit-tests:
6265
name: Unit Tests
6366
runs-on: ubuntu-22.04

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ TARGET ?= local## The target of the build. Possible values: local and container
1818
KIND_KUBE_CONFIG=$${HOME}/.kube/kind/config## The location of the kind kubeconfig
1919
OUT_DIR ?= $(shell pwd)/build/out## The folder where the binary will be stored
2020
ARCH ?= amd64## The architecture of the image and/or binary. For example: amd64 or arm64
21-
override HELM_TEMPLATE_COMMON_ARGS += --set creator=template --set nameOverride=nginx-gateway ## The common options for the Helm template command.
22-
override HELM_TEMPLATE_EXTRA_ARGS += --set service.create=false ## The options to be passed to the full Helm templating command only.
21+
override HELM_TEMPLATE_COMMON_ARGS += --set creator=template --set nameOverride=nginx-gateway## The common options for the Helm template command.
22+
override HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE += --set service.create=false## The options to be passed to the full Helm templating command only.
2323
override DOCKER_BUILD_OPTIONS += --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) --build-arg DATE=$(DATE)## The options for the docker build command. For example, --pull
2424

2525
.DEFAULT_GOAL := help
@@ -121,11 +121,11 @@ debug-container: debug-build container ## Build container with debug binary
121121

122122
.PHONY: generate-manifests
123123
generate-manifests: ## Generate manifests using Helm.
124-
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-gateway.yaml
124+
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-gateway.yaml
125125
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/deployment.yaml > conformance/provisioner/static-deployment.yaml
126126
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer.yaml
127127
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.annotations.'service\.beta\.kubernetes\.io\/aws-load-balancer-type'="nlb" -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer-aws-nlb.yaml
128-
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.type=NodePort -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/nodeport.yaml
128+
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.type=NodePort --set service.externalTrafficPolicy="" -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/nodeport.yaml
129129

130130
.PHONY: dev-all
131131
dev-all: deps fmt njs-fmt vet lint unit-test njs-unit-test ## Run all the development checks

conformance/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ preload-nginx-container: ## Preload NGINX container on configured kind cluster
3838
kind load docker-image $(NGINX_IMAGE)
3939

4040
.PHONY: update-nkg-manifest
41-
update-nkg-manifest:
42-
cd .. && make generate-manifests HELM_TEMPLATE_EXTRA_ARGS="--set nginxGateway.kind=skip" HELM_TEMPLATE_COMMON_ARGS="--set nginxGateway.image.repository=$(NKG_PREFIX) --set nginxGateway.image.tag=$(NKG_TAG) --set nginxGateway.image.pullPolicy=Never" && cd -
41+
update-nkg-manifest: ## Update the NKG deployment manifest image name and imagePullPolicy
42+
cd .. && make generate-manifests HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE="--set nginxGateway.kind=skip" HELM_TEMPLATE_COMMON_ARGS="--set nginxGateway.image.repository=$(NKG_PREFIX) --set nginxGateway.image.tag=$(NKG_TAG) --set nginxGateway.image.pullPolicy=Never" && cd -
4343

4444
.PHONY: build-nkg-image
4545
build-nkg-image: ## Build NKG container and load it and NGINX container on configured kind cluster

conformance/README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ run-conformance-tests Run conformance tests
3434
undo-manifests-update Undo the changes in the manifest files
3535
uninstall-nkg Uninstall NKG on configured kind cluster and undo manifest changes
3636
update-go-modules Update the gateway-api go modules to latest main version
37+
update-nkg-manifest Update the NKG deployment manifest image name and imagePullPolicy
3738
```
3839

3940
**Note:** The following variables are configurable when running the below `make` commands:
@@ -49,11 +50,11 @@ update-go-modules Update the gateway-api go modules to latest main
4950
| GATEWAY_CLASS | nginx | The gateway class that should be used for the tests |
5051
| SUPPORTED_FEATURES | HTTPRoute,HTTPRouteQueryParamMatching, HTTPRouteMethodMatching,HTTPRoutePortRedirect, HTTPRouteSchemeRedirect | The supported features that should be tested by the conformance tests. Ensure the list is comma separated with no spaces. |
5152
| EXEMPT_FEATURES | ReferenceGrant | The features that should not be tested by the conformance tests |
52-
| NGINX_IMAGE | as defined in the provisioner/static-deployment.yaml file | The NGINX image for the NKG deployments |
53-
| NKG_MANIFEST | ../deploy/manifests/nginx-gateway.yaml | The location of the NKG manifest |
54-
| SERVICE_MANIFEST | ../deploy/manifests/service/nodeport.yaml | The location of the NKG Service manifest |
55-
| STATIC_MANIFEST | provisioner/static-deployment.yaml | The location of the NKG static deployment manifest |
56-
| PROVISIONER_MANIFEST | provisioner/provisioner.yaml | The location of the NKG provisioner manifest |
53+
| NGINX_IMAGE | as defined in the provisioner/static-deployment.yaml file | The NGINX image for the NKG deployments |
54+
| NKG_MANIFEST | ../deploy/manifests/nginx-gateway.yaml | The location of the NKG manifest |
55+
| SERVICE_MANIFEST | ../deploy/manifests/service/nodeport.yaml | The location of the NKG Service manifest |
56+
| STATIC_MANIFEST | provisioner/static-deployment.yaml | The location of the NKG static deployment manifest |
57+
| PROVISIONER_MANIFEST | provisioner/provisioner.yaml | The location of the NKG provisioner manifest |
5758

5859
### Step 1 - Create a kind Cluster
5960

@@ -85,7 +86,7 @@ You can optionally skip the actual *build* step.
8586
make install-nkg-local-no-build
8687
```
8788

88-
> Note: If choosing this option, the following step *must* be completed manually *before* the build step:
89+
> Note: If choosing this option, the following step *must* be completed manually *before* you build the image:
8990
9091
```makefile
9192
make update-nkg-manifest NKG_PREFIX=<nkg_repo_name> NKG_TAG=<nkg_image_tag>

conformance/provisioner/static-deployment.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ metadata:
88
labels:
99
app.kubernetes.io/name: nginx-gateway
1010
app.kubernetes.io/instance: nginx-gateway
11-
app.kubernetes.io/version: "0.5.0"
11+
app.kubernetes.io/version: "edge"
1212
spec:
1313
# We only support a single replica for now
1414
replicas: 1
1515
selector:
1616
matchLabels:
17-
app: nginx-gateway
1817
app.kubernetes.io/name: nginx-gateway
1918
app.kubernetes.io/instance: nginx-gateway
2019
template:
2120
metadata:
2221
labels:
23-
app: nginx-gateway
2422
app.kubernetes.io/name: nginx-gateway
2523
app.kubernetes.io/instance: nginx-gateway
2624
spec:

deploy/helm-chart/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: nginx-kubernetes-gateway
33
description: NGINX Kubernetes Gateway
44
type: application
55
version: 0.1.0
6-
appVersion: "0.5.0"
6+
appVersion: "edge"
77
home: https://github.com/nginxinc/nginx-kubernetes-gateway
88
icon: https://raw.githubusercontent.com/nginxinc/nginx-kubernetes-gateway/tree/main/deploy/helm-chart/chart-icon.png
99
sources:

deploy/helm-chart/README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ This chart deploys the NGINX Kubernetes Gateway in your Kubernetes cluster.
99
- [Helm 3.0+](https://helm.sh/docs/intro/install/)
1010
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
1111

12-
> Note: NGINX Kubernetes Gateway can only run in the `nginx-gateway` namespace. This limitation will be addressed in
13-
the future releases.
14-
1512
### Installing the Gateway API resources
1613

1714
> Note: The Gateway API resources from the standard channel (the CRDs and the validating webhook) must be installed
@@ -115,7 +112,7 @@ The following tables lists the configurable parameters of the NGINX Kubernetes G
115112
|`nginxGateway.image.pullPolicy` | The `imagePullPolicy` for the NGINX Kubernetes Gateway image. | Always |
116113
|`nginxGateway.gatewayClassName` | The name of the GatewayClass for the NGINX Kubernetes Gateway deployment. | nginx |
117114
|`nginxGateway.gatewayControllerName` | The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain is k8s-gateway.nginx.org. | k8s-gateway.nginx.org/nginx-gateway-controller |
118-
|`nginxGateway.kind` | The kind of the NGINX Kubernetes Gateway installation - currently, only deployment is supported. | deployment |
115+
|`nginxGateway.kind` | The kind of the NGINX Kubernetes Gateway installation - currently, only Deployment is supported. | deployment |
119116
|`nginx.image.repository` | The repository for the NGINX image. | nginx |
120117
|`nginx.image.tag` | The tag for the NGINX image. | 1.25 |
121118
|`nginx.image.pullPolicy` | The `imagePullPolicy` for the NGINX image. | Always |

deploy/helm-chart/templates/deployment.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ spec:
1111
replicas: 1
1212
selector:
1313
matchLabels:
14-
app: nginx-gateway
1514
{{- include "nginx-gateway.selectorLabels" . | nindent 6 }}
1615
template:
1716
metadata:
1817
labels:
19-
app: nginx-gateway
2018
{{- include "nginx-gateway.selectorLabels" . | nindent 8 }}
2119
spec:
2220
containers:

deploy/helm-chart/templates/service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
type: {{ .Values.service.type }}
2020
selector:
2121
{{- include "nginx-gateway.selectorLabels" . | nindent 4 }}
22-
ports:
22+
ports: # Update the following ports to match your Gateway Listener ports
2323
{{- if .Values.service.ports }}
2424
{{ toYaml .Values.service.ports | indent 2 }}
2525
{{ end }}

deploy/manifests/nginx-gateway.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ metadata:
1212
labels:
1313
app.kubernetes.io/name: nginx-gateway
1414
app.kubernetes.io/instance: nginx-gateway
15-
app.kubernetes.io/version: "0.5.0"
15+
app.kubernetes.io/version: "edge"
1616
annotations:
1717
{}
1818
---
@@ -25,7 +25,7 @@ metadata:
2525
labels:
2626
app.kubernetes.io/name: nginx-gateway
2727
app.kubernetes.io/instance: nginx-gateway
28-
app.kubernetes.io/version: "0.5.0"
28+
app.kubernetes.io/version: "edge"
2929
data:
3030
nginx.conf: |-
3131
load_module /usr/lib/nginx/modules/ngx_http_js_module.so;
@@ -52,7 +52,7 @@ metadata:
5252
labels:
5353
app.kubernetes.io/name: nginx-gateway
5454
app.kubernetes.io/instance: nginx-gateway
55-
app.kubernetes.io/version: "0.5.0"
55+
app.kubernetes.io/version: "edge"
5656
data:
5757
httpmatches.js: |
5858
const MATCHES_VARIABLE = 'http_matches';
@@ -271,7 +271,7 @@ metadata:
271271
labels:
272272
app.kubernetes.io/name: nginx-gateway
273273
app.kubernetes.io/instance: nginx-gateway
274-
app.kubernetes.io/version: "0.5.0"
274+
app.kubernetes.io/version: "edge"
275275
rules:
276276
- apiGroups:
277277
- ""
@@ -330,7 +330,7 @@ metadata:
330330
labels:
331331
app.kubernetes.io/name: nginx-gateway
332332
app.kubernetes.io/instance: nginx-gateway
333-
app.kubernetes.io/version: "0.5.0"
333+
app.kubernetes.io/version: "edge"
334334
roleRef:
335335
apiGroup: rbac.authorization.k8s.io
336336
kind: ClusterRole
@@ -349,19 +349,17 @@ metadata:
349349
labels:
350350
app.kubernetes.io/name: nginx-gateway
351351
app.kubernetes.io/instance: nginx-gateway
352-
app.kubernetes.io/version: "0.5.0"
352+
app.kubernetes.io/version: "edge"
353353
spec:
354354
# We only support a single replica for now
355355
replicas: 1
356356
selector:
357357
matchLabels:
358-
app: nginx-gateway
359358
app.kubernetes.io/name: nginx-gateway
360359
app.kubernetes.io/instance: nginx-gateway
361360
template:
362361
metadata:
363362
labels:
364-
app: nginx-gateway
365363
app.kubernetes.io/name: nginx-gateway
366364
app.kubernetes.io/instance: nginx-gateway
367365
spec:
@@ -449,6 +447,6 @@ metadata:
449447
labels:
450448
app.kubernetes.io/name: nginx-gateway
451449
app.kubernetes.io/instance: nginx-gateway
452-
app.kubernetes.io/version: "0.5.0"
450+
app.kubernetes.io/version: "edge"
453451
spec:
454452
controllerName: k8s-gateway.nginx.org/nginx-gateway-controller

deploy/manifests/service/loadbalancer-aws-nlb.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
labels:
99
app.kubernetes.io/name: nginx-gateway
1010
app.kubernetes.io/instance: nginx-gateway
11-
app.kubernetes.io/version: "0.5.0"
11+
app.kubernetes.io/version: "edge"
1212
annotations:
1313
service.beta.kubernetes.io/aws-load-balancer-type: nlb
1414
spec:
@@ -17,7 +17,7 @@ spec:
1717
selector:
1818
app.kubernetes.io/name: nginx-gateway
1919
app.kubernetes.io/instance: nginx-gateway
20-
ports:
20+
ports: # Update the following ports to match your Gateway Listener ports
2121
- name: http
2222
port: 80
2323
protocol: TCP

deploy/manifests/service/loadbalancer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ metadata:
88
labels:
99
app.kubernetes.io/name: nginx-gateway
1010
app.kubernetes.io/instance: nginx-gateway
11-
app.kubernetes.io/version: "0.5.0"
11+
app.kubernetes.io/version: "edge"
1212
spec:
1313
externalTrafficPolicy: Local
1414
type: LoadBalancer
1515
selector:
1616
app.kubernetes.io/name: nginx-gateway
1717
app.kubernetes.io/instance: nginx-gateway
18-
ports:
18+
ports: # Update the following ports to match your Gateway Listener ports
1919
- name: http
2020
port: 80
2121
protocol: TCP

deploy/manifests/service/nodeport.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ metadata:
88
labels:
99
app.kubernetes.io/name: nginx-gateway
1010
app.kubernetes.io/instance: nginx-gateway
11-
app.kubernetes.io/version: "0.5.0"
11+
app.kubernetes.io/version: "edge"
1212
spec:
13-
externalTrafficPolicy: Local
1413
type: NodePort
1514
selector:
1615
app.kubernetes.io/name: nginx-gateway
1716
app.kubernetes.io/instance: nginx-gateway
18-
ports:
17+
ports: # Update the following ports to match your Gateway Listener ports
1918
- name: http
2019
port: 80
2120
protocol: TCP

docs/developer/implementing-a-feature.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ practices to ensure a successful feature development process.
5050
11. **Lint code**: See the [run the linter](/docs/developer/quickstart.md#run-the-linter) section of the quickstart
5151
guide for instructions.
5252
12. **Run generators**: See the [Run go generate](/docs/developer/quickstart.md#run-go-generate) and the
53-
[Update NJS module ConfigMaps](/docs/developer/quickstart.md#update-njs-module-configmaps) sections of the
53+
[Update Generated Manifests](/docs/developer/quickstart.md#update-generated-manifests) sections of the
5454
quickstart guide for instructions.
5555
13. **Open pull request**: Open a pull request targeting the `main` branch of
5656
the [nginx-kubernetes-gateway](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main) repository. The

0 commit comments

Comments
 (0)