Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate mainfests automatically from Helm #4278

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-plus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
This is the official implementation of NGINX Ingress Controller (based on NGINX Plus) from NGINX.
usage-instructions: |
This container requires Kubernetes and can be deployed to EKS.
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
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
Use this image instead of building your own.
if: ${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }}

Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,22 @@ jobs:
DOCS_TO_UPDATE_FOLDER=docs/content

FILES_TO_UPDATE_IC_VERSION=(
README.md
deployments/daemon-set/nginx-ingress.yaml
deployments/daemon-set/nginx-plus-ingress.yaml
deployments/deployment/nginx-ingress.yaml
deployments/deployment/nginx-plus-ingress.yaml
deployments/helm-chart/Chart.yaml
deployments/helm-chart/README.md
deployments/helm-chart/values-icp.yaml
deployments/helm-chart/values-nsm.yaml
deployments/helm-chart/values-plus.yaml
deployments/helm-chart/values.yaml
README.md
charts/nginx-ingress/Chart.yaml
charts/nginx-ingress/README.md
charts/nginx-ingress/values.yaml
)

FILE_TO_UPDATE_HELM_CHART_VERSION=(
deployments/helm-chart/Chart.yaml
deployments/helm-chart/README.md
charts/nginx-ingress/Chart.yaml
charts/nginx-ingress/README.md
)

ic_version=${{ github.event.inputs.version }}
helm_chart_version=${{ github.event.inputs.helm_version }}

current_ic_version=$(yq '.appVersion' <deployments/helm-chart/Chart.yaml)
current_helm_chart_version=$(yq '.version' <deployments/helm-chart/Chart.yaml)
current_ic_version=$(yq '.appVersion' <charts/nginx-ingress/Chart.yaml)
current_helm_chart_version=$(yq '.version' <charts/nginx-ingress/Chart.yaml)

sed -i "s/$current_ic_version/$ic_version/g" ${FILES_TO_UPDATE_IC_VERSION[*]}
sed -i "s/$current_helm_chart_version/$helm_chart_version/g" ${FILE_TO_UPDATE_HELM_CHART_VERSION[*]}
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Read the [documentation](https://github.com/nginxinc/kubernetes-ingress/tree/mai
- The internal code is found at `internal/`
- Build files for Docker are found at `build/`
- CI files are found at `.github/workflows/`
- Deployment yaml files, and Helm files are found at `deployments/`
- Deployment yaml files are found at `deploy/`
- Helm files are found at `charts/`
- We use [Go modules](https://github.com/golang/go/wiki/Modules) for managing dependencies.

## Contributing
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ update-crds: ## Update CRDs
kustomize build config/crd/app-protect-dos --load-restrictor='LoadRestrictionsNone' >deploy/crds-nap-dos.yaml
kustomize build config/crd/app-protect-waf --load-restrictor='LoadRestrictionsNone' >deploy/crds-nap-waf.yaml

.PHONY: generate-manifests
generate-manifests: ## Generate manifests
./hack/generate-manifests.sh

lucacome marked this conversation as resolved.
Show resolved Hide resolved
.PHONY: certificate-and-key
certificate-and-key: ## Create default cert and key
./build/generate_default_cert_and_key.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ your links to the correct versions:
| Version | Description | Image for NGINX | Image for NGINX Plus | Installation Manifests and Helm Chart | Documentation and Examples |
| ------- | ----------- | --------------- | -------------------- | ---------------------------------------| -------------------------- |
| Latest stable release | For production use | Use the 3.3.2 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.2 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.2/deployments). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/v3.3.2/deployments/helm-chart). | [Documentation](https://docs.nginx.com/nginx-ingress-controller/). [Examples](https://docs.nginx.com/nginx-ingress-controller/configuration/configuration-examples/). |
| 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). |
| 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). |

## SBOM (Software Bill of Materials)

