alert-candle-88851
11/30/2021, 8:33 PM// docker-compose
agent:
image: ...
environment:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro <-- ??? How do I convert these???
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
I’m struggling to understand how the volumes syntax would map onto the Pulumi mount points interface. My pulumi code looks like this:
new awsx.ecs.FargateService('ecs-name', {
name: `resource-name`,
cluster: cluster,
taskDefinitionArgs: {
...
containers: {
containerName: {
...
mountPoints: [{???}]
}
}
},
...
})
Each MountPoint expects this type:
export interface MountPoint {
containerPath?: string;
readOnly?: boolean;
sourceVolume?: string;
}
When it comes to translating each of the volumes, how do I convert them to this format?
For example, what would the Pulumi MountPoint look like for this volume /var/run/docker.sock:/var/run/docker.sock:ro
? I’ve had limited success using the documentation. Thank you 🙏little-cartoon-10569
11/30/2021, 8:42 PMhostPath
propoerty.alert-candle-88851
12/01/2021, 12:24 AMMountPoint
interface at the container level, and not, as I think I’m understanding from you, the TaskDefinitionVolumeArgs
, at the TaskDefinition level.
In making those changes, I also went ahead and updated my packages - in case that has anything to do with it.
My updated stack now looks like this:
new awsx.ecs.FargateService('ecs-name', {
name: `resource-name`,
cluster: cluster,
taskDefinitionArgs: {
// ...
containers: {
containerName: {
// ...
mountPoints: [
{
sourceVolume: 'volume1',
containerPath: '/var/run/docker',
readOnly: true,
},
{
sourceVolume: 'volume2',
containerPath: '/host/proc/',
readOnly: true
},
{
sourceVolume: 'volume3',
containerPath: '/host/sys/fs/cgroup',
readOnly: true
}
]
}
}
},
volumes: [
{
name: 'volume1',
hostPath: '/var/run/docker.sock:/var/run/docker.sock:ro'
},
{
name: 'volume2',
hostPath: '/proc/:/host/proc/:ro'
},
{
name: 'volume3',
hostPath: '/sys/fs/cgroup/:/host/sys/fs/cgroup:ro'
}
]
// ...
})
Did I follow your logic there? I’m now noticing that Fargate doesn’t let me reference the host. Here is the error:
aws:ecs:TaskDefinition (ecs-datadog):
error: 1 error occurred:
* ClientException: Fargate compatible task definitions do not support sourcePath
Could what you’re saying be true for regular ECS taskDefinitions, but perhaps not for Fargate? I have previously had to create EFS volumes, for instance, in order to get the volumes to work. Am I seeing this wrong? Again, thank you very much! 🙏little-cartoon-10569
12/01/2021, 12:34 AMhostPath
values are suffering from some copyPasta.. They should contain a path on the host machine, not a bind pattern. So just the bit up to and excluding the first colon.alert-candle-88851
12/01/2021, 12:36 AMlittle-cartoon-10569
12/01/2021, 12:48 AM