2023-07-17 22:15:22 +00:00
|
|
|
resource "docker_container" "{{.Node.DockerName}}" {
|
|
|
|
name = "{{.Node.DockerName}}"
|
|
|
|
network_mode = "container:${docker_container.{{.PodName}}.id}"
|
2023-11-02 19:25:48 +00:00
|
|
|
image = docker_image.{{.ImageResource}}.image_id
|
2023-07-17 22:15:22 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|