Skip to content

Commit 8db1ead

Browse files
committed
feat: add docs for nginx plus installation with NGF
1 parent 25ea723 commit 8db1ead

File tree

15 files changed

+539
-19
lines changed

15 files changed

+539
-19
lines changed

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,17 @@ 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.
85-
cp $(CHART_DIR)/crds/* $(MANIFEST_DIR)/crds/
86-
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
87-
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
88-
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer.yaml
89-
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
90-
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
84+
generate-manifests: generate-manifests-plus ## Generate manifests using Helm.
85+
cp $(CHART_DIR)/crds/* $(MANIFEST_DIR)/crds/
86+
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
87+
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
88+
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer.yaml
89+
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
90+
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
91+
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
9195

9296
.PHONY: crds-release-file
9397
crds-release-file: ## Generate combined crds file for releases

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