You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/testing/deployer/sprawl/internal/tfgen/templates/container-consul.tf.tmpl

38 lines
718 B

resource "docker_container" "{{.Node.DockerName}}" {
name = "{{.Node.DockerName}}"
network_mode = "container:${docker_container.{{.PodName}}.id}"
image = docker_image.{{.ImageResource}}.image_id
restart = "always"
env = [
"CONSUL_UID=0",
"CONSUL_GID=0",
"CONSUL_LICENSE={{.EnterpriseLicense}}",
]
{{- range $k, $v := .Labels }}
labels {
label = "{{ $k }}"
value = "{{ $v }}"
}
{{- end }}
command = [
"agent",
"-hcl",
<<-EOT
{{ .HCL }}
EOT
]
volumes {
volume_name = "{{.Node.DockerName}}"
container_path = "/consul/data"
}
volumes {
volume_name = "{{.TLSVolumeName}}"
container_path = "/consul/config/certs"
}
}