Deploys Ingress Nginx into a Kubernetes cluster via Helm.
Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:
shellterraform login solutions.corewide.com
Initialize mandatory providers:
Copy and paste into your Terraform configuration and insert the variables:
hclmodule "tf_k8s_ingress_nginx" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2.0"
# specify module inputs here or try one of the examples below
...
}
Initialize the setup:
shellterraform init
Corewide DevOps team strictly follows Semantic Versioning
Specification
to
provide our clients with products that have predictable upgrades between versions. We
recommend
pinning
patch versions of our modules using pessimistic
constraint operator (~>) to prevent breaking changes during upgrades.
To get new features during the upgrades (without breaking compatibility), use
~> 6.2 and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "6.2.0"
|
Module
45% off
|
€280
|
| TOTAL | €500 |
| tf-k8s-cert-manager | €180 |
| tf-k8s-crd | €50 |
Deploys Ingress Nginx into a Kubernetes cluster via Helm.
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
chart_version parameter for the ingress_nginx variable to control the version of Ingress Nginx Helm charttf-k8s-cert-manager module dependency from 2.0 to 2.12026.6.28 to 2026.7.20cert_manager.version variable in favor of cert_manager.chart_version and will be deleted in v6.5ingress_nginx.version variable in favor of ingress_nginx.chart_version and will be deleted in v6.52026.1.1 and newer)forkline/ingress-nginx to keep Ingress Nginx controller usage in strict maintenance mode with dependency updates and security patches2026.6.28tf-k8s-cert-manager module dependency from 1.1 to 2.03.13.04.15.1ingress_nginx_hostname and ingress_nginx_ip output resources deprecated in version 5.2custom_values argument of the nginx_ingress variable deprecated in version 5.6 and the corresponding validation block in favour of the values_override(Last version compatible with Helm and Kubernetes Terraform providers version 2.0)
ingress_nginx.enable_json_log_format variable to enable JSON-formatted logsingress_nginx.values_override to allow passing custom values as Terraform map. Will supersede custom_values in the next major releasecustom_values argument of the nginx_ingress in favour of values_override and will be deleted in the next major releaseingress_nginx.ingress_class_name variableingress_nginx.version variable (compatible Helm chart version is 4.12.0 and newer)4.6.1 to 4.12.1) to align with latest fixes of Ingress Nginx vulnerabilitiesingress_class outputService in the data source making the module return an incorrect external IP address in the outputk8s_flavor variableingressClass name (ingress_class)ingress_nginx_ip output to ingress_ipingress_nginx_hostname output to ingress_hostnameingress_nginx_ip output in favour of ingress_ip and will be deleted in v6.0ingress_nginx_hostname output in favour of ingress_hostname and will be deleted in v6.0helm_timeout parameter for ingress_nginx variable to configure deployment timeout of its Helm releaseBREAKING CHANGE: now cert-manager setup is managed by the child module and Ingress Nginx deployment is mandatory
acme_email variable for cert-manager configurationvar.ingress_nginx.enabled parametertf-k8s-crd module dependency to ~> 2.04.0.18 to 4.6.1) versionBREAKING CHANGE: now all custom_values are declared as lists of objects which aren't compatible with previous version
k8s_flavor variableBREAKING CHANGE: now all kubernetes provider resources use versioned resources which aren't compatible with previous version
tf-k8s-crd module dependencyClusterIssuer custom resources use CRD TF moduleingress_nginx variablegavinbunney/kubectl provider dependencyBREAKING CHANGE: now module inputs and resources management have fundamentally new concept which isn't compatible with previous version
moved blocks to ensure reverse compatibility1.3ingress_* and certmanager_* separate variables into two ingress and cert-manager object variables that contain all related elementskubernetes_manifest calls for each cluser issuer into onekubernetes provider resourcesatomic nowtemplatefile function is used instead of template data sourcestemplate providerv2.x to v3.xNow all kubernetes provider resources use versioned resources. According to kubernetes provider's suggestions the simplest, non-destructive way to do this is to remove the old resource from state and import the resource as a version one. If Kubernetes namespaces were managed by the module, they must be re-imported, like so:
bashterraform state rm module.ingress.kubernetes_namespace.ingress_namespace[0] module.ingress.kubernetes_namespace.certmanager_namespace[0]
terraform import module.ingress.kubernetes_namespace_v1.ingress_namespace[0] ingress-nginx
terraform import module.ingress.kubernetes_namespace_v1.certmanager_namespace[0] cert-manager
terraform state mv 'module.ingress.kubectl_manifest.cluster_issuer["letsencrypt"]' 'module.ingress.module.cluster_issuer["letsencrypt"].kubectl_manifest.crd'
terraform state mv 'module.ingress.kubectl_manifest.cluster_issuer["letsencrypt-staging"]' 'module.ingress.module.cluster_issuer["letsencrypt-staging"].kubectl_manifest.crd'
terraform state mv 'module.ingress.kubectl_manifest.cluster_issuer["selfsigned"]' 'module.ingress.module.cluster_issuer["selfsigned"].kubectl_manifest.crd'
v3.x to v4.xNow all custom_values are declared as lists of objects. In case if there were already declared custom_values in the module inputs, then they must be updated:
hcl # Old definition | # New definition
custom_values = { | custom_values = [
"controller.containerPort" = 8080 | {
} | name = "controller.containerPort"
| value = 8080
| },
| ]
If there weren't any custom_values declared (neither for Ingress Nginx nor cert-manager), no actions are needed.
v4.x to v5.xNow cert-manager setup is managed by the child module. cert-manager resource addresses will be moved automatically with moved blocks. Ingress Nginx deployment is mandatory now. Manual removal of the input variable var.ingress_nginx.enabled is mandatory. Variable var.cert_manager.acme_email must be changed to the var.acme_email.
v5.x to v6.xModule from v6.0 has several management changes that require attention:
ingress_nginx.custom_values:hcl
module "ingress" {
...
ingress_nginx = {
...
custom_values = [
{
name = "controller.metrics.serviceMonitor.additionalLabels.app\\.kubernetes\\.io/name"
value = "ingress"
},
]
}
}
to the new ingress_nginx.values_override variable with the new format:
hcl
module "ingress" {
...
ingress_nginx = {
...
values_override = {
controller = {
metrics = {
serviceMonitor = {
additionalLabels = {
"app.kubernetes.io/name" = "ingress"
}
}
}
}
}
}
}
Updated version of the tf-k8s-cert-manager module dependency from 1.1 to 2.0. custom_values parameter might require update, for reference see to the changelog and upgrade notes of the tf-k8s-cert-manager module.
Changed Kubernetes and Helm Terraform providers versions, which aren't compatible with older versions. After the module version is upgraded, re-init the module to upgrade the providers versions. Upgrade the provider versions on the project level:
```hcl
terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 3.1"
}
text kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 3.0"
}
}
}
```
Upgrade project dependencies:
bash
terraform init --upgrade
Update the declaration of the module according to the requirements and examples to match the designed configuration, then the configuration can be applied.
Apply the changes to make sure the state of the resources is up-to-date with the new provider version:
bashterraform apply
v6.0.x to v6.1.xModule from v6.1 has changed Ingress Nginx Helm chart repository to the forkline/ingress-nginx to keep Ingress Nginx controller usage in strict maintenance mode with dependency updates and security patches.
Fork Helm chart relies on the own repository and uses date based version tags - YYYY.MM.DD. Ingress Nginx default Helm chart version is set to 2026.6.28.
Update the ingress_nginx.version to set compatible release version if the specific Ingress Nginx Helm chart version was set; or don't set the ingress_nginx.version input parameter to use the default value.
v6.1.x to v6.2.xModule from v6.2 has several adjustments that require attention:
Ingress Nginx default Helm chart version is updated to 2026.7.20. You can skip this chapter if you have already used Ingress Nginx Helm chart version 2026.7.20 or newer
Updated version of the tf-k8s-cert-manager module dependency from 2.0 to 2.1. Refer to the changelog and upgrade notes of the tf-k8s-cert-manager module
cert-manager Helm chart default version is updated to 1.21.0. You can skip this chapter if you have already used cert-manager Helm chart version 1.21.0 or newer
Update the declaration of the module according to the requirements and examples to match the designed configuration.
Now the configuration can be applied:
bashterraform apply
Deploy Ingress Nginx with cert-manager and required parameters only:
hclmodule "ingress" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2"
acme_email = "[email protected]"
}
Deploy Ingress Nginx with mandatory parameters and cert-manager's AWS Route53 integration for DNS-01 challenge. AWS Route53 RBAC configured with tf-k8s-cert-manager-dns-aws module and EKS cluster deployed with tf-aws-k8s-eks module:
hclmodule "ingress" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2"
acme_email = "[email protected]"
cert_manager = {
chart_version = "1.21.0"
dns_solver_config = module.aws_cert_manager_iam.issuer_spec
service_account_annotations = module.aws_cert_manager_iam.service_account_annotation
}
}
module "eks" {
source = "solutions.corewide.com/aws/tf-aws-k8s-eks/aws"
version = "~> 8.0"
# ...
}
module "aws_cert_manager_iam" {
source = "solutions.corewide.com/aws/tf-k8s-cert-manager-dns-aws/aws"
version = "~> 2.0"
region = "us-east-1"
hosted_zone_id = "FOO"
oidc_provider_arn = module.eks.eks_identity_provider.arn
oidc_provider_url = module.eks.eks_identity_provider.url
}
Deploy Ingress Nginx with mandatory parameters and cert-manager's Google Cloud DNS integration for DNS-01 challenge. Google Cloud DNS RBAC configured with tf-k8s-cert-manager-dns-gcp module:
hclmodule "ingress" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2"
acme_email = "[email protected]"
cert_manager = {
chart_version = "1.21.0"
dns_solver_config = module.gcp_cert_manager_iam.issuer_spec
service_account_annotations = module.gcp_cert_manager_iam.service_account_annotation
}
}
module "gcp_cert_manager_iam" {
source = "solutions.corewide.com/google-cloud/tf-k8s-cert-manager-dns-gcp/google"
version = "~> 2.0"
}
Deploy Ingress Nginx with mandatory parameters and cert-manager's Azure DNS integration for DNS-01 challenge. Azure DNS RBAC configured with tf-k8s-cert-manager-dns-azure module and AKS cluster deployed with tf-azure-k8s-aks module:
hclmodule "ingress" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2"
acme_email = "[email protected]"
cert_manager = {
chart_version = "1.21.0"
dns_solver_config = module.azure_cert_manager_iam.issuer_spec
pod_labels = module.azure_cert_manager_iam.pod_label
service_account_labels = module.azure_cert_manager_iam.service_account_label
}
}
resource "azurerm_resource_group" "main" {
name = "foo"
location = "westus2"
}
module "aks" {
source = "solutions.corewide.com/azure/tf-azure-k8s-aks/azurerm"
version = "~> 5.2"
# ...
}
module "azure_cert_manager_iam" {
source = "solutions.corewide.com/azure/tf-k8s-cert-manager-dns-azure/azurerm"
version = "~> 1.0"
resource_group_name = azurerm_resource_group.main.name
region = azurerm_resource_group.main.location
hosted_zone_name = "example.com"
hosted_zone_id = "/subscriptions/bar/dnsZones/example.com"
subscription_id = "bar"
oidc_provider_url = module.aks.cluster.oidc_issuer_url
}
Deploy Ingress Nginx with JSON log format enabled. If ingress_nginx.enable_json_log_format is enabled, Ingress Nginx will use the following JSON access log format (unless overridden using ingress_nginx.values_override):
json{
"msec": "$msec", // request unixtime in seconds with a milliseconds resolution
"connection": "$connection", // Connection serial number for current worker process
"connection_requests": "$connection_requests", // Number of requests made over the current connection
"pid": "$pid", // Process ID
"request_id": "$request_id", // Unique request ID
"request_length": "$request_length", // Length of the request in bytes including headers and body
"remote_addr": "$remote_addr", // Client IP address
"remote_user": "$remote_user", // Client user
"remote_port": "$remote_port", // Client port
"time_local": "$time_local", // Local time of the request in common log format
"time_iso8601": "$time_iso8601", // ISO8601-formatted request time
"request": "$request", // Full HTTP request line (method, URI, protocol)
"request_uri": "$request_uri", // URI path with query string
"args": "$args", // Query string parameters only (without path)
"status": "$status", // HTTP response status code
"body_bytes_sent": "$body_bytes_sent", // Number of bytes sent in response body (no headers)
"bytes_sent": "$bytes_sent", // Total bytes sent (body + headers)
"http_referer": "$http_referer", // Referring URL
"http_user_agent": "$http_user_agent", // User-Agent string from client
"http_x_forwarded_for": "$http_x_forwarded_for", // Original client IP from proxy/load balancer
"http_host": "$http_host", // Host header sent by the client
"server_name": "$server_name", // Name of the server handling the request
"request_time": "$request_time", // Time spent processing the request (seconds with milliseconds)
"upstream": "$upstream_addr", // Upstream server address (IP:port)
"upstream_connect_time": "$upstream_connect_time", // Time to connect to upstream server
"upstream_header_time": "$upstream_header_time", // Time to receive first byte from upstream
"upstream_response_time": "$upstream_response_time", // Total time taken by upstream to respond
"upstream_response_length": "$upstream_response_length", // Length of upstream response
"upstream_cache_status": "$upstream_cache_status", // Cache status (HIT, MISS, etc.)
"ssl_protocol": "$ssl_protocol", // TLS/SSL protocol version used
"ssl_cipher": "$ssl_cipher", // TLS/SSL cipher used
"scheme": "$scheme", // Request scheme
"request_method": "$request_method", // HTTP method
"server_protocol": "$server_protocol", // Protocol version
"pipe": "$pipe", // 'p' for pipelined requests, '.' otherwise
"gzip_ratio": "$gzip_ratio", // Gzip compression ratio
"http_cf_ray": "$http_cf_ray" // Cloudflare Ray ID (if Cloudflare is used)
}
hclmodule "ingress" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2"
acme_email = "[email protected]"
ingress_nginx = {
enable_json_log_format = true
}
}
Deploy Ingress Nginx with custom configuration and cert-manager. Allows using configuration-snippet in Ingress annotations:
hclmodule "ingress" {
source = "solutions.corewide.com/kubernetes/tf-k8s-ingress-nginx/helm"
version = "~> 6.2"
acme_email = "[email protected]"
cert_manager = {
chart_version = "1.21.0"
}
ingress_nginx = {
name = "ingress"
namespace = "ingress"
replicas = 3
helm_timeout = 600
values_override = {
controller = {
allowSnippetAnnotations = true
config = {
annotations-risk-level = "Critical"
}
}
}
}
}
| Variable | Description | Type | Default | Required | Sensitive |
|---|---|---|---|---|---|
acme_email |
E-mail that Let's Encrypt cluster issuer will use to request certificates | string |
yes | no | |
k8s_flavor |
Name of managed Kubernetes to enable cloud-specific adjustments. Applicable values are: aks or eks |
string |
yes | no | |
cert_manager |
cert-manager parameters. The parameters are passed to tf-k8s-cert-manager module | any |
{} |
no | no |
ingress_nginx |
Ingress Nginx parameters | object |
{} |
no | no |
ingress_nginx.chart_version |
Version of Ingress Nginx Helm chart (date based version tags - YYYY.MM.DD) |
string |
2026.7.20 |
no | no |
ingress_nginx.create_namespace |
Indicates creation of dedicated namespace for Ingress Nginx deployment | bool |
true |
no | no |
ingress_nginx.enable_json_log_format |
Enable JSON logging format for Ingress Nginx | bool |
false |
no | no |
ingress_nginx.enable_metrics |
Enable Prometheus metrics of Ingress Nginx | bool |
true |
no | no |
ingress_nginx.enable_real_ip_detection |
Enable/disable Ingress Nginx Real IP detection | bool |
true |
no | no |
ingress_nginx.helm_timeout |
Time in seconds for Helm resource to install in Kubernetes | number |
600 |
no | no |
ingress_nginx.ingress_class_name |
Name of Ingress Class of Ingress Nginx | string |
nginx |
no | no |
ingress_nginx.name |
Name to override Ingress Nginx release name | string |
ingress-nginx |
no | no |
ingress_nginx.namespace |
Namespace to install Ingress Nginx into | string |
ingress-nginx |
no | no |
ingress_nginx.replicas |
Number of Ingress Nginx controller replicas | number |
2 |
no | no |
ingress_nginx.values_override |
Custom values to override Ingress Nginx Helm chart defaults | map(any) |
{} |
no | no |
ingress_nginx.version |
Version of Ingress Nginx Helm chart (Deprecated and will be deleted in v6.5) |
string |
no | no |
| Output | Description | Type | Sensitive |
|---|---|---|---|
ingress_class |
Name of Ingress Class of Ingress Nginx | attribute |
no |
ingress_hostname |
Hostname of Ingress Nginx Load Balancer | computed |
no |
ingress_ip |
External IP of Ingress Nginx Load Balancer | computed |
no |
| Dependency | Version | Kind |
|---|---|---|
terraform |
>= 1.3 |
CLI |
hashicorp/helm |
~> 3.1 |
provider |
hashicorp/kubernetes |
~> 3.0 |
provider |
tf-k8s-cert-manager |
~> 2.1 |
module |
These components are included as is under the terms of their corresponding licenses.
| Component | License |
|---|---|
| Ingress Nginx Controller | Apache-2.0 |
| cert-manager | Apache-2.0 |