Skip to content

Commit 9ad1bda

Browse files
authored
feat: Add docs to install Nginx Gateway Fabric with N+ (#1524)
* feat: add docs for NGINX plus installation with NGF
1 parent 25ea723 commit 9ad1bda

File tree

15 files changed

+550
-13
lines changed

15 files changed

+550
-13
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,18 @@ generate-crds: ## Generate CRDs and Go types using kubebuilder
8181
go run sigs.k8s.io/controller-tools/cmd/controller-gen object paths=./apis/...
8282

8383
.PHONY: generate-manifests
84-
generate-manifests: ## Generate manifests using Helm.
84+
generate-manifests: generate-manifests-plus ## Generate manifests using Helm.
8585
cp $(CHART_DIR)/crds/* $(MANIFEST_DIR)/crds/
8686
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
8787
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false -n nginx-gateway -s templates/deployment.yaml > conformance/provisioner/static-deployment.yaml
8888
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer.yaml
8989
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
9090
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
9191

92+
.PHONY: generate-manifests-plus
93+
generate-manifests-plus: ## Generate manifests using Helm for NGINX Plus.
94+
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginx.plus=true --set nginx.image.repository=$(NGINX_PLUS_PREFIX) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-plus-gateway.yaml
95+
9296
.PHONY: crds-release-file
9397
crds-release-file: ## Generate combined crds file for releases
9498
scripts/combine-crds.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Learn about our [design principles](/docs/developer/design-principles.md) and [a
1818

1919
1. [Quick Start on a kind cluster](https://docs.nginx.com/nginx-gateway-fabric/installation/running-on-kind/).
2020
2. [Install](https://docs.nginx.com/nginx-gateway-fabric/installation/) NGINX Gateway Fabric.
21-
3. [Build](https://docs.nginx.com/nginx-gateway-fabric/installation/building-the-images/) an NGINX Gateway Fabric container image from source or use a pre-built image
21+
3. [Build](https://docs.nginx.com/nginx-gateway-fabric/installation/ngf-images/building-the-images/) an NGINX Gateway Fabric container image from source or use a pre-built image
2222
available
2323
on [GitHub Container Registry](https://github.com/nginxinc/nginx-gateway-fabric/pkgs/container/nginx-gateway-fabric).
2424
4. Deploy various [examples](examples).

deploy/helm-chart/templates/rbac.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ metadata:
77
{{- include "nginx-gateway.labels" . | nindent 4 }}
88
annotations:
99
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}
10+
{{- if or .Values.serviceAccount.imagePullSecret .Values.serviceAccount.imagePullSecrets }}
11+
imagePullSecrets:
12+
{{- if .Values.serviceAccount.imagePullSecret }}
13+
- name: {{ .Values.serviceAccount.imagePullSecret}}
14+
{{- end }}
15+
{{- if .Values.serviceAccount.imagePullSecrets }}
16+
{{- range .Values.serviceAccount.imagePullSecrets }}
17+
- name: {{ . }}
18+
{{- end }}
19+
{{- end }}
20+
{{- end }}
1021
---
1122
apiVersion: rbac.authorization.k8s.io/v1
1223
kind: ClusterRole

deploy/helm-chart/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ serviceAccount:
8585
## Autogenerated if not set or set to "".
8686
# name: nginx-gateway
8787

88+
## The name of the secret containing docker registry credentials.
89+
## Secret must exist in the same namespace as the helm release.
90+
imagePullSecret: ""
91+
92+
## A list of secret names containing docker registry credentials.
93+
## Secrets must exist in the same namespace as the helm release.
94+
imagePullSecrets: []
95+
8896
service:
8997
## Creates a service to expose the NGINX Gateway Fabric pods.
9098
create: true
Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: nginx-gateway
5+
---
6+
# Source: nginx-gateway-fabric/templates/rbac.yaml
7+
apiVersion: v1
8+
kind: ServiceAccount
9+
metadata:
10+
name: nginx-gateway
11+
namespace: nginx-gateway
12+
labels:
13+
app.kubernetes.io/name: nginx-gateway
14+
app.kubernetes.io/instance: nginx-gateway
15+
app.kubernetes.io/version: "edge"
16+
annotations:
17+
{}
18+
---
19+
# Source: nginx-gateway-fabric/templates/rbac.yaml
20+
apiVersion: rbac.authorization.k8s.io/v1
21+
kind: ClusterRole
22+
metadata:
23+
name: nginx-gateway
24+
labels:
25+
app.kubernetes.io/name: nginx-gateway
26+
app.kubernetes.io/instance: nginx-gateway
27+
app.kubernetes.io/version: "edge"
28+
rules:
29+
- apiGroups:
30+
- ""
31+
resources:
32+
- namespaces
33+
- services
34+
- secrets
35+
verbs:
36+
- list
37+
- watch
38+
# FIXME(bjee19): make nodes, pods, replicasets permission dependent on telemetry being enabled.
39+
# https://github.com/nginxinc/nginx-gateway-fabric/issues/1317.
40+
- apiGroups:
41+
- ""
42+
resources:
43+
- pods
44+
verbs:
45+
- get
46+
- apiGroups:
47+
- ""
48+
resources:
49+
- nodes
50+
verbs:
51+
- list
52+
- apiGroups:
53+
- ""
54+
resources:
55+
- events
56+
verbs:
57+
- create
58+
- patch
59+
- apiGroups:
60+
- apps
61+
resources:
62+
- replicasets
63+
verbs:
64+
- get
65+
- apiGroups:
66+
- discovery.k8s.io
67+
resources:
68+
- endpointslices
69+
verbs:
70+
- list
71+
- watch
72+
- apiGroups:
73+
- gateway.networking.k8s.io
74+
resources:
75+
- gatewayclasses
76+
- gateways
77+
- httproutes
78+
- referencegrants
79+
verbs:
80+
- list
81+
- watch
82+
- apiGroups:
83+
- gateway.networking.k8s.io
84+
resources:
85+
- httproutes/status
86+
- gateways/status
87+
- gatewayclasses/status
88+
verbs:
89+
- update
90+
- apiGroups:
91+
- gateway.nginx.org
92+
resources:
93+
- nginxgateways
94+
verbs:
95+
- get
96+
- list
97+
- watch
98+
- apiGroups:
99+
- gateway.nginx.org
100+
resources:
101+
- nginxgateways/status
102+
verbs:
103+
- update
104+
- apiGroups:
105+
- coordination.k8s.io
106+
resources:
107+
- leases
108+
verbs:
109+
- create
110+
- get
111+
- update
112+
- apiGroups:
113+
- apiextensions.k8s.io
114+
resources:
115+
- customresourcedefinitions
116+
verbs:
117+
- list
118+
- watch
119+
---
120+
# Source: nginx-gateway-fabric/templates/rbac.yaml
121+
apiVersion: rbac.authorization.k8s.io/v1
122+
kind: ClusterRoleBinding
123+
metadata:
124+
name: nginx-gateway
125+
labels:
126+
app.kubernetes.io/name: nginx-gateway
127+
app.kubernetes.io/instance: nginx-gateway
128+
app.kubernetes.io/version: "edge"
129+
roleRef:
130+
apiGroup: rbac.authorization.k8s.io
131+
kind: ClusterRole
132+
name: nginx-gateway
133+
subjects:
134+
- kind: ServiceAccount
135+
name: nginx-gateway
136+
namespace: nginx-gateway
137+
---
138+
# Source: nginx-gateway-fabric/templates/deployment.yaml
139+
apiVersion: apps/v1
140+
kind: Deployment
141+
metadata:
142+
name: nginx-gateway
143+
namespace: nginx-gateway
144+
labels:
145+
app.kubernetes.io/name: nginx-gateway
146+
app.kubernetes.io/instance: nginx-gateway
147+
app.kubernetes.io/version: "edge"
148+
spec:
149+
replicas: 1
150+
selector:
151+
matchLabels:
152+
app.kubernetes.io/name: nginx-gateway
153+
app.kubernetes.io/instance: nginx-gateway
154+
template:
155+
metadata:
156+
labels:
157+
app.kubernetes.io/name: nginx-gateway
158+
app.kubernetes.io/instance: nginx-gateway
159+
annotations:
160+
prometheus.io/scrape: "true"
161+
prometheus.io/port: "9113"
162+
spec:
163+
containers:
164+
- args:
165+
- static-mode
166+
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
167+
- --gatewayclass=nginx
168+
- --config=nginx-gateway-config
169+
- --service=nginx-gateway
170+
- --nginx-plus
171+
- --metrics-port=9113
172+
- --health-port=8081
173+
- --leader-election-lock-name=nginx-gateway-leader-election
174+
env:
175+
- name: POD_IP
176+
valueFrom:
177+
fieldRef:
178+
fieldPath: status.podIP
179+
- name: POD_NAMESPACE
180+
valueFrom:
181+
fieldRef:
182+
fieldPath: metadata.namespace
183+
- name: POD_NAME
184+
valueFrom:
185+
fieldRef:
186+
fieldPath: metadata.name
187+
image: ghcr.io/nginxinc/nginx-gateway-fabric:edge
188+
imagePullPolicy: Always
189+
name: nginx-gateway
190+
ports:
191+
- name: metrics
192+
containerPort: 9113
193+
- name: health
194+
containerPort: 8081
195+
readinessProbe:
196+
httpGet:
197+
path: /readyz
198+
port: health
199+
initialDelaySeconds: 3
200+
periodSeconds: 1
201+
securityContext:
202+
allowPrivilegeEscalation: false
203+
capabilities:
204+
add:
205+
- KILL
206+
drop:
207+
- ALL
208+
readOnlyRootFilesystem: true
209+
runAsUser: 102
210+
runAsGroup: 1001
211+
volumeMounts:
212+
- name: nginx-conf
213+
mountPath: /etc/nginx/conf.d
214+
- name: nginx-secrets
215+
mountPath: /etc/nginx/secrets
216+
- name: nginx-run
217+
mountPath: /var/run/nginx
218+
- image: nginx-gateway-fabric/nginx-plus:edge
219+
imagePullPolicy: Always
220+
name: nginx
221+
ports:
222+
- containerPort: 80
223+
name: http
224+
- containerPort: 443
225+
name: https
226+
securityContext:
227+
capabilities:
228+
add:
229+
- NET_BIND_SERVICE
230+
drop:
231+
- ALL
232+
readOnlyRootFilesystem: true
233+
runAsUser: 101
234+
runAsGroup: 1001
235+
volumeMounts:
236+
- name: nginx-conf
237+
mountPath: /etc/nginx/conf.d
238+
- name: nginx-secrets
239+
mountPath: /etc/nginx/secrets
240+
- name: nginx-run
241+
mountPath: /var/run/nginx
242+
- name: nginx-cache
243+
mountPath: /var/cache/nginx
244+
- name: nginx-lib
245+
mountPath: /var/lib/nginx
246+
terminationGracePeriodSeconds: 30
247+
serviceAccountName: nginx-gateway
248+
shareProcessNamespace: true
249+
securityContext:
250+
fsGroup: 1001
251+
runAsNonRoot: true
252+
volumes:
253+
- name: nginx-conf
254+
emptyDir: {}
255+
- name: nginx-secrets
256+
emptyDir: {}
257+
- name: nginx-run
258+
emptyDir: {}
259+
- name: nginx-cache
260+
emptyDir: {}
261+
- name: nginx-lib
262+
emptyDir: {}
263+
---
264+
# Source: nginx-gateway-fabric/templates/gatewayclass.yaml
265+
apiVersion: gateway.networking.k8s.io/v1
266+
kind: GatewayClass
267+
metadata:
268+
name: nginx
269+
labels:
270+
app.kubernetes.io/name: nginx-gateway
271+
app.kubernetes.io/instance: nginx-gateway
272+
app.kubernetes.io/version: "edge"
273+
spec:
274+
controllerName: gateway.nginx.org/nginx-gateway-controller
275+
---
276+
# Source: nginx-gateway-fabric/templates/nginxgateway.yaml
277+
apiVersion: gateway.nginx.org/v1alpha1
278+
kind: NginxGateway
279+
metadata:
280+
name: nginx-gateway-config
281+
namespace: nginx-gateway
282+
labels:
283+
app.kubernetes.io/name: nginx-gateway
284+
app.kubernetes.io/instance: nginx-gateway
285+
app.kubernetes.io/version: "edge"
286+
spec:
287+
logging:
288+
level: info

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Installing NGINX Gateway Fabric"
33
description:
4-
weight: 200
4+
weight: 100
55
linkTitle: "Installing NGINX Gateway Fabric"
66
menu:
77
docs:

0 commit comments

Comments
 (0)