Skip to content

Commit 4fc8248

Browse files
committed
Refactor Helm Chart location and generate mainfests automatically
Moves the Helm Chart to charts/nginx-ingress. Uses Helm Charts in examples/helm-chart to template single file manifests in deploy/. Adds `kustomize` to create a single CRDs file and single files CRDs for NAP WAF and NAP DoS.
1 parent 9dcd4cc commit 4fc8248

File tree

122 files changed

+11840
-3250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+11840
-3250
lines changed

.github/workflows/build-plus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
This is the official implementation of NGINX Ingress Controller (based on NGINX Plus) from NGINX.
172172
usage-instructions: |
173173
This container requires Kubernetes and can be deployed to EKS.
174-
Review the installation instructions https://docs.nginx.com/nginx-ingress-controller/installation/ and utilize the deployment resources available https://github.com/nginxinc/kubernetes-ingress/tree/master/deployments
174+
Review the installation instructions https://docs.nginx.com/nginx-ingress-controller/installation/ and utilize the deployment resources available https://github.com/nginxinc/kubernetes-ingress/tree/main/deploy
175175
Use this image instead of building your own.
176176
if: ${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }}
177177

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: go mod tidy && git diff --exit-code -- go.mod go.sum
5454

5555
- name: Check if CRDs changed
56-
run: make update-crds && git diff --name-only --exit-code deployments/common/crds*
56+
run: make update-crds && git diff --name-only --exit-code config/crd/bases
5757

