Terraform module used to easily create a daemonset with singe container. With simple syntax.
module "daemonset" {
source = "../"
name = "mariadb"
namespace = "db"
image = "mariabdb:latest"
internal_port = [
{
name = "db"
internal_port = "3306"
}
]
}
Name | Version |
---|---|
terraform | >= 0.12.26 |
kubernetes | >= 2.0.1 |
Name | Description | Type | Default | Example | Required |
---|---|---|---|---|---|
name | Name of the daemonset | string |
n/a | application |
yes |
namespace | Namespace in which create the daemonset | string |
default |
default |
no |
custom_labels | Add custom label to pods | object |
{ app = var.name } |
{ mylabel = "apps" } |
no |
image | Docker image name | string |
n/a | ubuntu:18.04 |
yes |
image_pull_policy | One of Always, Never, IfNotPresent | string |
IfNotPresent |
Always |
no |
args | Arguments to the entrypoint | list(string) |
n/a | ["--dev", "--nodaemon"] |
no |
command | Change entrypoint array | list(string) |
n/a | ["/bin/bash", "-c", "pwd"] |
no |
service_account_name | Is the name of the ServiceAccount to use to run this pod | string |
null |
application-sa |
no |
service_accoun_token | Indicates whether a service account token should be automatically mounted | bool |
null |
true |
no |
restart_policy | Restart policy for all containers within the pod. One of Always, OnFailure, Never | string |
Always |
OnFailure |
no |
image_pull_secrets | Specify image pull secrets | map(string) |
|||
env | Name and value pairs to set in the container's environment | map(string) |
n/a | { |
no |
env_field | Get field from k8s and add as environment variables to pods | map(string) |
n/a | { |
no |
env_secret | Get secret keys from k8s and add as environment variables to pods | map(string) |
n/a | { |
no |
resources | Compute Resources required by this container. CPU/RAM requests/limits | object({ |
n/a | { |
no |
hosts | Add /etc/hosts records to pods | list(object({ |
n/a | [ |
no |
volume_mount | Mount path from pods to volume | list(object({ |
n/a | [ |
no |
volume_nfs | Represents an NFS mounts on the host | list(object({ |
n/a | [ |
no |
volume_host_path | Represents a directory from node on the host | list(object({ |
n/a | [ |
no |
volume_config_map | The data stored in a ConfigMap object can be referenced in a volume of type configMap and then consumed by containerized applications running in a Pod | list(object({ |
n/a | [ |
no |
volume_aws_disk | Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod | list(object({ |
n/a | [ |
no |
volume_gce_disk | Represents an GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod | list(object({ |
n/a | [ |
no |
volume_empty_dir | EmptyDir represents a temporary directory that shares a pod's lifetime | list(object({ |
n/a | [ |
no |
volume_claim | Represents an Persistent volume Claim resource that is attached to a kubelet's host machine and then exposed to the pod | list(object({ |
n/a | [ |
no |
readiness_probe | Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. | object({ |
n/a | { |
no |
liveness_probe | Periodic probe of container liveness. Container will be restarted if the probe fails | same as on readiness_probe | n/a | same as on readiness_probe | no |
lifecycle_events | Actions that the management system should take in response to container lifecycle events | object({ |
n/a | { |
no |
Name | Description |
---|---|
name | Name of the daemonset |
namespace | Namespace in which created the daemonset |