Create and upload container images to AWS ECR with Kaniko inside Kubernetes

In this post i’ll show how to create container images inside Kubernetes using Kaniko and uploading to ECR repository.

First of all we need to configure kaniko for ecr url and aws credentials to work with ecr using iam. Kaniko config doesnt comes with aws ecr helper tag we should add our ecr fqdn and tag to this file.

kanikoconfig.json

Using kubectl creating configmap with this config.json

It also need aws credentials so we’r going to give this using kubectl create secret. Im going to use only ecr access iam credentials for this.

Kaniko.yaml

Here kaniko logs:

Lets check ecr repository

This entry was posted in AWS, Kubernetes. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *