application
cloudcommons/application/kubernetes
Terraform module to deploy an application in Kubernetes. Equivalent to a Helm chart, but relaying purely on Terraform.
Kubernetes application This Terraform module mimics (most) the Helm chart out of the box features and behaviours that you can find when ``helm create mychart`, but relaying purely and solely on Terraform. Features Creates a new namespace for the application+environment Creates deployment for one or more Docker container deploymens. Ingress rules are used to route traffic to the right service Possiblity of configure liveness and readiness probe Possibility of mounting secrets as volues One service per deployment is created. Intended to use ClusterIP + Nginx-ingress One ingress for all services is deployed, including the rules to route the traffic to the right service Additional features You can add the following features by creating your own terraform modules and referencing to module outpu
| Name | Type | Description | Default |
|---|---|---|---|
| UID | string | (Required) A unique identifier to attach to the namespace | required |
| LIVENESS_PROBE | object({ initial_delay | (Optional) Application liveness probe | required |
| DEPLOYMENT_IMAGE_PULL_SECRET | string | (Optional) ImagePullSecrets is an optional list of references to secrets in the | required |
| DEPLOYMENT_LIVENESS_PROBE | object({ path = string | (Optional) Deployment liveness probe | required |
| ENVIRONMENT | string | (Optional) Application environment | required |
| SERVICE_PORT | number | (Required) The port that will be exposed by this service. | required |
| SERVICE_LOAD_BALANCER_IP | string | (Optional) Only applies to type = LoadBalancer. LoadBalancer will get created wi | required |
| READINESS_PROBE | object({ initial_delay | (Optional) Application readyness probe | required |
| APP_NAME | string | (Required) Application name | required |
| SERVICE_TARGET_PORT | number | (Optional) Number or name of the port to access on the pods targeted by the serv | required |
| ENV | map(string) | (Optional) Deployment environment variables | {} |
| ANNOTATIONS | map(string) | (Optional) Application annotations | {} |
| DEPLOYMENTS | list(object({ hostname | (Required) List of backends to deploy, and routes to get to them | [
{
"docker_image": null,
"doc |
| DEPLOYMENT_RESOURCE_REQUESTS | object({ cpu = string | (Optional) Deployment resource requests. Defaults to cpu (250m) and memory (50Mi | {
"cpu": 0,
"memory": 0
} |
| SERVICE_SESSION_AFFINITY | string | (Optional) Used to maintain session affinity. Supports ClientIP and None. Defaul | "None" |
| SERVICE_ENABLED | bool | (Optional) Creates a service for this deployment. Defaults to true | true |
| INGRESS_TLS | list(object({ hosts | (Optional) TLS configuration for the Ingress. Default to null | [] |
| INGRESS_DEFAULT_BACKEND_ENABLED | bool | (Optional) Disables the default back-end for the ingress. Defaults to false. If | false |
| DEPLOYMENT_IMAGE_PULL_POLICY | string | (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Al | "Always" |
| DEPLOYMENT_REPLICAS | number | (Optional) Number of deployment replicas. Defaults to 1 | 1 |
| DEPLOYMENT_RESOURCE_LIMITS | object({ cpu = string | (Optional) Deployment resource limits. Defaults to cpu (0.5) and memory (512Mi) | {
"cpu": 0,
"memory": 0
} |
| SERVICE_PROTOCOL | string | (Optional) The IP protocol for this port. Supports TCP and UDP. Default is TCP. | "TCP" |
| SERVICE_TYPE | string | (Optional) Determines how the service is exposed. Defaults to ClusterIP. Valid o | "ClusterIP" |
| INGRESS_ANNOTATIONS | map(string) | (Optional) Namespace annotations | {} |
| LABELS | map(string) | (Optional) Application labels | {} |
| NAMESPACE_ANNOTATIONS | map(string) | (Optional) Namespace annotations | {} |
services — List of service names createdingress — Ingress name createsname — Application full namenamespace — Namespace created for this applicationdeployments — List of deployment names created