- Above quoted post with github issue page (#8986) has all the supporting data including
loki-config.yaml
and nginx.conf
- ECS task definition below.
{
...
"containerDefinitions": [
{
...
"entryPoint": [
"/usr/bin/loki"
],
"portMappings": [
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 3100
},
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 7946
},
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 9095
}
],
"command": [
"-config.file=/etc/loki/config.yaml",
"-target=read",
"-config.expand-env=true"
],
...
"environment": [
{
"name": "instance_interface_names1",
"value": "lo"
},
{
"name": "join_members",
"value": "127.0.0.1:7946"
}
],
...
"image": "loki-2.7.5-image",
"disableNetworking": false,
"essential": true,
"name": "read"
},
{
"entryPoint": [
"/usr/bin/loki"
],
"portMappings": [
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 3100
},
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 7946
},
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 9095
}
],
"command": [
"-config.file=/etc/loki/config.yaml",
"-target=write",
"-config.expand-env=true"
],
...
"environment": [
{
"name": "instance_interface_names1",
"value": "lo"
},
{
"name": "join_members",
"value": "127.0.0.1:7946"
}
],
...
"image": "loki-2.7.5-image",
"disableNetworking": false,
"essential": true,
"name": "write"
},
{
"entryPoint": [
nginx-config
],
"portMappings": [
{
"hostPort": 3100,
"protocol": "tcp",
"containerPort": 3100
}
],
...
"image": "nginx:latest",
"dependsOn": [
{
"containerName": "read",
"condition": "START"
},
{
"containerName": "write",
"condition": "START"
}
],
"disableNetworking": false,
"essential": true,
"links": [
"read:read",
"write:write"
],
"name": "gateway"
}
],
...
"requiresAttributes": [
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
},
{
"name": "ecs.capability.container-ordering"
}
],
"networkMode": "bridge",
}
Unset variables, default null values and sensitive information is excluded for brevity and security.
- Currently running in
bridge mode
for dynamic port mapping and having envisioned to scale it further.
- From what i can understand if using
host
or awsvpc
would consume the three container ports restricting scaling on same EC2 instance.