2023-11-10 19:22:06 +00:00
|
|
|
resource "docker_container" "{{.Node.DockerName}}-{{.Workload.ID.TFString}}" {
|
|
|
|
name = "{{.Node.DockerName}}-{{.Workload.ID.TFString}}"
|
2023-07-17 22:15:22 +00:00
|
|
|
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 = "on-failure"
|
|
|
|
|
|
|
|
{{- range $k, $v := .Labels }}
|
|
|
|
labels {
|
|
|
|
label = "{{ $k }}"
|
|
|
|
value = "{{ $v }}"
|
|
|
|
}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
volumes {
|
|
|
|
volume_name = "{{.TLSVolumeName}}"
|
|
|
|
container_path = "/consul/config/certs"
|
|
|
|
read_only = true
|
|
|
|
}
|
|
|
|
|
|
|
|
command = [
|
2023-09-06 23:46:34 +00:00
|
|
|
"consul", "connect", "envoy",
|
|
|
|
"-register",
|
|
|
|
"-mesh-gateway",
|
2023-11-10 19:22:06 +00:00
|
|
|
"-address={{`{{ GetInterfaceIP \"eth0\" }}`}}:{{.Workload.Port}}",
|
|
|
|
"-wan-address={{`{{ GetInterfaceIP \"eth1\" }}`}}:{{.Workload.Port}}",
|
2023-09-06 23:46:34 +00:00
|
|
|
"-grpc-addr=http://127.0.0.1:8502",
|
|
|
|
// for demo purposes (TODO: huh?)
|
2023-11-10 19:22:06 +00:00
|
|
|
"-admin-bind=0.0.0.0:{{.Workload.EnvoyAdminPort}}",
|
2023-09-06 23:46:34 +00:00
|
|
|
{{ if .Enterprise }}
|
2023-11-10 19:22:06 +00:00
|
|
|
"-partition={{.Workload.ID.Partition}}",
|
2023-09-06 23:46:34 +00:00
|
|
|
{{end}}
|
|
|
|
{{ if .Token }}
|
|
|
|
"-token={{.Token}}",
|
|
|
|
{{end}}
|
|
|
|
"--",
|
|
|
|
"-l",
|
|
|
|
"trace",
|
2023-07-17 22:15:22 +00:00
|
|
|
]
|
|
|
|
}
|