5858
- name: Check if Codegen changed
5959
run: |

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Read the [documentation](https://github.com/nginxinc/kubernetes-ingress/tree/mai
4242
- The internal code is found at `internal/`
4343
- Build files for Docker are found at `build/`
4444
- CI files are found at `.github/workflows/`
45-
- Deployment yaml files, and Helm files are found at `deployments/`
45+
- Deployment yaml files, and Helm files are found at `charts/`
4646
- We use [Go modules](https://github.com/golang/go/wiki/Modules) for managing dependencies.
4747

4848
## Contributing

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ update-codegen: ## Generate code
6363

6464
.PHONY: update-crds
6565
update-crds: ## Update CRDs
66-
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1 schemapatch:manifests=./deployments/common/crds/ paths=./pkg/apis/... output:dir=./deployments/common/crds
66+
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd paths=./pkg/apis/... output:crd:artifacts:config=config/crd/bases
67+
kustomize build config/crd >deploy/crds.yaml
68+
kustomize build config/crd/app-protect-dos --load-restrictor='LoadRestrictionsNone' >deploy/crds-nap-dos.yaml
69+
kustomize build config/crd/app-protect-waf --load-restrictor='LoadRestrictionsNone' >deploy/crds-nap-waf.yaml
70+
71+
.PHONY: generate-manifests
72+
generate-manifests: ## Generate manifests
73+
./hack/generate-manifests.sh
6774

6875
.PHONY: certificate-and-key
6976
certificate-and-key: ## Create default cert and key

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ your links to the correct versions:
119119
| Version | Description | Image for NGINX | Image for NGINX Plus | Installation Manifests and Helm Chart | Documentation and Examples |
120120
| ------- | ----------- | --------------- | -------------------- | ---------------------------------------| -------------------------- |
121121
| Latest stable release | For production use | Use the 3.3.0 images from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/), [GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress), [Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress) or [build your own image](https://docs.nginx.com/nginx-ingress-controller/installation/building-ingress-controller-image/). | Use the 3.3.0 images from the [F5 Container Registry](https://docs.nginx.com/nginx-ingress-controller/installation/pulling-ingress-controller-image/) or the [AWS Marketplace](https://aws.amazon.com/marketplace/search/?CREATOR=741df81b-dfdc-4d36-b8da-945ea66b522c&FULFILLMENT_OPTION_TYPE=CONTAINER&filters=CREATOR%2CFULFILLMENT_OPTION_TYPE) or [Build your own image](https://docs.nginx.com/nginx-ingress-controller/installation/building-ingress-controller-image/). | [Manifests](https://github.com/nginxinc/kubernetes-ingress/tree/v3.3.0/deployments). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/v3.3.0/deployments/helm-chart). | [Documentation](https://docs.nginx.com/nginx-ingress-controller/). [Examples](https://docs.nginx.com/nginx-ingress-controller/configuration/configuration-examples/). |
122-
| Edge/Nightly | For testing and experimenting | Use the edge or nightly images from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/), [GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress), [Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress) or [build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/main/docs/content/installation/building-ingress-controller-image.md). | [Build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/main/docs/content/installation/building-ingress-controller-image.md). | [Manifests](https://github.com/nginxinc/kubernetes-ingress/tree/main/deployments). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/main/charts/nginx-ingress). | [Documentation](https://github.com/nginxinc/kubernetes-ingress/tree/main/docs/content). [Examples](https://github.com/nginxinc/kubernetes-ingress/tree/main/examples). |
122+
| Edge/Nightly | For testing and experimenting | Use the edge or nightly images from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/), [GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress), [Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress) or [build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/main/docs/content/installation/building-ingress-controller-image.md). | [Build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/main/docs/content/installation/building-ingress-controller-image.md). | [Manifests](https://github.com/nginxinc/kubernetes-ingress/tree/main/deploy). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/main/charts/nginx-ingress). | [Documentation](https://github.com/nginxinc/kubernetes-ingress/tree/main/docs/content). [Examples](https://github.com/nginxinc/kubernetes-ingress/tree/main/examples). |
123123

124124
## SBOM (Software Bill of Materials)
125125

charts/nginx-ingress/.helmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Patterns to ignore when building packages.
22
*.png
3+
4+
.cache

charts/nginx-ingress/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ To install the chart with the release name my-release (my-release is the name th
7575
For NGINX:
7676

7777
```console
78-
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.0
78+
helm install my-release -n nginx-ingress --create-namespace oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.0
7979
```
8080

8181
For NGINX Plus: (assuming you have pushed the Ingress Controller image `nginx-plus-ingress` to your private registry
8282
`myregistry.example.com`)
8383

8484
```console
85-
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.0 --set controller.image.repository=myregistry.example.com/nginx-plus-ingress --set controller.nginxplus=true
85+
helm install my-release -n nginx-ingress --create-namespace oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.0 --set controller.image.repository=myregistry.example.com/nginx-plus-ingress --set controller.nginxplus=true
8686
```
8787

8888
This will install the latest `edge` version of the Ingress Controller from GitHub Container Registry. If you prefer to
@@ -97,15 +97,15 @@ CRDs](#upgrading-the-crds).
9797
To upgrade the release `my-release`:
9898

9999
```console
100-
helm upgrade my-release oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.0
100+
helm upgrade my-release -n nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.0
101101
```
102102

103103
### Uninstalling the Chart
104104

105105
To uninstall/delete the release `my-release`:
106106

107107
```console
108-
helm uninstall my-release
108+
helm uninstall my-release -n nginx-ingress
109109
```
110110

111111
The command removes all the Kubernetes components associated with the release and deletes the release.
@@ -120,7 +120,7 @@ version is built from the `main` branch of the NGINX Ingress Controller reposito
120120
by specifying the `--version` flag with the value `0.0.0-edge`:
121121

122122
```console
123-
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-ingress --version 0.0.0-edge
123+
helm install my-release -n nginx-ingress --create-namespace oci://ghcr.io/nginxinc/charts/nginx-ingress --version 0.0.0-edge
124124
```
125125

126126
> **Warning**
@@ -154,13 +154,13 @@ To install the chart with the release name my-release (my-release is the name th
154154
For NGINX:
155155

156156
```console
157-
helm install my-release .
157+
helm install my-release -n nginx-ingress --create-namespace .
158158
```
159159

160160
For NGINX Plus:
161161

162162
```console
163-
helm install my-release -f values-plus.yaml .
163+
helm install my-release -f values-plus.yaml -n nginx-ingress --create-namespace .
164164
```
165165

166166
The command deploys the Ingress Controller in your Kubernetes cluster in the default configuration. The configuration
@@ -174,15 +174,15 @@ CRDs](#upgrading-the-crds).
174174
To upgrade the release `my-release`:
175175

176176
```console
177-
helm upgrade my-release .
177+
helm upgrade my-release -n nginx-ingress .
178178
```
179179

180180
### Uninstalling the Chart
181181

182182
To uninstall/delete the release `my-release`:
183183

184184
```console
185-
helm uninstall my-release
185+
helm uninstall my-release -n nginx-ingress
186186
```
187187

188188
The command removes all the Kubernetes components associated with the release and deletes the release.
@@ -252,8 +252,8 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
252252
|`controller.enableCustomResources` | Enable the custom resources. | true |
253253
|`controller.enablePreviewPolicies` | Enable preview policies. This parameter is deprecated. To enable OIDC Policies please use `controller.enableOIDC` instead. | false |
254254
|`controller.enableOIDC` | Enable OIDC policies. | false |
255-
|`controller.enableTLSPassthrough` | Enable TLS Passthrough on default port 443. Requires `controller.enableCustomResources`. | false |
256-
|`controller.tlsPassThroughPort` | Set the port for the TLS Passthrough. Requires `controller.enableCustomResources` and `controller.enableTLSPassthrough`. | 443 |
255+
|`controller.enableTLSPassthrough` | Enable TLS Passthrough on port 443. Requires `controller.enableCustomResources`. | false |
256+
|`controller.tlsPassThroughPort` | Set the port for the TLS Passthrough. Requires `controller.enableCustomResources` and `controller.enableTLSPassthrough`. | 443 |
257257
|`controller.enableCertManager` | Enable x509 automated certificate management for VirtualServer resources using cert-manager (cert-manager.io). Requires `controller.enableCustomResources`. | false |
258258
|`controller.enableExternalDNS` | Enable integration with ExternalDNS for configuring public DNS entries for VirtualServer resources using [ExternalDNS](https://github.com/kubernetes-sigs/external-dns). Requires `controller.enableCustomResources`. | false |
259259
|`controller.globalConfiguration.create` | Creates the GlobalConfiguration custom resource. Requires `controller.enableCustomResources`. | false |

charts/nginx-ingress/crds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../deployments/common/crds/
1+
../../config/crd/bases/

charts/nginx-ingress/templates/controller-daemonset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ spec:
230230
- -disable-ipv6={{ .Values.controller.disableIPV6 }}
231231
{{- if .Values.controller.enableCustomResources }}
232232
- -enable-tls-passthrough={{ .Values.controller.enableTLSPassthrough }}
233-
{{ if .Values.controller.enableTLSPassthrough }}
233+
{{- if .Values.controller.enableTLSPassthrough }}
234234
- -tls-passthrough-port={{ .Values.controller.tlsPassthroughPort }}
235-
{{ end }}
235+
{{- end }}
236236
- -enable-preview-policies={{ .Values.controller.enablePreviewPolicies }}
237237
- -enable-cert-manager={{ .Values.controller.enableCertManager }}
238238
- -enable-oidc={{ .Values.controller.enableOIDC }}

charts/nginx-ingress/templates/controller-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ spec:
173173
- -enable-app-protect={{ .Values.controller.appprotect.enable }}
174174
{{- if and .Values.controller.appprotect.enable .Values.controller.appprotect.logLevel }}
175175
- -app-protect-log-level={{ .Values.controller.appprotect.logLevel }}
176-
{{ end }}
176+
{{- end }}
177177
- -enable-app-protect-dos={{ .Values.controller.appprotectdos.enable }}
178178
{{- if .Values.controller.appprotectdos.enable }}
179179
- -app-protect-dos-debug={{ .Values.controller.appprotectdos.debug }}
180180
- -app-protect-dos-max-daemons={{ .Values.controller.appprotectdos.maxDaemons }}
181181
- -app-protect-dos-max-workers={{ .Values.controller.appprotectdos.maxWorkers }}
182182
- -app-protect-dos-memory={{ .Values.controller.appprotectdos.memory }}
183-
{{ end }}
183+
{{- end }}
184184
- -nginx-configmaps=$(POD_NAMESPACE)/{{ include "nginx-ingress.configName" . }}
185185
{{- if .Values.controller.defaultTLS.secret }}
186186
- -default-server-tls-secret={{ .Values.controller.defaultTLS.secret }}
@@ -237,9 +237,9 @@ spec:
237237
- -disable-ipv6={{ .Values.controller.disableIPV6 }}
238238
{{- if .Values.controller.enableCustomResources }}
239239
- -enable-tls-passthrough={{ .Values.controller.enableTLSPassthrough }}
240-
{{ if .Values.controller.enableTLSPassthrough }}
240+
{{- if .Values.controller.enableTLSPassthrough }}
241241
- -tls-passthrough-port={{ .Values.controller.tlsPassthroughPort }}
242-
{{ end }}
242+
{{- end }}
243243
- -enable-preview-policies={{ .Values.controller.enablePreviewPolicies }}
244244
- -enable-cert-manager={{ .Values.controller.enableCertManager }}
245245
- -enable-oidc={{ .Values.controller.enableOIDC }}

0 commit comments

Comments
 (0)