Code Monkey home page Code Monkey logo

helm-s3's Introduction

helm-s3 Logo

main release codecov License MIT GitHub release Artifact Hub

helm-s3 is a Helm plugin that provides Amazon S3 protocol support.

This allows you to have private or public Helm chart repositories hosted on Amazon S3. See this guide to get a detailed example use case overview.

The plugin supports both Helm v2 and v3.

Note

The documentation is available on website.

Table of contents

Install

The installation itself is simple as:

$ helm plugin install https://github.com/hypnoglow/helm-s3.git

You can install a specific release version:

$ helm plugin install https://github.com/hypnoglow/helm-s3.git --version 0.16.0

To use the plugin, you do not need any special dependencies. The installer will download versioned release with prebuilt binary from github releases. However, if you want to build the plugin from source, or you want to contribute to the plugin, please see these instructions.

Docker Images

Docker Pulls

The plugin is also distributed as Docker images. Images are pushed to Docker Hub tagged with plugin release version and suffixed with Helm version. The image built from master branch is also available, note that it should be only used for playing and testing, it is strongly discouraged to use that image for production use cases. Refer to https://hub.docker.com/r/hypnoglow/helm-s3 for details and all available tags.

Configuration

AWS Access

To publish charts to buckets and to fetch from private buckets, you need to provide valid AWS credentials. You can do this in the same manner as for AWS CLI tool.

So, if you want to use the plugin and you are already using AWS CLI - you are good to go, no additional configuration required. Otherwise, follow the official guide to set up credentials.

To minimize security issues, remember to configure your IAM user policies properly. As an example, a setup can provide only read access for users, and write access for a CI that builds and pushes charts to your repository.

