Closed sesh-kebab closed 5 years ago
The mapping argument is an alternative to using docker config when creating a layer0 instance. So it isn't about a necessary or unecessary step, but giving the user an option in how they want the container instances to pull the images.
They can already do that right now, correct? If they use images with the ecr tag in the deploy file?
If they are hosting in carbon, yes. Assuming by ecr tag you mean the ecr uri prefix e.g., 12345.dkr.ecr.us-west-2.amazonaws.com
in the image.
closing due to inactivity and priority. might be worthwhile re-visting at some point.
I think we should consider merging this provided we have some end-user documentation
Old PR, closing for now.
What does this pull request do? Adds a new configuration called
docker-repo-override
to l0-setup. This allows the user to specify a mapping of docker image prefixes. For example, the value can be set to:d.ims.io:12345.dkr.ecr.us-west-2.amazonaws.com
.One use case this allows is to allow images to be pulled from an ECR repository without specifying docker credentials.
How should this be tested?
d.ims.io:<carbon_aws_account_Id>.dkr.ecr.us-west-2.amazonaws.com
(Or you can re-use my instanceseshichunnels
)l0 deploy create <task definition> guestbook-dpl
a. Confirm the deploy correctly replaces the image prefix correctlygo run main.go -o json deploy get guestbook-dpl | jq '.[0].dockerrun' -r | base64 -d | jq .
l0 create environment demo-env && l0 loadbalancer create --port 80:80/http demo-env guestbook-lb
l0 environment create demo-env
l0 service create --loadbalancer demo-env:guestbook-lb demo-env guestbook-svc guestbook-dpl:latest
If the above steps worked, it would've meant that instead of pulling the image via a proxy docker repo frontend (like d.ims.io), the image was pulled directly from ECR by the ecs-agent authenticating using the IAM Role permissions. The image
d.ims.io/quintilesims/guestbook
is also hosted on the carbon account's ECR. So the test confirms that cross-account access will also work.Notes: An image called
d.ims.io/quintilesims/guestbook:latest
already exists.You can use the below task definition for step 2:
Checklist
closes #540 links https://github.com/quintilesims/d.ims.io/pull/58