Set up a Helm v3 chart repository in Amazon S3
Created by Abhishek Sharma (AWS)
Summary
Notice: AWS CodeCommit is no longer available to new customers. Existing customers of AWS CodeCommit can continue to use the service as normal. Learn more
This pattern helps you to manage Helm v3 charts efficiently by integrating the Helm v3 repository into Amazon Simple Storage Service (Amazon S3) on the Amazon Web Services (AWS) Cloud. To use this pattern, you must be familiar with Kubernetes and with Helm, which is a Kubernetes package manager. Using Helm repositories to store charts and control chart versions can improve mean time to restore (MTTR) during outages.
This pattern uses AWS CodeCommit for Helm repository creation, and it uses an S3 bucket as a Helm chart repository, so that the charts can be centrally managed and accessed by developers across the organization.
Prerequisites and limitations
Prerequisites
An active AWS account
Python version 2.7.12 or later
pip
A virtual private cloud (VPC) with subnets and an Amazon Elastic Compute Cloud (Amazon EC2) instance
Git installed on the EC2 instance
AWS Identity and Access Management (IAM) access to create the S3 bucket
IAM (programmatic or role) access to Amazon S3 from the client machine
AWS CodeCommit repository
AWS Command Line Interface (AWS CLI)
Product versions
Helm v3
Python version 2.7.12 or later
Architecture
Target technology stack
Amazon S3
AWS CodeCommit
Helm
Kubectl
Python and pip
Git
helm-s3 plugin
Target architecture
Automation and scale
You can incorporate Helm into your existing continuous integration/continuous delivery (CI/CD) automation tool to automate the packaging and version control of Helm charts (out of scope for this pattern).
GitVersion or Jenkins build numbers can be used to automate version control of the charts.
Tools
Helm
– Helm is a package manager for Kubernetes that helps you install and manage applications on your Kubernetes cluster. Amazon S3 – Amazon Simple Storage Service (Amazon S3) is storage for the internet. You can use Amazon S3 to store and retrieve any amount of data at any time, from anywhere on the web.
helm-s3 plugin
– The helm-s3 plugin supports interaction with Amazon S3. It can be used with either Helm v2 or Helm v3.
Epics
Task | Description | Skills required |
---|---|---|
Install the Helm v3 client. | To download and install the Helm client on your local system, run the following command: | Cloud Administrator, DevOps Engineer |
Validate the Helm installation. | To validate the Helm client, run the following command: | Cloud Administrator, DevOps Engineer |
Task | Description | Skills required |
---|---|---|
Create an S3 bucket for Helm charts. | Create a unique S3 bucket. In the bucket, create a folder called | Cloud Administrator, DevOps Engineer |
Install the helm-s3 plugin for Amazon S3. | To install the helm-s3 plugin on your client machine, run the following command: | Cloud Administrator, DevOps Engineer |
Initialize the Amazon S3 Helm repository. | To initialize the target folder as a Helm repository, use the following command: The command creates an | Cloud Administrator, DevOps Engineer |
Verify the newly created Helm repository. | To verify that the | Cloud Administrator, DevOps Engineer |
Add the Amazon S3 repository to Helm on the client machine. | To add the target repository alias to the Helm client machine, use the following command: | Cloud Administrator, DevOps Engineer |
Task | Description | Skills required |
---|---|---|
Clone your Helm charts. | If no local Helm charts are present on in your CodeCommit repository, clone them from your GitHub repo by running the following command: | Cloud Administrator, DevOps Engineer |
Package the local Helm chart. | To package the chart that you created or cloned, use the following command: As an example, this pattern uses the | Cloud Administrator, DevOps Engineer |
Store the local package in the Amazon S3 Helm repository. | To upload the local package to the Helm repository in Amazon S3, run the following command: In the command, | Cloud Administrator, DevOps Engineer |
Search for the Helm chart. | To confirm that the chart appears both locally and in the Amazon S3 Helm repository, run the following command: | Cloud Administrator, DevOps Engineer |
Task | Description | Skills required |
---|---|---|
Modify and package the chart. | In | Cloud Administrator, DevOps Engineer |
Push the new version to the Helm repository in Amazon S3. | To push the new package, version of 0.1.1, to the my-helm-charts Helm repository in Amazon S3, run the following command: | Cloud Administrator, DevOps Engineer |
Verify the updated Helm chart. | To confirm that the updated chart appears both locally and in the Amazon S3 Helm repository, run the following commands.
| Cloud Administrator, DevOps Engineer |
Task | Description | Skills required |
---|---|---|
Search for all versions of the my-app chart. | To view all the available versions of a chart, run the following command with the Without the flag, Helm by default displays the latest uploaded version of a chart. | DevOps Engineer |
Install a chart from the Amazon S3 Helm repository. | Automated installation is out of scope for this pattern, but you can manually install. The search results from the previous task show the multiple versions of the | DevOps Engineer |
Task | Description | Skills required |
---|---|---|
Review the details for a specific revision. | Automated rollback is out of scope for this pattern, but you can roll back to an earlier version manually. Before you switch or roll back to a working version, and for an additional layer of validation before installing a revision, view which values were passed to each of the revisions by using the following command: | DevOps Engineer |
Roll back to a previous version. | Automated rollback is out of scope for this pattern. To manually roll back to a previous revision, use the following command: This example is rolling back to revision number 1. | DevOps Engineer |