Helm is like the app store for Kubernetes—making it incredibly easy to package, deploy, and manage even the most complex applications. When paired with Amazon Elastic Container Registry (ECR), you get a secure and scalable way to store and distribute your Helm charts, ensuring smooth deployments across different environments. But what about old versions? Storing archived Helm charts in Amazon S3 keeps your backups safe, ensuring you’re always prepared for rollbacks or disaster recovery.
In this guide, we’ll walk you through storing Helm charts in Amazon ECR for streamlined container orchestration while ensuring older versions are safely archived in Amazon S3 for disaster recovery. Whether you’re optimizing workflows or preparing for the unexpected, this approach will make your Kubernetes operations smoother, safer, and more efficient. Let’s dive in!
Amazon ECR is an OCI-compliant registry that offers several advantages for Helm chart storage:
High Availability: Fully managed, highly available container registry.
Security: Supports IAM-based authentication and AWS PrivateLink.
Flexibility & Integration: Once your Helm charts are stored in ECR, you can access them from any environment. Whether AWS based or not, making it a versatile solution for cross-platform deployments.
Amazon S3 provides:
Durability: 99.999999999% (11 nines) of durability for stored objects.
Disaster Recovery: Secure backups in case of accidental deletion or corruption.
aws configure
helm create helm-test-chart
helm package helm-test-chart
Successfully packaged chart and saved it to: /Users/username/helm-test-chart-0.1.0.tgz
aws ecr create-repository --repository-name helm-test-chart --region
aws ecr get-login-password \
--region | helm registry login \
--username \
--password-stdin .dkr.ecr.region.amazonaws.com
helm push helm-test-chart-0.1.0.tgz oci://aws_account_id.dkr.ecr.region.amazonaws.com/
aws ecr describe-images --repository-name helm-test-chart --region us-west-2
{
"imageDetails": [
{
"registryId": "aws_account_id",
"repositoryName": "helm-test-chart",
"imageDigest": "sha256:dd8aebdda7df991a0ffe0b3d6c0cf315fd582cd26f9755a347a52adEXAMPLE",
"imageTags": [
"0.1.0"
],
"imageSizeInBytes": 1620,
"imagePushedAt": "2021-09-23T11:39:30-05:00",
"imageManifestMediaType": "application/vnd.oci.image.manifest.v1+json",
"artifactMediaType": "application/vnd.cncf.helm.config.v1+json"
}
]
}
aws ecr get-login-password --region $AWS_REGION | helm registry login --username AWS --password-stdin $ECR_REPO
helm pull oci://211125292961.dkr.ecr.ap-south-1.amazonaws.com/helm-test-chart --version 0.1.0
aws s3 mb s3://
aws s3 cp helm-test-chart-0.1.0.tgz s3:///helm-charts/
aws s3 ls s3:///helm-charts/
helm pull oci://.dkr.ecr.ap-south-1.amazonaws.com/ --version 0.1.0
helm install my-release helm-test-chart-0.1.0.tgz
aws s3 cp s3://my-helm-backups/helm-test-chart-0.1.0.tgz .
helm install my-release helm-test-chart-0.1.0.tgz
By storing Helm charts in Amazon ECR, you ensure a secure, scalable, and highly available deployment process. Backing them up to Amazon S3 ensures durability, disaster recovery, and cost optimization. Automating these backups further strengthens your Kubernetes application lifecycle management, providing reliability and efficiency.