Example Read Only IAM policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::bucket-name",
                "arn:aws:s3:::bucket-name/*"
            ]
        }
    ]
}
Example Read and Write IAM policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "files",
            "Effect": "Allow",
            "Action": [
                "s3:PutObjectAcl",
                "s3:PutObject",
                "s3:GetObjectAcl",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::bucket-name/repository-name/*",
                "arn:aws:s3:::bucket-name/repository-name"
            ]
        },
        {
            "Sid": "bucket",
            "Effect": "Allow",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::bucket-name"
        }
    ]
}

Helm version mode

The plugin is able to detect if you are using Helm v2 or v3 automatically. If, for some reason, the plugin does not detect Helm version properly, you can set HELM_S3_MODE environment variable to value 2 or 3 to force the mode.

Demonstration
# We have Helm version 3:
$ helm version --short
v3.0.2+g19e47ee

# For some reason, the plugin detects Helm version badly:
$ helm s3 version --mode
helm-s3 plugin version: 0.9.2
Helm version mode: v2

# Force the plugin to operate in v3 mode:
$ HELM_S3_MODE=3 helm s3 version --mode
helm-s3 plugin version: 0.9.2
Helm version mode: v3

Usage

Note: example commands below are provided for Helm v3. If you still use Helm v2, see alternatives marked with a tip 💡.

For now let's omit the process of uploading repository index and charts to s3 and assume you already have your repository index.yaml file on s3 under path s3://bucket-name/charts/index.yaml and a chart archive epicservice-0.5.1.tgz under path s3://bucket-name/charts/epicservice-0.5.1.tgz.

Add your repository:

$ helm repo add coolcharts s3://bucket-name/charts

Now you can use it as any other Helm chart repository. Try:

$ helm search coolcharts
NAME                       	VERSION	  DESCRIPTION
coolcharts/epicservice	    0.5.1     A Helm chart.

💡 For Helm v2, use helm search coolcharts.

To install the chart:

$ helm install coolchart/epicservice --version "0.5.1"

Fetching also works:

$ helm pull coolchart/epicservice --version "0.5.1"

💡 For Helm v2, use helm fetch.

Alternatively:

$ helm pull s3://bucket-name/charts/epicservice-0.5.1.tgz

Init

To create a new repository, use init:

$ helm s3 init s3://bucket-name/charts

This command generates an empty index.yaml and uploads it to the S3 bucket under /charts key.

To work with this repo by its name, first you need to add it using native helm command:

$ helm repo add mynewrepo s3://bucket-name/charts

Push

Now you can push your chart to this repo:

$ helm s3 push ./epicservice-0.7.2.tgz mynewrepo

You may want to push the chart with relative URL, see Relative chart URLs.

On push, both remote and local repo indexes are automatically updated (that means you don't need to run helm repo update).

Your pushed chart is available:

$ helm search repo mynewrepo
NAME                    VERSION	 DESCRIPTION
mynewrepo/epicservice   0.7.2    A Helm chart.

💡 For Helm v2, use helm search mynewrepo.

Note that the plugin denies push when the chart with the same version already exists in the repository. This behavior is intentional. It is useful, for example, in CI automated pushing: if someone forgets to bump chart version - the chart would not be overwritten. However, in some cases you want to replace existing chart version. To do so, add --force flag to a push command:

$ helm s3 push --force ./epicservice-0.7.2.tgz mynewrepo

To see other available options, use --help flag:

$ helm s3 push --help

Delete

To delete specific chart version from the repository:

$ helm s3 delete epicservice --version 0.7.2 mynewrepo

As always, both remote and local repo indexes updated automatically.

The chart is deleted from the repo:

$ helm search repo mynewrepo/epicservice
No results found

💡 For Helm v2, use helm search mynewrepo/epicservice

Reindex

If your repository somehow became inconsistent or broken, you can use reindex to recreate the index in accordance with the charts in the repository.

$ helm s3 reindex mynewrepo

You may want to reindex the repo with relative chart URLs, see Relative chart URLs.

Uninstall

$ helm plugin remove s3

Thank you for using the plugin! 👋

Advanced Features

Relative chart URLs

Charts can be push-ed with --releative flag so their URLs in the index file will be relative to your repository root. This can be useful in various scenarios, e.g. serving charts via HTTP, serving charts from replicated buckets, etc.

Also, you can run reindex command with --relative flag to make all chart URLs relative in an existing repository.

Serving charts via HTTP

You can enable HTTP access to your S3 bucket and serve charts via HTTP URLs, so your repository users won't have to install this plugin.

To do this, you need your charts to have relative URLs in the index. See Relative chart URLs.

Example of setting up a public repo using Virtual hosting of buckets
  1. Create S3 bucket named example-bucket in EU (Frankfurt) eu-central-1 region.

  2. Go to "Permissions", edit Bucket Policy:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": "*",
          "Action": [
            "s3:ListBucket",
            "s3:GetObject"
           ],
          "Resource": [
            "arn:aws:s3:::example-bucket",
            "arn:aws:s3:::example-bucket/*"
          ]
        }
      ]
    }
    
  3. Initialize repository:

    $ helm s3 init s3://example-bucket
    Initialized empty repository at s3://example-bucket
    
  4. Add repository:

    $ helm repo add example-bucket s3://example-bucket
    "example-bucket" has been added to your repositories
    
  5. Create demo chart:

    $ helm create petstore
    Creating petstore
    
    $ helm package petstore --version 1.0.0
    Successfully packaged chart and saved it to: petstore-1.0.0.tgz
    
  6. Push chart:

    $ helm s3 push ./petstore-1.0.0.tgz --relative
    Successfully uploaded the chart to the repository.
    
  7. The bucket is public and chart repo is set up. Now users can use the repo without the need to install helm-s3 plugin.

    Add HTTP repo:

    $ helm repo add example-bucket-http https://example-bucket.s3.eu-central-1.amazonaws.com/
    "example-bucket-http" has been added to your repositories
    

    Search and download charts:

    $ helm search repo example-bucket-http
    NAME                            CHART VERSION	APP VERSION	DESCRIPTION
    example-bucket-http/petstore	1.0.0       	1.16.0     	A Helm chart for Kubernetes
    
    $ helm pull example-bucket-http/petstore --version 1.0.0
    

ACL

In use cases where you share a repo across multiple AWS accounts, you may want the ability to define object ACLs to allow charts to persist their permissions across accounts. To do so, add the flag --acl="ACL_POLICY". The list of ACLs can be found here:

$ helm s3 push --acl="bucket-owner-full-control" ./epicservice-0.7.2.tgz mynewrepo

Note that if you do use ACL, you need to add --acl flag for all commands, even for 'delete', because the index file is still updated when you remove a chart.

You can also set the default ACL be setting the S3_ACL environment variable.

Timeout

The default timeout for all commands is 5 minutes. This is an opinionated default to be suitable for MFA use, among other things.

If you don't use MFA, it may be reasonable to lower the timeout for most commands, e.g. to 10 seconds. In contrast, in cases where you want to reindex a big repository with thousands of charts, you definitely want to increase the timeout.

Example:

$ helm s3 push --timeout=10s ./epicservice-0.7.2.tgz mynewrepo

Using alternative S3-compatible vendors

The plugin assumes Amazon S3 by default. However, it can work with any S3-compatible object storage, like minio, DreamObjects and others. To configure the plugin to work alternative S3 backend, just define AWS_ENDPOINT (and optionally AWS_DISABLE_SSL if you play with Minio locally):

$ export AWS_ENDPOINT=localhost:9000
$ export AWS_DISABLE_SSL=true

See these integration tests that use local minio docker container for a complete example.

Using S3 bucket ServerSide Encryption

To enable S3 SSE, export environment variable AWS_S3_SSE and set it to desired type, e.g. AES256.

S3 bucket location

The plugin will look for the bucket in the region inferred by the environment. This can be controlled by exporting one of HELM_S3_REGION, AWS_REGION or AWS_DEFAULT_REGION, in order of precedence.

Since v0.11.0 the plugin supports dynamic S3 bucket region retrieval, so in most cases you don't need to provide the region. The plugin will detect it automatically and work without issues.

AWS SSO

The plugin supports AWS IAM Identity Center (aka AWS SSO) authentication.

To use AWS SSO, make sure you configured it via AWS CLI:

$ aws configure sso
SSO session name (Recommended): my-sso
SSO start URL [None]: https://my-sso-portal.awsapps.com/start
SSO region [None]: us-east-1
SSO registration scopes [None]: sso:account:access

...

CLI default client Region [None]: us-east-1
CLI default output format [None]:
CLI profile name [...]: YOUR-PROFILE-NAME

Then, set AWS_PROFILE environment variable to the profile name you used in the previous step:

$ export AWS_PROFILE=YOUR-PROFILE-NAME

Now you can use the plugin as usual.

Additional Documentation

Additional documentation is available in the docs directory. This currently includes:

Community and Related Projects

Contributing

Contributions are welcome. Please see these instructions that will help you to develop the plugin.

License

MIT

helm-s3's People

Contributors

allaryin avatar andytom avatar bashims avatar clhuang avatar conradkurth avatar dependabot[bot] avatar hmacias-avaya avatar hypnoglow avatar jouve avatar moeryomenko avatar ndegory avatar nexusix avatar pregnor avatar sanyer avatar vlaaaaaaad avatar willejs avatar willhayslett avatar yonahd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helm-s3's Issues

Support for S3 bucket region

Any way to support passing in the region for the bucket as sometimes we use helm with different environments than the S3 bucket for the chart repo and we get the following error:

fetch from s3: fetch object from s3: BucketRegionError: incorrect region, the bucket is not in 'us-west-2' region
    status code: 301, request id: , host id: 
Error: failed to download "REPO/PACKAGE" (hint: running `helm repo update` may help)

access denied error despite setting AWS credentials

Helm version: 2.14.1
plugin version: 0.8.0
I have installed helm and helm-s3 plugin on our Jenkins server. I want to build Jenkins pipeline that will package and push our helm charts to our helm repo in AWS. The Jenkins server has an IAM role with a policy allowing all s3 actions on the s3 bucket holding our helm repo. On the commandline I can list and put-object to the s3 bucket.
$ aws s3 ls 123456789-helm-bucket
PRE my-charts/
However, when I try to add this repo to the helm, I get access denied error.
helm repo add my-charts s3://123456789-helm-bucket/my-charts fetch from s3: fetch object from s3: AccessDenied: Access Denied status code: 403, request id: C641C8B8F9131614, host id: Tnu5Cu+iI+WqOoiTlousoefgn5Dfr8rKOzqY+mpebDpHPfDwKJn9JQ5xoTNBvKPfc5uHpouRchU= Error: Looks like "s3://123456789-helm-bucket/my-charts" is not a valid chart repository or cannot be reached: plugin "bin/helms3" exited with error
I have tried to run aws configure command and added credentials and also tried by setting AWS_ACCESS_KEY, AW_SECRET_KEY and AWS_REGION variables as well, but each time I get the same error.

Helm fetch requires s3 reindex

Helm fetch does not work unless you first issue s3 reindex. This is unexpected since fetch is able to interact with regular helm repos without any special caveats.

Unable to use AWS_PROFILE with credential_source configuration

When using the standard AWS CLI profile defined as:

[helm-chart-uploader]
role_arn = arn:aws:iam::#########:role/MyUploaderRole
credential_source = Ec2InstanceMetadata

I am able to upload artifacts as the cross-account user via the AWS CLI (AWS_PROFILE=helm-chart-uploader), but when running the helm s3 push command it seems to ignore the AWS_PROFILE value and not upload as the expected assumed role. If the AWS_PROFILE functionality is being delegated to the Go SDK that capability was added via aws/aws-sdk-go#2201 (which is in v1.15.54+ -- latest patch release being v1.15.89)

add "--dry-run" option for push

it would be great to be able to detect if the version of the chart as not been changed as part of PR validation instead of waiting until release.

this option would indicate if a chart upload would fail due to the version not being changed.

helm ignores AWS_DEFAULT_REGION env variable when instance profile is available and fails add repo

Hi!

Having a weird issue. See below

helm version
Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}

plugin verison 0.8.0

16:38:41  + AWS_DEFAULT_REGION=us-east-1
16:38:41  + helm repo add local s3://artifacts-xxx-us-east-1/charts

16:38:42  fetch from s3: fetch object from s3: BucketRegionError: incorrect region, the bucket is not in 'us-east-2' region
16:38:42  	status code: 301, request id: , host id: 
16:38:42  Error: Looks like "s3://artifacts-xxx-us-east-1/charts" is not a valid chart repository or cannot be reached: plugin "bin/helms3" exited with error

This script works just fine when there is no AWS instance profile available. Any ideas?

Cannot push helm chart with same version but different metadata

Hi,

We use the following version scheme for our charts "1.0.0+24.abc" : 1.0.0 is the version and the rest is build metadata (# of commits since last tag, and git commit abbrev)
The helm docs says it is supported: https://docs.helm.sh/developing_charts/#charts-and-versioning

The first time a chart with version 1.0.0+24.abc is pushed it works fine.
If we make changes in our code and create a new chart with version 1.0.0+25.def is generated.
When trying to push that chart, it gets rejected, saying the version already exists:

The chart already exists in the repository and cannot be overwritten without an explicit intent. If you want to replace existing chart, use --force flag:

    helm s3 push --force server-0.0.1+128.62d899d.tgz charts

Error: plugin "s3" exited with error

After some digging, the problem seems to be related to the way caches are built in the plugin. They rely on major, minor, patch only. In my case the cache would already contain a 1.0.0 entry so it would refuse to push a new 1.0.0 version.

Would it be wrong to use the full version, including the metadata?

Thanks,
Guenael

NoSuchBucket error on helm dep update

I'm trying to update dependencies on a chart in a private repo, but the download of the chart dependency is failing with NoSuchBucket from S3.

I've checked that I have permission to view the bucket and I've successfully pulled the file directly with the AWS cli, so I'm kind of stumped as to why this is failing.

Current set up:

  • Project has a chart dependency stored at private-repo/private-chart
  • private-repo was added using helm add repo private-repo s3://private-repo
➜  helm dep update
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
        Get http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: getsockopt: connection refused
...Successfully got an update from the "private-repo" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 13 charts
Downloading private-chart from repo s3://private-repo
2017/10/10 13:37:16 failed to fetch from s3: failed to download object from s3: NoSuchBucket: The specified bucket does not exist
        status code: 404, request id: SOMEREQUESTID, host id: SOMEHOSTID
Save error occurred:  could not download http://private-repo.s3-us-west-2.amazonaws.com/private-chart-0.0.1.tgz: plugin "bin/helms3" exited with error
Deleting newly downloaded charts, restoring pre-update state
Error: could not download http://private-repo.s3-us-west-2.amazonaws.com/private-chart-0.0.1.tgz: plugin "bin/helms3" exited with error

Reject the push if the version is already on S3

I think that the push should be rejected if the version is already there.
Maybe a strict flag if this not what you want by default?

In addition if i push the same version the index file doesn't overrides the old one.

AWS profile support

Ref: #5 (comment) #5

This cannot be fully implemented via --profile flag, because you cannot pass it to native helm commands, in case of s3 protocol usage (example: helm repo add myrepo s3://mybucket/charts).

AWS CLI also supports named profiles via AWS_PROFILE environment variable. So, adding AWS_PROFILE support for helm-s3 will be trivial and will work for all cases.

cut a new release

Its not very easy atall to use the new changes until a new release has been built and published. Can you cut a new release please?

Helm v3 macOS how do I point to the correct repo file

helm env
HELM_BIN="helm" HELM_DEBUG="false" HELM_PLUGINS="/Users/user/Library/helm/plugins" HELM_REGISTRY_CONFIG="/Users/user/Library/Preferences/helm/registry.json" HELM_REPOSITORY_CACHE="/Users/user/Library/Caches/helm/repository" HELM_REPOSITORY_CONFIG="/Users/user/Library/Preferences/helm/repositories.yaml"

helm s3 reindex my repo
load repo file: open /Users/user/.helm/repository/repositories.yaml: no such file or directory

The bug seems to be here:
https://github.com/hypnoglow/helm-s3/blob/master/internal/helmutil/repo_entry.go

Now my env var HELM HOME is empty

`echo $HELM_HOME

`

but if I populate in the session and force it to fail

export HELM_HOME=/Users/user/Library/Caches/helm/repository/

helm s3 reindex boingodev load repo file: open /Users/user/Library/Caches/helm/repository/repository/repositories.yaml: no such file or directory

So the code is assuming the /repository/repositories.yaml subfolder always exists. Which is not the case for me.

Q:Why are you using the OS environment variables instead of the helm's internal configuration?
A: the env parameter is not supported on 2.x but only on 3.x which just became stable recently.

Make is a Dependency but the docs don't state this

Hi,

Just a small issue. The docs state:

To use the plugin, you do not need any special dependencies.

The semantics of "special" may be debated here, but we encountered errors installing this plugin in an Ubuntu image because it did not make. It may help to list out in the docs that you do actually need the make utility.

Thanks!

Implement reindex operation

Due to many requests from users, it is necessary to implement this feature.

Refs:

  • #5 manual actions inside S3 bucket where charts are held may lead to broken index
  • #18 race conditions may lead to broken index

Flag --ignore-if-exists for push command

In addition to the --force flag, an --ignore-if-exists flag for the push command could be useful

My CICD test and package my whole helm repo after each commit and push the charts with helm s3.

I don't want/need to use --force for existing charts but I would like the push not to fail on them.

Most of the time only 1 chart is updated per commit so most of the pushes fail. A clean exit could be very useful and avoid some error management in the CICD.

Feature Requests - AWS Credential profiles, Deleting charts, Reindexing repo

First of all, great work with this plugin, it works like a charm for us, and alleviated a lot of friction we had using a private s3 bucket for our chart repo. Here a few feature suggestions that we would love to see (if I had the time, I would love to jump in and help out):

AWS Profiles

In my use case, my AWS credentials file has multiple profiles (one personal and one for work). It would be nice to see that there is an option to specify which credentials profile to use to access the bucket.

Possible usage: helm s3 ... [--profile (default: default)]

Reindexing the repository

If for some reason we manually go into the s3 bucket, and modify the existing charts, I think we should have a method to easily reindex the index.yaml directly from the helm command through this plugin

Possible usage: helm s3 reindex [repo]

Deleting charts from the repository

I think that there should be a method to delete charts from the repo, and regenerate the index.yaml to reflect that.

Possible usage: helm s3 delete [chartName] [repo] [--version (default: latest)].

Unable to install the plugin

$ helm version
Client: &version.Version{SemVer:"v2.8.2", GitCommit:"a80231648a1473929271764b920a8e346f6de844", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.8.2", GitCommit:"a80231648a1473929271764b920a8e346f6de844", GitTreeState:"clean"}

$ helm plugin install https://github.com/hypnoglow/helm-s3.git
Error: Unable to update checked out version

init command overwrite existing index.yaml file

Currently, the init command is destructive and will overwrite an index.yaml file if one already exists. It should handle this scenario and fail if that file already exists. There could be an explicit flag to force overwriting of existing index.yaml file.

Error: unknown command "s3" for "helm"

When I installed helm-s3 and tried to push to S3, it fails with the below error

$ helm s3 push --force "./abc-$(./version)-${CI_COMMIT_REF_NAME:0:11}-${CI_COMMIT_SHA:0:8}.tgz" "<repo_name>"
Error: unknown command "s3" for "helm"
Run 'helm --help' for usage.

`helm repo add` on an s3 bucket in different region does not work

This may not be a bug, maybe I'm missing some setting but I can't find how to make helm use a repo in a different region from the default set in my AWS profile. Here is my .aws/config file:

[profile-us-east-1]
region = us-east-1

[profile-us-west-2]
region = us-west-2

The helm s3 repo s3://mybucket-in-us-east-1/helm-charts-repo is in us-east-1. The following works:

$ export AWS_PROFILE=profile-us-east-1
$ helm repo add myrepo s3://mybucket-in-us-east-1/helm-charts-repo
"myrepo" has been added to your repositories

Now change the profile default region:

$ helm repo remove myrepo
"myrepo" has been removed from your repositories
$ export AWS_PROFILE=profile-us-west-2
$ helm repo add myrepo s3://mybucket-in-us-east-1/helm-charts-repo
fetch from s3: fetch object from s3: BucketRegionError: incorrect region, the bucket is not in 'us-west-2' region
	status code: 301, request id: , host id: 
Error: Looks like "s3://mybucket-in-us-east-1/helm-charts-repo" is not a valid chart repository or cannot be reached: plugin "bin/helms3" exited with error

What am I doing wrong?

Race condition causes inconsistencies in chart repository's index.yaml

helm s3 push CHART REPO has a race condition when multiple charts are pushed around the same time. It occurs in the following situation:

  1. UserA runs: helm s3 push CHART_A s3://REPO
  2. UserB runs: helm s3 push CHART_B s3://REPO
  3. UserA's process fetches s3://REPO/index.yaml
  4. UserB's process fetches s3://REPO/index.yaml
  5. UserA's process updates his fetched index.yaml with CHART_A's new version and replaces the remote s3://REPO/index.yaml with his updated version.
  6. UserB's process updates his fetched (and now out-of-date) index.yaml with CHART-B's new version and replaces the remote s3://REPO/index.yaml with his updated version which does not contain CHART_A.

At the end of this process, both CHART_A and CHART_B are present in the repository, but CHART_A is missing from the index so any downstream charts that require it will fail when running helm dep update CHART_THAT_DEPENDS_ON_CHART_A.

A simple solution would be for the plugin to create a mutex, e.g. index.yaml.lock before fetching index.yaml which it would delete after replacing index.yaml with the updated version.
If the lockfile is already present, the plugin should wait until it has been deleted and a new one can be created before fetching index.yaml and proceeding. In the worst case, this could cause cascading delays if many charts are frequently updated, but slow is better than broken.

Windows support?

Hi,

I was wondering if there were any plans for windows support?
When installing the plugin under windows (git bash, in admin mode) I am getting:

Downloading and installing helm-s3 v0.8.0 ...
Unsupported OS type
helm-s3 install hook failed. Please remove the plugin using 'helm plugin remove s3' and install again.
Error: plugin install hook for "s3" exited with error

I also see that there are no windows releases here:
https://github.com/hypnoglow/helm-s3/releases/

I use helm 2.11.0.

Thanks!
Guenael

Provide offline installation bundle

While the Helm S3 plugin is very helpful it seems to be available for online installation only (i.e., requires an Internet connection). We are going to use Helm on Internet connected systems as well as offline (air-gap) systems with private, non AWS-provided S3 buckets. For this reason it would be helpful to have an offline installation package for every release. This would also help in pinning a tested version.

Getting MissionRegion when trying to run "helm repo add"

Running this command
helm repo add my-helm-repo "s3://"

getting the following error,
fetch from s3: fetch object from s3: MissingRegion: could not find region configuration

How do I specify the S3 region? I am running this in a docker container

Version required

I am noticing when I am trying to install or inspect my charts it is unable to find unless I specify the verison number.

Is there no way to set the latest one as the default?

Examples:
root@SURFACE:/mnt/c/Temp# helm install myrepo/myapp --debug
[debug] Created tunnel using local port: '49901'

[debug] SERVER: "127.0.0.1:49901"

[debug] Original chart version: ""
Error: chart "myapp" matching not found in myrepo index. (try 'helm repo update'). No chart version found for myapp-

and..

root@SURFACE:/mnt/c/Temp# helm inspect myrepo/myapp --debug
Error: chart "myapp" matching not found in myrepo index. (try 'helm repo update'). No chart version found for myapp-

requirements.yaml can not reference s3 repo by name

I get this error whenever attempting to use an s3 repo inside requirements.yaml

-> % helm dep update
Error: no repository definition for mys3repo. Please add them via 'helm repo add'
Note that repositories must be URLs or aliases. For example, to refer to the stable
repository, use "https://kubernetes-charts.storage.googleapis.com/" or "@stable" instead of
"stable". Don't forget to add the repo, too ('helm repo add').

It does work with full s3 path ie. s3://mys3repo

  - name: somechart
    version: 0.1.0
    repository: "s3://mys3repo/charts"
    condition: somechart.enabled

Cannot specify Content-Type for charts tarball.

Chart tarballs are uploaded using the "binary/octet-stream" content-type. It would be nice to be able to specify a content-type like "application/x-tar" or "application/x-gzip"

Example HeadObject() response

{                                                                                                                     
    "AcceptRanges": "bytes",                                                                                          
    "ContentType": "binary/octet-stream",                                                                             
    "LastModified": "Mon, 15 Oct 2018 18:51:03 GMT",                                                                  
    "ContentLength": 25232,                                                                                           
    "VersionId": "null",                                                                                              
    "ETag": "\"11f69dd7d7dd80f72e5a6b5c6f7119bf\"",                                                                   
    "Metadata": {                                                                                                     
        "chart-metadata": "..................",          
        "chart-digest": "............................"                            
    }                                                                                                                 
} 

Plugin not working when running in environment auto configured by metadata service

When I'm trying to install the plugin into our CI runner which runs inside AWS / EC2 / kubernetes and which gets assigned/assumes an IAM role I can't add a repository because there is no ~/aws/credentials file. Even though s3 API / cli access is working.

Repo steps:

$ aws s3 ls my-helm-bucket
> 2017-12-12 15:31:01        890 index.yaml

$ helm repo add private s3://my-helm-bucket
> 2017/12/12 15:41:25 get aws config: failed to parse aws credentials file: failed to open aws credentials file: open /root/.aws/credentials: no such file or directory
Error: Looks like "s3://my-helm-bucket" is not a valid chart repository or cannot be reached: plugin "bin/helms3" exited with error

Allow anonymous access or base url in index to be overridden

Helm-s3 is really useful for uploading and managing helm charts via in S3.
However, I want my repo to be public, so ideally the provider chain would fall back to anonymous access to s3, or a baseurl could be specified to be used in the index.yaml instead?

Allow specifying permissions when pushing to chart repository

In our current setup we have two Amazon accounts, AccountA and AccountB. Charts are pushed using the s3 plugin to a bucket repo by AccountA, but AccountB needs to install charts from the repo. Unfortunately, as AccountA owns the objects, this isn't possible.

We effectively have this scenario. The only way around it is to use the AccountA to explicitly grant permission to AccountB on the files after pushing them, or by using an acl parameter, e.g.

aws s3api put-object --bucket examplebucket --key chart.tgz --grant-full-control id="canonicalUserId-ofAccountA" --body ...

when pushing the chart up initially.

What do you think about the ability to customise the permissions when pushing charts (and the index file)?

_helm s3 init_ message is missing a slash

When using an s3 bucket without index.yaml, the error message states:

The index file does not exist by the path s3://bucketname/index.yaml. If you haven't initialized the repository yet, try running "helm s3 init s3:/bucketname"

That is missing a slash after "s3:/". If you run the command as is you'll get:

upload index to s3: uri s3:/bucketname/index.yaml protocol is not s3

The error message needs to have a double slash after s3:

Official Docker Image

Hey there, thanks for the awesome plugin. Has there been any discussion about pre-packaging this with Helm in a Docker image? If not, would that be useful to this community?

Automatically update the local index.

Currently, operations like push, reindex, delete affect only the remote index, and an additional execution of helm repo update is required after each command. This can easily be improved and the plugin can implicitly update the local index after each command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.