-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add external ingress-nginx controller (#58)
Jira: EPMDEDP-13452 Related: #58 Change-Id: I0690faa2bb3b911f6e9a9b63e8d4c64fdb6e1621
- Loading branch information
1 parent
35d0965
commit db4b406
Showing
8 changed files
with
271 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v2 | ||
name: ingress-nginx | ||
description: A Helm chart for Nginx Ingress Controller | ||
|
||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
type: application | ||
|
||
# The chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
version: 4.7.3 | ||
|
||
# Version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. | ||
appVersion: "1.8.4" | ||
|
||
dependencies: | ||
- name: ingress-nginx | ||
version: 4.7.3 | ||
repository: https://kubernetes.github.io/ingress-nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# ingress-nginx | ||
|
||
![Version: 4.7.3](https://img.shields.io/badge/Version-4.7.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.8.4](https://img.shields.io/badge/AppVersion-1.8.4-informational?style=flat-square) | ||
|
||
A Helm chart for Nginx Ingress Controller | ||
|
||
# Internal and External Ingress Controllers | ||
|
||
The **Internal Ingress Controller** is used for internal traffic, while the **External Ingress Controller** is used for external traffic. | ||
|
||
┌────────────────────────────────┐ | ||
│ Kubernetes Cluster │ | ||
├──────────┐ │ | ||
│ NodePort │ │ | ||
┌────► ◄──┐ │ | ||
│ │ 32443 │ │ ┌───────────┐ │ | ||
┌───────────────────────┐ │ ├──────────┘ │ │ Internal │ │ | ||
│ Internal LoadBalancer ├────────┤ │ ├─┤ Ingress │ │ | ||
└───────────────────────┘ │ ├──────────┐ │ │ Controller│ │ | ||
│ │ NodePort │ │ └───────────┘ │ | ||
└────► ◄──┘ │ | ||
│ 32080 │ │ | ||
├──────────┘ │ | ||
│ │ | ||
│ │ | ||
├──────────┐ │ | ||
│ NodePort │ │ | ||
┌────► ◄──┐ │ | ||
│ │ 31443 │ │ ┌───────────┐ │ | ||
┌───────────────────────┐ │ ├──────────┘ │ │ External │ │ | ||
│ External LoadBalancer ├────────┤ │ ├─┤ Ingress │ │ | ||
└───────────────────────┘ │ ├──────────┐ │ │ Controller│ │ | ||
│ │ NodePort │ │ └───────────┘ │ | ||
└────► ◄──┘ │ | ||
│ 31080 │ │ | ||
├──────────┘ │ | ||
│ │ | ||
└────────────────────────────────┘ | ||
|
||
To deploy and use the **Internal Ingress Controller** and **External Ingress Controller** in the cluster, follow the steps below: | ||
|
||
1. Enable the `Internal Ingress Controller` add-on by setting the `ingress-nginx.enable: true` and `ingress-nginx.createNamespace: true` parameters in the `charts/values.yaml` file.<br> | ||
This will create the `ingress-nginx` namespace and deploy the **Internal Ingress Controller** in the cluster.<br> | ||
Internal Ingress Controller listens to the following node ports: 32080 and 32443.<br> | ||
The `watchIngressWithoutClass` parameter is set to `true`, so the Internal Ingress Controller will watch for all Ingress resources withing the cluster. | ||
|
||
> **NOTE:** Internal Ingress Controller is watching for all Ingress resources within a cluster.<br> | ||
You should set the `ingressClassName` parameter in the Ingress resource to `nginx` or leave it empty. | ||
|
||
2. Enable the `External Ingress Controller` add-on by setting the `ingress-nginx-external.enable: true` and `ingress-nginx-external.createNamespace: true` parameters in the `charts/values.yaml` file.<br> | ||
This will create the `ingress-nginx-external` namespace and deploy the **External Ingress Controller** in the cluster.<br> | ||
Internal Ingress Controller listens to the following node ports: 31080 and 31443.<br> | ||
|
||
> **NOTE:** External Ingress Controller is not watching for all Ingress resources within a cluster.<br> | ||
To use the External Ingress Controller, you need to set the `ingressClassName` parameter in the Ingress resource to `nginx-external`. | ||
|
||
## Requirements | ||
|
||
| Repository | Name | Version | | ||
|------------|------|---------| | ||
| https://kubernetes.github.io/ingress-nginx | ingress-nginx | 4.7.3 | | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| ingress-nginx.controller.addHeaders.Strict-Transport-Security | string | `"max-age=63072000; includeSubDomains"` | | | ||
| ingress-nginx.controller.addHeaders.X-Content-Type-Options | string | `"nosniff"` | | | ||
| ingress-nginx.controller.addHeaders.X-Frame-Options | string | `"SAMEORIGIN"` | | | ||
| ingress-nginx.controller.config.client-header-buffer-size | string | `"64k"` | | | ||
| ingress-nginx.controller.config.http2-max-field-size | string | `"64k"` | | | ||
| ingress-nginx.controller.config.http2-max-header-size | string | `"64k"` | | | ||
| ingress-nginx.controller.config.keep-alive | string | `"10"` | | | ||
| ingress-nginx.controller.config.large-client-header-buffers | string | `"4 64k"` | | | ||
| ingress-nginx.controller.config.proxy-buffer-size | string | `"8k"` | | | ||
| ingress-nginx.controller.config.proxy-real-ip-cidr | string | `"192.168.0.0/20"` | | | ||
| ingress-nginx.controller.config.ssl-redirect | string | `"true"` | | | ||
| ingress-nginx.controller.config.upstream-keepalive-timeout | string | `"120"` | | | ||
| ingress-nginx.controller.config.use-forwarded-headers | string | `"true"` | | | ||
| ingress-nginx.controller.ingressClassResource.controllerValue | string | `"k8s.io/external-ingress-nginx"` | | | ||
| ingress-nginx.controller.ingressClassResource.name | string | `"external-nginx"` | | | ||
| ingress-nginx.controller.podAnnotations."fluentbit.io/parser" | string | `"k8s-nginx-ingress"` | | | ||
| ingress-nginx.controller.resources.limits.memory | string | `"256Mi"` | | | ||
| ingress-nginx.controller.resources.requests.cpu | string | `"50m"` | | | ||
| ingress-nginx.controller.resources.requests.memory | string | `"128M"` | | | ||
| ingress-nginx.controller.service.nodePorts.http | int | `31080` | | | ||
| ingress-nginx.controller.service.nodePorts.https | int | `31443` | | | ||
| ingress-nginx.controller.service.type | string | `"NodePort"` | | | ||
| ingress-nginx.controller.watchIngressWithoutClass | bool | `false` | | | ||
| ingress-nginx.defaultBackend.enabled | bool | `true` | | | ||
| ingress-nginx.metrics.enabled | bool | `true` | | | ||
| ingress-nginx.serviceAccount.create | bool | `true` | | | ||
| ingress-nginx.serviceAccount.name | string | `"nginx-ingress-service-account"` | | | ||
| ingress-nginx.updateStrategy.rollingUpdate.maxUnavailable | int | `1` | | | ||
| ingress-nginx.updateStrategy.type | string | `"RollingUpdate"` | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{ template "chart.header" . }} | ||
{{ template "chart.deprecationWarning" . }} | ||
|
||
{{ template "chart.badgesSection" . }} | ||
|
||
{{ template "chart.description" . }} | ||
|
||
{{ template "chart.homepageLine" . }} | ||
|
||
# Internal and External Ingress Controllers | ||
|
||
The **Internal Ingress Controller** is used for internal traffic, while the **External Ingress Controller** is used for external traffic. | ||
|
||
┌────────────────────────────────┐ | ||
│ Kubernetes Cluster │ | ||
├──────────┐ │ | ||
│ NodePort │ │ | ||
┌────► ◄──┐ │ | ||
│ │ 32443 │ │ ┌───────────┐ │ | ||
┌───────────────────────┐ │ ├──────────┘ │ │ Internal │ │ | ||
│ Internal LoadBalancer ├────────┤ │ ├─┤ Ingress │ │ | ||
└───────────────────────┘ │ ├──────────┐ │ │ Controller│ │ | ||
│ │ NodePort │ │ └───────────┘ │ | ||
└────► ◄──┘ │ | ||
│ 32080 │ │ | ||
├──────────┘ │ | ||
│ │ | ||
│ │ | ||
├──────────┐ │ | ||
│ NodePort │ │ | ||
┌────► ◄──┐ │ | ||
│ │ 31443 │ │ ┌───────────┐ │ | ||
┌───────────────────────┐ │ ├──────────┘ │ │ External │ │ | ||
│ External LoadBalancer ├────────┤ │ ├─┤ Ingress │ │ | ||
└───────────────────────┘ │ ├──────────┐ │ │ Controller│ │ | ||
│ │ NodePort │ │ └───────────┘ │ | ||
└────► ◄──┘ │ | ||
│ 31080 │ │ | ||
├──────────┘ │ | ||
│ │ | ||
└────────────────────────────────┘ | ||
|
||
To deploy and use the **Internal Ingress Controller** and **External Ingress Controller** in the cluster, follow the steps below: | ||
|
||
1. Enable the `Internal Ingress Controller` add-on by setting the `ingress-nginx.enable: true` and `ingress-nginx.createNamespace: true` parameters in the `charts/values.yaml` file.<br> | ||
This will create the `ingress-nginx` namespace and deploy the **Internal Ingress Controller** in the cluster.<br> | ||
Internal Ingress Controller listens to the following node ports: 32080 and 32443.<br> | ||
The `watchIngressWithoutClass` parameter is set to `true`, so the Internal Ingress Controller will watch for all Ingress resources withing the cluster. | ||
|
||
> **NOTE:** Internal Ingress Controller is watching for all Ingress resources within a cluster.<br> | ||
You should set the `ingressClassName` parameter in the Ingress resource to `nginx` or leave it empty. | ||
|
||
2. Enable the `External Ingress Controller` add-on by setting the `ingress-nginx-external.enable: true` and `ingress-nginx-external.createNamespace: true` parameters in the `charts/values.yaml` file.<br> | ||
This will create the `ingress-nginx-external` namespace and deploy the **External Ingress Controller** in the cluster.<br> | ||
Internal Ingress Controller listens to the following node ports: 31080 and 31443.<br> | ||
|
||
> **NOTE:** External Ingress Controller is not watching for all Ingress resources within a cluster.<br> | ||
To use the External Ingress Controller, you need to set the `ingressClassName` parameter in the Ingress resource to `nginx-external`. | ||
|
||
{{ template "chart.maintainersSection" . }} | ||
|
||
{{ template "chart.sourcesSection" . }} | ||
|
||
{{ template "chart.requirementsSection" . }} | ||
|
||
{{ template "chart.valuesSection" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
ingress-nginx: | ||
controller: | ||
podAnnotations: | ||
fluentbit.io/parser: k8s-nginx-ingress | ||
addHeaders: | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
Strict-Transport-Security: max-age=63072000; includeSubDomains | ||
resources: | ||
limits: | ||
memory: "256Mi" | ||
requests: | ||
cpu: "50m" | ||
memory: "128M" | ||
config: | ||
ssl-redirect: 'true' | ||
client-header-buffer-size: '64k' | ||
http2-max-field-size: '64k' | ||
http2-max-header-size: '64k' | ||
large-client-header-buffers: '4 64k' | ||
upstream-keepalive-timeout: '120' | ||
keep-alive: '10' | ||
use-forwarded-headers: 'true' | ||
proxy-real-ip-cidr: '192.168.0.0/20' | ||
proxy-buffer-size: '8k' | ||
|
||
# This Ingress Class should be used when requested by the user in his Ingress resources. | ||
watchIngressWithoutClass: false | ||
|
||
ingressClassResource: | ||
# To expose endpoints via this Ingress Controller, you should use the following Ingress Class in your Ingress resources. | ||
name: "external-nginx" | ||
controllerValue: "k8s.io/external-ingress-nginx" | ||
|
||
service: | ||
type: NodePort | ||
nodePorts: | ||
http: 31080 | ||
https: 31443 | ||
updateStrategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
metrics: | ||
enabled: true | ||
defaultBackend: | ||
enabled: true | ||
serviceAccount: | ||
create: true | ||
name: nginx-ingress-service-account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{- if and (index .Values "ingress-nginx-external") (index .Values "ingress-nginx-external" "enable") -}} | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: ingress-nginx-external | ||
namespace: {{ .Values.argoNamespace | default "argocd" }} | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: {{ .Values.argoProject | default "default" }} | ||
source: | ||
repoURL: {{ .Values.repoUrl }} | ||
path: add-ons/ingress-nginx-external | ||
targetRevision: {{ .Values.targetRevision }} | ||
helm: | ||
values: | | ||
ingress-nginx: | ||
{{- toYaml (index .Values "ingress-nginx-external") | nindent 10 }} | ||
destination: | ||
name: {{ .Values.destinationServer | default "in-cluster" }} | ||
namespace: ingress-nginx-external | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
syncOptions: | ||
- CreateNamespace={{ (index .Values "ingress-nginx-external" "createNamespace") }} | ||
retry: | ||
limit: 1 | ||
backoff: | ||
duration: 5s | ||
factor: 2 | ||
maxDuration: 1m | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters