expose-service-ingress

alemuro/expose-service-ingress/kubernetes

Terraform Module HCL KUBERNETES

Terraform module to deploy and expose a kubernetes service using Traefik

Install
module "expose-service-ingress" {
source = "alemuro/expose-service-ingress/kubernetes"
version = "1.28.0"
}
plain text: /constructs/tfmod-alemuro-expose-service-ingress-kubernetes/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform Module for exposing a service through an Ingress This module provides an easy way to deploy pods and to expose them to the Internet by configuring the proper service and ingresses. It has been designed to allow pods with only one container. See examples below. This module has been designed to work on a K3S cluster with Traefik and files stored locally. It supports cert-manager for creating Let's Encrypt certificates. Take into consideration that a ClusterIssuer with name "letsencrypt" should be created before using this module. Supported Ingresses Currently there is only one ingress supported. Feel free to open PR's to add support for others: * Traefik Providers | Name | Version | |------|---------| | kubernetes | n/a | Inputs | Name | Description | Type | Default | Required | |-

Inputs (25)
NameTypeDescriptionDefault
imagestringImage name and tag to deploy. required
namestringName used to identify deployed container and all related resources. required
cloudflare_domainslist(string)List of domains that should be exposed through Cloudflare Tunnel. Requires the i[]
namespacestringKubernetes namespace where resources must be created."default"
service_portstringPort configured on the service side to receive requests (routed to the container"80"
capabilities_addlist(string)List of capabilities to add to the container.[]
annotationsobject({ ingress = optionaAnnotations added to some components. Only ingress and service supported at the { "ingress": {}, "service": {} }
allow_fromlist(string)List of services to allow traffic from[]
configmapsmap(string)Map with configmaps to mount in the container, where the key is the path where i{}
pvcslist(object({ name = Object that contains the list of PVCs to mount in the container[]
domainslist(string)List of domains that should be configured to route traffic from.[]
host_networkboolWhether to run the container in host network mode. Defaults to false.false
node_selectormap(string)Node selector to use when deploying the container.null
resourcesobject({ limits = map(stMap with resources limits and requests.{ "limits": {}, "requests": {} }
host_portstringHost port where to send to requests to.null
pod_additional_portslist(object({ name List of additional ports to expose on the pod.[]
pathsmap(any)Object mapping local paths to container paths{}
container_portstringContainer port where to send to requests to. If doesn't exist, service won't be null
environment_variablesmap(any)Map with environment variables injected to the containers.{}
supplemental_groupslist(string)List of supplemental groups to add to the container.[]
httpsboolWhether to create an ingress for HTTPS traffic.true
argslist(string)List of arguments to pass to the container[]
Resources (7)
kubernetes_config_map_v1kubernetes_deploymentkubernetes_ingress_v1kubernetes_network_policy_v1kubernetes_pod_disruption_budget_v1kubernetes_servicekubernetes_stateful_set_v1
Details
FrameworkTerraform Module
LanguageHCL
Version1.28.0
Cloud KUBERNETES
★ Stars2
Forks1
Total downloads4.8k
Inputs25
Resources7
Examples1
LicenseMIT
Namespacealemuro
Updated