2023-07-17 22:15:22 +00:00
|
|
|
resource "docker_container" "{{.Node.DockerName}}-{{.Service.ID.TFString}}" {
|
|
|
|
name = "{{.Node.DockerName}}-{{.Service.ID.TFString}}"
|
|
|
|
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",
|
|
|
|
"-address={{`{{ GetInterfaceIP \"eth0\" }}`}}:{{.Service.Port}}",
|
|
|
|
"-wan-address={{`{{ GetInterfaceIP \"eth1\" }}`}}:{{.Service.Port}}",
|
|
|
|
"-grpc-addr=http://127.0.0.1:8502",
|
|
|
|
// for demo purposes (TODO: huh?)
|
|
|
|
"-admin-bind=0.0.0.0:{{.Service.EnvoyAdminPort}}",
|
|
|
|
{{ if .Enterprise }}
|
|
|
|
"-partition={{.Service.ID.Partition}}",
|
|
|
|
{{end}}
|
|
|
|
{{ if .Token }}
|
|
|
|
"-token={{.Token}}",
|
|
|
|
{{end}}
|
|
|
|
"--",
|
|
|
|
"-l",
|
|
|
|
"trace",
|
2023-07-17 22:15:22 +00:00
|
|
|
]
|
|
|
|
}
|