Expand Down
22 changes: 11 additions & 11 deletions charts/nginx-ingress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ To install the chart with the release name my-release (my-release is the name th
For NGINX:

```console
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.2
helm install my-release -n nginx-ingress --create-namespace oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.2
```

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

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

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

```console
helm upgrade my-release oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.2
helm upgrade my-release -n nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.2
```

### Uninstalling the Chart

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

```console
helm uninstall my-release
helm uninstall my-release -n nginx-ingress
```

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

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

> **Warning**
Expand Down Expand Up @@ -157,13 +157,13 @@ To install the chart with the release name my-release (my-release is the name th
For NGINX:

```console
helm install my-release .
helm install my-release -n nginx-ingress --create-namespace .
```

For NGINX Plus:

```console
helm install my-release -f values-plus.yaml .
helm install my-release -f values-plus.yaml -n nginx-ingress --create-namespace .
```

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

```console
helm upgrade my-release .
helm upgrade my-release -n nginx-ingress .
```

### Uninstalling the Chart

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

```console
helm uninstall my-release
helm uninstall my-release -n nginx-ingress
```

The command removes all the Kubernetes components associated with the release and deletes the release.
Expand Down Expand Up @@ -379,8 +379,8 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
|`controller.watchSecretNamespace` | Comma separated list of namespaces the Ingress Controller should watch for resources of type Secret. If this arg is not configured, the Ingress Controller watches the same namespaces for all resources. See `controller.watchNamespace` and `controller.watchNamespaceLabel`. Please note that if configuring multiple namespaces using the Helm cli `--set` option, the string needs to wrapped in double quotes and the commas escaped using a backslash - e.g. `--set controller.watchSecretNamespace="default\,nginx-ingress"`. | "" |
|`controller.enableCustomResources` | Enable the custom resources. | true |
|`controller.enableOIDC` | Enable OIDC policies. | false |
|`controller.enableTLSPassthrough` | Enable TLS Passthrough on default port 443. Requires `controller.enableCustomResources`. | false |
|`controller.tlsPassThroughPort` | Set the port for the TLS Passthrough. Requires `controller.enableCustomResources` and `controller.enableTLSPassthrough`. | 443 |
|`controller.enableTLSPassthrough` | Enable TLS Passthrough on port 443. Requires `controller.enableCustomResources`. | false |
|`controller.tlsPassThroughPort` | Set the port for the TLS Passthrough. Requires `controller.enableCustomResources` and `controller.enableTLSPassthrough`. | 443 |
|`controller.enableCertManager` | Enable x509 automated certificate management for VirtualServer resources using cert-manager (cert-manager.io). Requires `controller.enableCustomResources`. | false |
|`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 |
|`controller.globalConfiguration.create` | Creates the GlobalConfiguration custom resource. Requires `controller.enableCustomResources`. | false |
Expand Down
4 changes: 2 additions & 2 deletions charts/nginx-ingress/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ spec:
- -disable-ipv6={{ .Values.controller.disableIPV6 }}
{{- if .Values.controller.enableCustomResources }}
- -enable-tls-passthrough={{ .Values.controller.enableTLSPassthrough }}
{{ if .Values.controller.enableTLSPassthrough }}
{{- if .Values.controller.enableTLSPassthrough }}
- -tls-passthrough-port={{ .Values.controller.tlsPassthroughPort }}
{{ end }}
{{- end }}
- -enable-cert-manager={{ .Values.controller.enableCertManager }}
- -enable-oidc={{ .Values.controller.enableOIDC }}
- -enable-external-dns={{ .Values.controller.enableExternalDNS }}
Expand Down
8 changes: 4 additions & 4 deletions charts/nginx-ingress/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ spec:
- -enable-app-protect={{ .Values.controller.appprotect.enable }}
{{- if and .Values.controller.appprotect.enable .Values.controller.appprotect.logLevel }}
- -app-protect-log-level={{ .Values.controller.appprotect.logLevel }}
{{ end }}
{{- end }}
- -enable-app-protect-dos={{ .Values.controller.appprotectdos.enable }}
{{- if .Values.controller.appprotectdos.enable }}
- -app-protect-dos-debug={{ .Values.controller.appprotectdos.debug }}
- -app-protect-dos-max-daemons={{ .Values.controller.appprotectdos.maxDaemons }}
- -app-protect-dos-max-workers={{ .Values.controller.appprotectdos.maxWorkers }}
- -app-protect-dos-memory={{ .Values.controller.appprotectdos.memory }}
{{ end }}
{{- end }}
- -nginx-configmaps=$(POD_NAMESPACE)/{{ include "nginx-ingress.configName" . }}
{{- if .Values.controller.defaultTLS.secret }}
- -default-server-tls-secret={{ .Values.controller.defaultTLS.secret }}
Expand Down Expand Up @@ -237,9 +237,9 @@ spec:
- -disable-ipv6={{ .Values.controller.disableIPV6 }}
{{- if .Values.controller.enableCustomResources }}
- -enable-tls-passthrough={{ .Values.controller.enableTLSPassthrough }}
{{ if .Values.controller.enableTLSPassthrough }}
{{- if .Values.controller.enableTLSPassthrough }}
- -tls-passthrough-port={{ .Values.controller.tlsPassthroughPort }}
{{ end }}
{{- end }}
- -enable-cert-manager={{ .Values.controller.enableCertManager }}
- -enable-oidc={{ .Values.controller.enableOIDC }}
- -enable-external-dns={{ .Values.controller.enableExternalDNS }}
Expand Down
6 changes: 0 additions & 6 deletions charts/nginx-ingress/values-nsm.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions charts/nginx-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ controller:
## The number of Ingress Controller pods that can be unavailable. This is a mutually exclusive setting with "minAvailable".
# maxUnavailable: 1

## Strategy used to replace old Pods by new ones. .spec.strategy.type can be "Recreate" or "RollingUpdate" for Deployments, and "OnDelete" or "RollingUpdate" for Daemonsets. "RollingUpdate" is the default value.
## Strategy used to replace old Pods by new ones. .spec.strategy.type can be "Recreate" or "RollingUpdate" for Deployments, and "OnDelete" or "RollingUpdate" for Daemonsets. "RollingUpdate" is the default value.
strategy: {}

## Extra containers for the Ingress Controller pods.
Expand Down Expand Up @@ -275,7 +275,7 @@ controller:
create: false

## The spec of the GlobalConfiguration for defining the global configuration parameters of the Ingress Controller.
spec: {} ## Ensure both curly brackets are removed when adding listeners in YAML format.
spec: {}
# listeners:
# - name: dns-udp
# port: 5353
Expand Down Expand Up @@ -380,7 +380,7 @@ controller:

## The name of the service account of the Ingress Controller pods. Used for RBAC.
## Autogenerated if not set or set to "".
# name: nginx-ingress
name: nginx-ingress
lucacome marked this conversation as resolved.
Show resolved Hide resolved

## The name of the secret containing docker registry credentials.
## Secret must exist in the same namespace as the helm release.
Expand Down
5 changes: 5 additions & 0 deletions config/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deploy.yaml
- namespace.yaml
4 changes: 4 additions & 0 deletions config/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: nginx-ingress
lucacome marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 43 additions & 0 deletions config/overlays/app-protect-dos/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This is generated from https://github.com/nginxinc/nap-dos-arbitrator-helm-chart
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-appprotect-dos-arbitrator
namespace: nginx-ingress
labels:
app.kubernetes.io/name: nginx-appprotect-dos-arbitrator
app.kubernetes.io/instance: nginx-appprotect-dos-arbitrator
app.kubernetes.io/version: "1.1.1"
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: nginx-appprotect-dos-arbitrator
app.kubernetes.io/instance: nginx-appprotect-dos-arbitrator
template:
metadata:
labels:
app.kubernetes.io/name: nginx-appprotect-dos-arbitrator
app.kubernetes.io/instance: nginx-appprotect-dos-arbitrator
spec:
serviceAccountName: default
securityContext:
{}
containers:
- name: nginx-appprotect-dos-arbitrator
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsUser: 1001
image: "docker-registry.nginx.com/nap-dos/app_protect_dos_arb:1.1.1"
imagePullPolicy: IfNotPresent
ports:
- name: arb
containerPort: 3000
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
9 changes: 9 additions & 0 deletions config/overlays/app-protect-dos/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- deployment.yaml
- service.yaml
# - ../../crd/bases/appprotectdos.f5.com_apdoslogconfs.yaml
# - ../../crd/bases/appprotectdos.f5.com_apdospolicy.yaml
# - ../../crd/bases/appprotectdos.f5.com_dosprotectedresources.yaml
20 changes: 20 additions & 0 deletions config/overlays/app-protect-dos/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is generated from https://github.com/nginxinc/nap-dos-arbitrator-helm-chart
apiVersion: v1
kind: Service
metadata:
name: nginx-appprotect-dos-arbitrator
namespace: nginx-ingress
labels:
app.kubernetes.io/name: nginx-appprotect-dos-arbitrator
app.kubernetes.io/instance: nginx-appprotect-dos-arbitrator
app.kubernetes.io/version: "1.1.1"
spec:
type: ClusterIP
ports:
- port: 3000
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: nginx-appprotect-dos-arbitrator
app.kubernetes.io/instance: nginx-appprotect-dos-arbitrator
File renamed without changes.
Loading
Loading