Skip to content

Commit 5ef3428

Browse files
committed
helm s3 repo
1 parent d6087f1 commit 5ef3428

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

helm/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ sudo mv linux-amd64/helm /usr/local/bin/helm
1313
kubect create -f helm-rbac.yaml
1414
helm init --service-account tiller
1515
```
16+
17+
## Setup S3 helm repository
18+
Make sure to set the default region in setup-s3-helm-repo.sh
19+
```
20+
./setup-s3-helm-repo.sh
21+
```
22+
23+
## Package and push demo-chart
24+
25+
```
26+
export AWS_REGION=yourregion # if not set in ~/.aws
27+
helm package demo-chart
28+
helm s3 push ./demo-chart-0.0.1.tgz my-charts
29+
```

helm/setup-s3-helm-repo.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
RANDOM_STRING=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | tr '[:upper:]' '[:lower:]' | head -n 1)
6+
7+
# it's important to set the AWS_REGION if not set. Change the default
8+
DEFAULT_REGION="eu-west-1"
9+
AWS_REGION="${AWS_REGION:-${DEFAULT_REGION}}"
10+
11+
if [ "$AWS_REGION" == "us-east-1" ] ; then
12+
aws s3api create-bucket --bucket helm-${RANDOM_STRING}
13+
else
14+
aws s3api create-bucket --bucket helm-${RANDOM_STRING} --region $AWS_REGION --create-bucket-configuration LocationConstraint=${AWS_REGION}
15+
fi
16+
17+
helm plugin install https://github.com/hypnoglow/helm-s3.git
18+
helm s3 init s3://helm-${RANDOM_STRING}/charts
19+
helm repo add my-charts s3://helm-lcxqoc24/charts

0 commit comments

Comments
 (0)