Giter VIP home page Giter VIP logo

helm-push's Introduction

ChartMuseum

GitHub Actions status Go Report Card GoDoc


ChartMuseum is an open-source Helm Chart Repository server written in Go (Golang), with support for cloud storage backends, including Google Cloud Storage, Amazon S3, Microsoft Azure Blob Storage, Alibaba Cloud OSS Storage, Openstack Object Storage, Oracle Cloud Infrastructure Object Storage, Baidu Cloud BOS Storage, Tencent Cloud Object Storage, DigitalOcean Spaces, Minio, and etcd.

Works as a valid Helm Chart Repository, and also provides an API for uploading charts.

Powered by some great Go technology:

API

Helm Chart Repository

  • GET /index.yaml - retrieved when you run helm repo add chartmuseum http://localhost:8080/
  • GET /charts/mychart-0.1.0.tgz - retrieved when you run helm install chartmuseum/mychart
  • GET /charts/mychart-0.1.0.tgz.prov - retrieved when you run helm install with the --verify flag

Chart Manipulation

  • POST /api/charts - upload a new chart version
  • POST /api/prov - upload a new provenance file
  • DELETE /api/charts/<name>/<version> - delete a chart version (and corresponding provenance file)
  • GET /api/charts - list all charts
  • GET /api/charts/<name> - list all versions of a chart
  • GET /api/charts/<name>/<version> - describe a chart version
  • GET /api/charts/<name>/<version>/templates - get chart template
  • GET /api/charts/<name>/<version>/values - get chart values
  • HEAD /api/charts/<name> - check if chart exists (any versions)
  • HEAD /api/charts/<name>/<version> - check if chart version exists

Server Info

  • GET / - HTML welcome page
  • GET /info - returns current ChartMuseum version
  • GET /health - returns 200 OK

Uploading a Chart Package

Follow "How to Run" section below to get ChartMuseum up and running at http://localhost:8080

First create mychart-0.1.0.tgz using the Helm CLI:

cd mychart/
helm package .

Upload mychart-0.1.0.tgz:

curl --data-binary "@mychart-0.1.0.tgz" http://localhost:8080/api/charts

If you've signed your package and generated a provenance file, upload it with:

curl --data-binary "@mychart-0.1.0.tgz.prov" http://localhost:8080/api/prov

Both files can also be uploaded at once (or one at a time) on the /api/charts route using the multipart/form-data format:

curl -F "[email protected]" -F "[email protected]" http://localhost:8080/api/charts

You can also use the helm-push plugin:

helm cm-push mychart/ chartmuseum

Installing Charts into Kubernetes

Add the URL to your ChartMuseum installation to the local repository list:

helm repo add chartmuseum http://localhost:8080

Search for charts:

helm search repo chartmuseum/

Install chart:

helm install chartmuseum/mychart --generate-name

How to Run

CLI

Installation

You can use the installer script:

curl https://raw.githubusercontent.com/helm/chartmuseum/main/scripts/get-chartmuseum | bash

or download manually from the releases page, which also contains all package checksums and signatures.

Determine your version with chartmuseum --version.

Configuration

Show all CLI options with chartmuseum --help. Common configurations can be seen below.

All command-line options can be specified as environment variables, which are defined by the command-line option, capitalized, with all -'s replaced with _'s.

For example, the env var STORAGE_AMAZON_BUCKET can be used in place of --storage-amazon-bucket.

Using a configuration file

Use chartmuseum --config config.yaml to read configuration from a file.

When using file-based configuration, the corresponding option name can be looked up in pkg/config/vars.go. It would be the key of configVars entry corresponding to the command line option / environment variable. For example, --storage corresponds to storage.backend in the configuration file.

Here's a complete example of a config.yaml:

debug: true
port: 8080
storage.backend: local
storage.local.rootdir: <storage_path>
bearerauth: 1
authrealm: <authorization server url>
authservice: <authorization server service name>
authcertpath: <path to authorization server public pem file>
authactionssearchpath: <optional: JMESPath to find allowed actions in a jwt token>
depth: 2

Using with Amazon S3 or Compatible services like Minio or DigitalOcean.

Make sure your environment is properly setup to access my-s3-bucket

For Amazon S3, endpoint is automatically inferred.

chartmuseum --debug --port=8080 \
  --storage="amazon" \
  --storage-amazon-bucket="my-s3-bucket" \
  --storage-amazon-prefix="" \
  --storage-amazon-region="us-east-1"

For S3 compatible services like Minio, set the credentials using environment variables and pass the endpoint.

export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
chartmuseum --debug --port=8080 \
  --storage="amazon" \
  --storage-amazon-bucket="my-s3-bucket" \
  --storage-amazon-prefix="" \
  --storage-amazon-region="us-east-1" \
  --storage-amazon-endpoint="my-s3-compatible-service-endpoint"

You need at least the following permissions inside your IAM Policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowListObjects",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::my-s3-bucket"
    },
    {
      "Sid": "AllowObjectsCRUD",
      "Effect": "Allow",
      "Action": [
        "s3:DeleteObject",
        "s3:GetObject",
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::my-s3-bucket/*"
    }
  ]
}

In order to work with AWS service accounts you may need to set AWS_SDK_LOAD_CONFIG=1 in your environment. For more context, please see here.

If you are using S3-Compatible storage, provider of S3 storage has disabled path-style and force virtual hosted-style, you can use specify storage-amazon-force-path-style options as following example:

export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
chartmuseum --debug --port=8080 \
  --storage="amazon" \
  --storage-amazon-bucket="my-s3-bucket" \
  --storage-amazon-prefix="" \
  --storage-amazon-region="us-east-1" \
  --storage-amazon-endpoint="my-s3-compatible-service-endpoint"
  --storage-amazon-force-path-style=false

For DigitalOcean, set the credentials using environment variable and pass the endpoint. Note below, that the region us-east-1 needs to be set, since that is how the DigitalOcean cli implementation functions. The actual region of your spaces location is defined by the endpoint. Below we are using Frankfurt as an example.

export AWS_ACCESS_KEY_ID="spaces_access_key"
export AWS_SECRET_ACCESS_KEY="spaces_secret_key"
  chartmuseum --debug --port=8080 \
  --storage="amazon" \
  --storage-amazon-bucket="my_spaces_name" \
  --storage-amazon-prefix="my_spaces_name_subfolder" \
  --storage-amazon-region="us-east-1" \
  --storage-amazon-endpoint="https://fra1.digitaloceanspaces.com"

The access_key and secret_key can be generated from the DigitalOcean console, under the section API/Spaces_access_keys.

Note: on certain S3-based storage backends, the LastModified field on objects is truncated to the nearest second. For more info, please see issue #152.

In order to mitigate this, you may use use the --storage-timestamp-tolerance option. For example, to round to the nearest second, you could use --storage-timestamp-tolerance=1s. For acceptable values to use for this field, please see here.

Using with Google Cloud Storage

Make sure your environment is properly setup to access my-gcs-bucket.

One way to do so is to set the GOOGLE_APPLICATION_CREDENTIALS var in your environment, pointing to the JSON file containing your service account key:

export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/[FILE_NAME].json"

More info on Google Cloud authentication can be found here.

chartmuseum --debug --port=8080 \
  --storage="google" \
  --storage-google-bucket="my-gcs-bucket" \
  --storage-google-prefix=""

Using with Microsoft Azure Blob Storage

Make sure your environment is properly setup to access mycontainer.

To do so, you must set the following env vars:

  • AZURE_STORAGE_ACCOUNT
  • AZURE_STORAGE_ACCESS_KEY
chartmuseum --debug --port=8080 \
  --storage="microsoft" \
  --storage-microsoft-container="mycontainer" \
  --storage-microsoft-prefix=""

Using with Alibaba Cloud OSS Storage

Make sure your environment is properly setup to access my-oss-bucket.

To do so, you must set the following env vars:

  • ALIBABA_CLOUD_ACCESS_KEY_ID
  • ALIBABA_CLOUD_ACCESS_KEY_SECRET
chartmuseum --debug --port=8080 \
  --storage="alibaba" \
  --storage-alibaba-bucket="my-oss-bucket" \
  --storage-alibaba-prefix="" \
  --storage-alibaba-endpoint="oss-cn-beijing.aliyuncs.com"

Using with Openstack Object Storage

Make sure your environment is properly setup to access mycontainer.

To do so, you must set the following env vars (depending on your openstack version):

  • OS_AUTH_URL
  • either OS_PROJECT_NAME or OS_TENANT_NAME or OS_PROJECT_ID or OS_TENANT_ID
  • either OS_DOMAIN_NAME or OS_DOMAIN_ID
  • either OS_USERNAME or OS_USERID
  • OS_PASSWORD
chartmuseum --debug --port=8080 \
  --storage="openstack" \
  --storage-openstack-container="mycontainer" \
  --storage-openstack-prefix="" \
  --storage-openstack-region="myregion"

For Swift V1 Auth you must set the following env vars:

  • ST_AUTH
  • ST_USER
  • ST_KEY
chartmuseum --debug --port=8080 \
  --storage="openstack" \
  --storage-openstack-auth="v1" \
  --storage-openstack-container="mycontainer" \
  --storage-openstack-prefix=""

Using with Oracle Cloud Infrastructure Object Storage

Make sure your environment is properly setup to access my-ocs-bucket.

More info on Oracle Cloud Infrastructure authentication can be found here.

chartmuseum --debug --port=8080 \
  --storage="oracle" \
  --storage-oracle-bucket="my-ocs-bucket" \
  --storage-oracle-prefix="" \
  --storage-oracle-compartmentid="ocid1.compartment.oc1..1234"

Using with Baidu Cloud BOS Storage

Make sure your environment is properly setup to access my-bos-bucket.

To do so, you must set the following env vars:

  • BAIDU_CLOUD_ACCESS_KEY_ID
  • BAIDU_CLOUD_ACCESS_KEY_SECRET
chartmuseum --debug --port=8080 \
  --storage="baidu" \
  --storage-baidu-bucket="my-bos-bucket" \
  --storage-baidu-prefix="" \
  --storage-baidu-endpoint="bj.bcebos.com"

Using with Tencent Cloud COS Storage

Make sure your environment is properly setup to access my-cos-bucket.

To do so, you must set the following env vars:

  • TENCENT_CLOUD_COS_SECRET_ID
  • TENCENT_CLOUD_COS_SECRET_KEY
chartmuseum --debug --port=8080 \
  --storage="tencent" \
  --storage-tencent-bucket="my-cos-bucket" \
  --storage-tencent-prefix="" \
  --storage-tencent-endpoint="cos.ap-beijing.myqcloud.com"

Using with etcd

To use etcd as backend you need the CA certificate and the signed key pair. See here

chartmuseum --debug --port=8080 \
  --storage="etcd" \
  --storage-etcd-cafile="/path/to/ca.crt" \
  --storage-etcd-certfile="/path/to/server.crt" \
  --storage-etcd-keyfile="/path/to/server.key" \
  --storage-etcd-prefix="" \
  --storage-etcd-endpoint="http://localhost:2379"

Using with local filesystem storage

Make sure you have read-write access to ./chartstorage (will create if doesn't exist on first upload)

chartmuseum --debug --port=8080 \
  --storage="local" \
  --storage-local-rootdir="./chartstorage"

Basic Auth

If both of the following options are provided, basic http authentication will protect all routes:

  • --basic-auth-user=<user> - username for basic http authentication
  • --basic-auth-pass=<pass> - password for basic http authentication

You may want basic auth to only be applied to operations that can change Charts, i.e. PUT, POST and DELETE. So to avoid basic auth on GET operations use

  • --auth-anonymous-get - allow anonymous GET operations

Bearer/Token Auth

If all of the following options are provided, bearer auth will protect all routes:

  • --bearer-auth - enables bearer auth
  • --auth-realm=<realm> - authorization server url
  • --auth-service=<service> - authorization server service name
  • --auth-cert-path=<path> - path to authorization server public pem file
  • --auth-actions-search-path=<JMESPath> - (optional) JMESPath to find allowed actions in a jwt token

Using options above, ChartMuseum is configured with a public key, and will accept RS256 JWT tokens signed by the associated private key, passed in the Authorization header. You can use the chartmuseum/auth Go library to generate valid JWT tokens.

JWT Token without a custom JMESPath to find actions

In order to gain access to a specific resource, the JWT token must contain an access section in the claims. This section indicates which resources the user is able to access. Here is an example token payload:

{
  "exp": 1543995770,
  "iat": 1543995470,
  "access": [
    {
      "type": "artifact-repository",
      "name": "org1/repo1",
      "actions": [
        "pull"
      ]
    }
  ]
}

The type is always "artifact-repository", the name is the namespace/tenant (just use the string "repo" if using single-tenant server), and actions is an array of actions the user can perform ("pull" and/or "push).

If your JWT token structure is different, you can configure a JMESPath string. So you can define the way to find the allowed actions yourself. For the type and the the name you can use following placeholder

  • name: $NAMESPACE
  • type: $ACCESS_ENTRY_TYPE

E.g.: If you want to represent the default configuration, the JMESPath looks like: access[?name=='$NAMESPACE' && type=='$ACCESS_ENTRY_TYPE'].actions[].

For more information about how this works, please see chartmuseum/auth-server-example.

HTTPS

If both of the following options are provided, the server will listen and serve HTTPS:

  • --tls-cert=<crt> - path to tls certificate chain file
  • --tls-key=<key> - path to tls key file
HTTPS with Client Certificate Authentication

If the above HTTPS values are provided in addition to below, the server will listen and serve HTTPS and authenticate client requests against the CA certificate:

  • --tls-ca-cert=<cacert> - path to tls certificate file

Just generating index.yaml

You can specify the --gen-index option if you only wish to use ChartMuseum to generate your index.yaml file. Note that this will only work with --depth=0.

The contents of index.yaml will be printed to stdout and the program will exit. This is useful if you are satisfied with your current Helm CI/CD process and/or don't want to monitor another webservice.

Other CLI options

  • --log-json - output structured logs as json
  • --log-health - log incoming /health requests
  • --log-latency-integer - log latency as an integer (nanoseconds) instead of a string
  • --disable-api - disable all routes prefixed with /api
  • --disable-delete - explicitly disable the delete chart route
  • --disable-statefiles - disable use of index-cache.yaml
  • --allow-overwrite - allow chart versions to be re-uploaded without ?force querystring
  • --disable-force-overwrite - do not allow chart versions to be re-uploaded, even with ?force querystring
  • --chart-url=<url> - absolute url for .tgzs in index.yaml
  • --storage-amazon-endpoint=<endpoint> - alternative s3 endpoint
  • --storage-amazon-sse=<algorithm> - s3 server side encryption algorithm
  • --storage-openstack-cacert=<path> - path to a custom ca certificates bundle for openstack
  • --chart-post-form-field-name=<field> - form field which will be queried for the chart file content
  • --prov-post-form-field-name=<field> - form field which will be queried for the provenance file content
  • --index-limit=<number> - limit the number of parallel indexers
  • --context-path=<path> - base context path (new root for application routes)
  • --depth=<number> - levels of nested repos for multitenancy
  • --cors-alloworigin=<value> - value to set in the Access-Control-Allow-Origin HTTP header
  • --read-timeout=<number> - socket read timeout for http server
  • --write-timeout=<number> - socker write timeout for http server

Docker Image

Available via GitHub Container Registry (GHCR).

Example usage (local storage):

docker run --rm -it \
  -p 8080:8080 \
  -e DEBUG=1 \
  -e STORAGE=local \
  -e STORAGE_LOCAL_ROOTDIR=/charts \
  -v $(pwd)/charts:/charts \
  ghcr.io/helm/chartmuseum:v0.16.2

Example usage (S3):

docker run --rm -it \
  -p 8080:8080 \
  -e DEBUG=1 \
  -e STORAGE="amazon" \
  -e STORAGE_AMAZON_BUCKET="my-s3-bucket" \
  -e STORAGE_AMAZON_PREFIX="" \
  -e STORAGE_AMAZON_REGION="us-east-1" \
  -v ~/.aws:/home/chartmuseum/.aws:ro \
  ghcr.io/helm/chartmuseum:v0.16.2

Helm Chart

There is a Helm chart for ChartMuseum itself.

You can also view it on Artifact Hub.

To install:

helm repo add chartmuseum https://chartmuseum.github.io/charts
helm install chartmuseum/chartmuseum

If interested in making changes, please submit a PR to chartmuseum/charts. Before doing any work, please check for any currently open pull requests. Thanks!

Multitenancy

Multitenancy is supported with the --depth flag.

To begin, start with a directory structure such as

charts
├── org1
│   ├── repoa
│   │   └── nginx-ingress-0.9.3.tgz
├── org2
│   ├── repob
│   │   └── chartmuseum-0.4.0.tgz

This represents a storage layout appropriate for --depth=2. The organization level can be eliminated by using --depth=1. The default depth is 0 (singletenant server).

Start the server with --depth=2, pointing to the charts/ directory:

chartmuseum --debug --depth=2 --storage="local" --storage-local-rootdir=./charts

This example will provide two separate Helm Chart Repositories at the following locations:

  • http://localhost:8080/org1/repoa
  • http://localhost:8080/org2/repob

This should work with all supported storage backends.

To use the chart manipulation routes, simply place the name of the repo directly after "/api" in the route:

curl -F "[email protected]" http://localhost:8080/api/org1/repoa/charts

You may also experiment with the --depth-dynamic flag, which should allow for dynamic depth levels (i.e. all of /api/charts, /api/myrepo/charts, /api/org1/repoa/charts).

Pagination

For large chart repositories, you may wish to paginate the results from the GET /api/charts route.

To do so, add the offset and limit query params to the request. For example, to retrieve a list of 5 charts total, skipping the first 5 charts, you could use the following:

GET /api/charts?offset=5&limit=5

Cache

By default, the contents of index.yaml (per-tenant) will be stored in memory. This means that memory usage will continue to grow indefinitely as more charts are added to storage.

You may wish to offload this to an external cache store, especially for large, multitenant installations.

Cache Interval

When dealing with thousands of charts, you may experience latency with the default settings. This is because upon each request, the storage backend is scanned for changes compared to the cache.

If you are ok with index.yaml being out-of-date for a fixed period of time, you can improve performance by using the --cache-interval=<interval> option. When this setting is enabled, the charts available for each tenant are refreshed on a timer.

For example, to only check storage every 5 minutes, you can use --cache-interval=5m.

For valid values to use for this setting, please see here.

Using Redis

Example of using Redis as an external cache store:

chartmuseum --debug --port=8080 \
  --storage="local" \
  --storage-local-rootdir="./chartstorage" \
  --cache="redis" \
  --cache-redis-addr="localhost:6379" \
  --cache-redis-password="" \
  --cache-redis-db=0

Prometheus Metrics

ChartMuseum exposes its Prometheus metrics at the /metrics route on the main port. This can be enabled with the --enable-metrics command-line flag or the ENABLE_METRICS environment variable.

Note that the Kubernetes chart currently disables metrics by default (ENABLE_METRICS=false is set in the chart). The --disable-metrics command-line flag has be deprecated and will only be available in v0.14.0 and prior.

Below are the current application metrics exposed. Note that there is a per tenant (repo) label. The repo label corresponds to the depth parameter, so a depth=2 as the example above would have repo labels named org1/repoa and org2/repob.

Metric Type Labels Description
chartmuseum_charts_served_total Gauge {repo="*"} Total number of charts
chartmuseum_chart_versions_served_total Gauge {repo="*"} Total number of chart versions available

*: see above for repo label

There are other general global metrics harvested (per process, hence for all tenants). You can get the complete list by using the /metrics route.

Metric Type Labels Description
chartmuseum_request_duration_seconds Summary {quantile="0.5"}, {quantile="0.9"}, {quantile="0.99"} The HTTP request latencies in seconds
chartmuseum_request_duration_seconds_sum
chartmuseum_request_duration_seconds_count
chartmuseum_request_size_bytes Summary {quantile="0.5"}, {quantile="0.9"}, {quantile="0.99"} The HTTP request sizes in bytes
chartmuseum_request_size_bytes_sum
chartmuseum_request_size_bytes_count
chartmuseum_response_size_bytes Summary {quantile="0.5"}, {quantile="0.9"}, {quantile="0.99"} The HTTP response sizes in bytes
chartmuseum_response_size_bytes_sum
chartmuseum_response_size_bytes_count
go_goroutines Gauge Number of goroutines that currently exist

Notes on index.yaml

The repository index (index.yaml) is dynamically generated based on packages found in storage. If you store your own version of index.yaml, it will be completely ignored.

GET /index.yaml occurs when you run helm repo add chartmuseum http://localhost:8080 or helm repo update.

If you manually add/remove a .tgz package from storage, it will be immediately reflected in GET /index.yaml.

You are no longer required to maintain your own version of index.yaml using helm repo index --merge.

The --gen-index CLI option (described above) can be used to generate and print index.yaml to stdout.

Upon index regeneration, ChartMuseum will, however, save a statefile in storage called index-cache.yaml used for cache optimization. This file is only meant for internal use, but may be able to be used for migration to simple storage.

Mirroring the official Kubernetes repositories

Please see scripts/mirror-k8s-repos.sh for an example of how to download all .tgz packages from the official Kubernetes repositories (both stable and incubator).

You can then use ChartMuseum to serve up an internal mirror:

scripts/mirror-k8s-repos.sh
chartmuseum --debug --port=8080 --storage="local" --storage-local-rootdir="./mirror"

Custom Welcome Page

With the flag --web-template-path=<path>, you can specify the path to your custom welcome page.

The structure of the folder should be like this:

web/
  index.html
  xyz.html
  static/
      main.css
      main.js

ChartMuseum is using gin-gonic to serve the static files, this means that you can use go-template to render the files.

If you don't specify a custom welcome page, ChartMuseum will serve the default one.

Artifact Hub

By setting the flag --artifact-hub-repo-id <repo id>, ChartMuseum will serve a artifacthub-repo.yml file with the specified repo ID in the repositoryID field of the yaml file.

repositoryID: The ID of the Artifact Hub repository where the packages will be published to (optional, but it enables verified publisher)
Multitenancy

For multitenancy setups, you can provide a key value pair to the flag in the format: --artifact-hub-repo-id <repo>=<repo id>

chartmuseum --storage local --storage-local-rootdir /tmp/ --depth 1 --artifact-hub-repo-id org1=<repo id> --artifact-hub-repo-id org2=<repo2 id>

The artifacthub-repo.yml file will then be served at /org1/artifacthub-repo.yml and /org2/artifacthub-repo.yml

Original Logo

"Preserve your precious artifacts... in the cloud!"

Subprojects

The following subprojects are maintained by ChartMuseum:

Community

You can reach the ChartMuseum community and developers in the Kubernetes Slack #chartmuseum channel.

helm-push's People

Contributors

brcorbin avatar bryanstenson-okta avatar cbuto avatar czhujer avatar dellkeji avatar dependabot[bot] avatar emanuelflp avatar i5okie avatar jdolitsky avatar karuppiah7890 avatar leventyalcin avatar liuming-dev avatar mayank-verma048 avatar nerdeveloper avatar prabhu43 avatar r734 avatar rimusz avatar roberte3 avatar sathieu avatar scbizu avatar shizhmsft avatar stensonb avatar steven-zou avatar tariq1890 avatar thwhk avatar vadasambar avatar volker-raschek avatar zerosnake0 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  avatar

helm-push's Issues

Helm push lose requirments.yaml file

HELM version
Client: &version.Version{SemVer:"v2.16.1", GitCommit:"bbdfe5e7803a12bbdf97e94cd847859890cf4050", GitTreeState:"clean"}
HELM push version: 0.8.0
After upgrade to helm push 0.8.0, The Charts pushed to chartmuseum, lose requirments.yaml.

dependencies:
- name: kube-state-metrics
  version: 2.2.1
  repository: https://kubernetes-charts.storage.googleapis.com
  condition: kube-state-metrics.enabled
- name: A
  version: 1.0.1 
  repository: "file://../A"
  condition: A.enabled

Steps to push

helm repo add chartmuseum https://charts.software.io
helm dep up software
helm dep build software
helm push software chartmuseum -v ">0.0.0-0" -f 

Steps to download

wget https://charts.software.io/charts/software-\>0.0.0-0.tgz 
tar zxvf software-\>0.0.0-0.tgz  -C ./dir
s dir
Chart.yaml  charts      templates   values.yaml

requirments.yaml and lock are lose.

Anyway, downgrade to 0.7.1 can workaround.

helm push get some error

helm verison

helm version
version.BuildInfo{Version:"v3.0.1", GitCommit:"7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState:"clean", GoVersion:"go1.13.4"}

my local repo.

$ helm repo list
NAME  	URL                                              
stable	https://kubernetes-charts.storage.googleapis.com/
local 	https://harbor.youpenglai.cn/chartrepo/junhsue

when get push

helm push goapp-0.1.0.tgz local
Error: Couldn't load repositories file (/root/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Error: plugin "push" exited with error

help ~~ ths

Helm push to cm:// is broken in version 8.1

With helm push version 8.1 pushing to repositories protected using chartmueum/auth JWT using the cm:// protocol (where the intention is the bearer token should be picked up from the HELM_REPO_ACCESS_TOKEN environment variable) is broken

helm push <my chart>.tgz <my-repo>
Error: could not find protocol handler for: cm
Error: plugin "push" exited with error```

Support for alpine

It is actually impossible to install this plugin in an alpine image with helm.

The current workaround is to install bash but it would be great it scripts could be used from alpine sh shell.

Getting 401 when running from nodejs

I'm getting 401 when running helm repo update from inside nodejs (6.13.1) via an execSync command.
When running helm repo update from the shell it's working fine.
The user running the nodejs app is the same user as the one running the helm command directly in shell.
Running codefresh get images works in both cases.
The execSync command runs with shell: true.

helm push not putting quotes around scientific notation like numbers

With helm 2.16.1, helm-push 0.7.1 and chartmuseum 0.10.0, try the below

$ helm create old-chart
$ # change appVersion in Chart.yaml to "722225e2"
$ vi old-chart/Chart.yaml
$ # now push the chart to chartmuseum repo called "local"
$ helm push old-chart local
$ # check the index.yaml
$ curl http://localhost:8080/index.yaml
apiVersion: v1
entries:
old-chart:

  • apiVersion: v1
    appVersion: "7.22225e+07"
    created: "2019-12-04T22:16:19.562137212+05:30"
    description: A Helm chart for Kubernetes
    digest: 0b891b622bd0ab3e8e22302dab504481d10887a011bb92f38830097c44b3ccd3
    name: old-chart
    urls:
    • charts/old-chart-0.1.0.tgz
      version: 0.1.0
      generated: "2019-12-04T22:16:22+05:30"
      serverInfo: {}

Now if you see the appVersion, you notice that it's in some scientific notation form. This does not happen when directly curl is used to push charts this way -

$ helm package old-chart
$ # check the tar ball Chart.yaml, it will still be "722225e2" 
$ vi old-chart-0.1.0.tgz
$ curl --data-binary "@old-chart-0.1.0.tgz" http://localhost:8080/api/charts

The issue is in helm-push. When push is done, the chart contents are read (parsed), and then later pushed to chartmuseum. While parsing and then serializing, it removes the quotes (due to a yaml package bug) and then it pushes to the chartmusem, where the number is made into a string and put in double quotes, but it's converted a bit, compared to the original string

Updating yaml package to latest version solves the issue

Update test TLS certs

Unable to run tests since the TLS certs appear to be expired:

main_test.go:224: unexpecting error uploading tarball: Post https://127.0.0.1:44907/x/y/z/api/charts: x509: certificate has expired or is not yet valid

helm plugin install gitrepo not working anymore with Kubernetes v1.16

Kubernetes: Microk8s v1.16

When installing helm-push plugin in kubernetes v1.16 getting the error:

$ helm plugin install https://github.com/chartmuseum/helm-push
Error: Unable to get repository: Cloning into '/home/pauloneves/.helm/cache/plugins/https-github.com-chartmuseum-helm-push'...
/usr/lib/git-core/git-remote-https: relocation error: /usr/lib/git-core/git-remote-https: symbol curl_global_sslset version CURL_GNUTLS_3 not defined in file libcurl-gnutls.so.4 with link time reference
: exit status 128

workaround:

$ git clone https://github.com/chartmuseum/helm-push https-github.com-chartmuseum-helm-push
$ helm plugin install https-github.com-chartmuseum-helm-push

Unable to install inside a container

Trying to automate our build process by using Helm inside a container and I can't seem to get the helm-push plugin to install. Not sure if this is a problem with my configuration, with the container image or with helm-push.

$ docker run -it --name helm --rm --entrypoint /bin/sh linkyard/docker-helm:2.9.1
/ # helm init --client-only
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /root/.helm.
Not installing Tiller due to 'client-only' flag having been set
Happy Helming!
/ # helm plugin install --debug https://github.com/chartmuseum/helm-push
[debug] cloning https://github.com/chartmuseum/helm-push to /root/.helm/cache/plugins/https-github.com-chartmuseum-helm-push
[debug] symlinking /root/.helm/cache/plugins/https-github.com-chartmuseum-helm-push to /root/.helm/plugins/helm-push
[debug] loading plugin from /root/.helm/plugins/helm-push
[debug] running install hook: &{/bin/sh [sh -c cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh] []  <nil> <nil> <nil> [] %!s(*syscall.SysProcAttr=<nil>) %!s(*os.Process=<nil>) <nil> <nil> <nil> %!s(bool=false) [] [] [] [] %!s(chan error=<nil>) %!s(chan struct {}=<nil>)}
sh: scripts/install_plugin.sh: not found
Error: plugin install hook for "push" exited with error

I also tried to export HELM_PLUGIN_DIR="/root/.helm/plugins/helm-push" inside the container and got the same error. I can actually see the install_plugin.sh inside the plugin dir, so not sure what is wrong here. Any advice?

Helm push without agruments should output the same as --help

Hi,

I belive that most CLI tools, and more particularly helm itself, are printing the output of the same command with --help.

I think that adding that link might be good in terms of usability. Of course, this only works for commands that do need mandatory arguments, which is the case of helm push.
Shouldn't be complicated in terms of implementation, I'm not familiar with go and clis so I'd rather not give it a shot myself.

Regards!

Example:
helm repo:

his command consists of multiple subcommands to interact with chart repositories.

It can be used to add, remove, list, and index chart repositories.
Example usage:
    $ helm repo add [NAME] [REPO_URL]

Usage:
  helm repo [command]

Available Commands:
  add         add a chart repository
  index       generate an index file given a directory containing packaged charts
  list        list chart repositories
  remove      remove a chart repository
  update      update information of available charts locally from chart repositories

Flags:
  -h, --help   help for repo

helm repo --help:

his command consists of multiple subcommands to interact with chart repositories.

It can be used to add, remove, list, and index chart repositories.
Example usage:
    $ helm repo add [NAME] [REPO_URL]

Usage:
  helm repo [command]

Available Commands:
  add         add a chart repository
  index       generate an index file given a directory containing packaged charts
  list        list chart repositories
  remove      remove a chart repository
  update      update information of available charts locally from chart repositories

Flags:
  -h, --help   help for repo

.cfconfig token loading not working in container

I'm working on a Docker image that has helm, helm-push, and codefresh's CLI installed. I cannot seem to get the automatic .cfconfig token loading to work when I volume mount the host's .cfconfig file into the container. I repeatedly get 401 unauthorized errors. Yet, if I set HELM_REPO_ACCESS_TOKEN to the token in the file, things work fine. On the host machine (with the same versions of helm and helm-push installed), everything works fine.

In container, the user is root and the file is mounted at /root/.cfconfig.

I went through a rather long and convoluted troubleshooting process, including copying the .cfconfig loading code from this codebase into a tiny go POC and running it in the container. It worked. I tried it with go 1.10, the version of go listed in helm-push's CI files. Still worked.

Eventually, I just cloned helm-push locally and used the Makefile build-linux task to recompile the binary. I am using go 1.12.4. I copied it into my Docker container, and everything started working properly, loading the credentials from the volume-mounted .cfconfig file.

My host machine is Linux. I seem to recall some historical issues in go finding a user's home directory in certain scenarios. I'm not sure which version of go and on what OS the release helmpush binary was compiled with, but I'm wondering if it was an older version of go (I tried this and had no luck), or if it was compiled on a non-Linux OS and somehow during the cross-compilation process, homedir-related code was broken? I have done some googling and changelog reading and found this old issue. The way that the homedir finding code returns immediately on ANY error (even if the error was user: Current not implemented on linux/amd64) makes me think this is the problem. But that doesn't explain why this works fine on my host system, which is also Linux, just not in a container.

I don't have access to an OSX machine right now to test any of these theories, but I wanted to file an issue to see if I'm missing something obvious or to help other people with the same problem.

install behind a proxy with custom certificate

I tried to install helm push on a server behind a proxy.

However, it failed because the proxy has a custom certificate (HTTPS/TLS) interception.

The installation fails with:

$ helm plugin --debug --logtostderr  install https://github.com/chartmuseum/helm-push
[debug] cloning https://github.com/chartmuseum/helm-push to /home/test/.cache/helm/plugins/https-github.com-chartmuseum-helm-push
[debug] symlinking /home/test/.cache/helm/plugins/https-github.com-chartmuseum-helm-push to /home/test/.local/share/helm/plugins/helm-push
plugin_install.go:73: [debug] loading plugin from /home/test/.local/share/helm/plugins/helm-push
plugin.go:60: [debug] running install hook: /usr/bin/sh -c cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh
Downloading and installing helm-push v0.7.1 ...
https://github.com/chartmuseum/helm-push/releases/download/v0.7.1/helm-push_0.7.1_linux_amd64.tar.gz
curl: (60) Peer's certificate issuer has been marked as not trusted by the user.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
Error: plugin install hook for "push" exited with error
helm.go:76: [debug] plugin install hook for "push" exited with error
main.runHook
        /home/circleci/helm.sh/helm/cmd/helm/plugin.go:67
main.(*pluginInstallOptions).run
        /home/circleci/helm.sh/helm/cmd/helm/plugin_install.go:79
main.newPluginInstallCmd.func2
        /home/circleci/helm.sh/helm/cmd/helm/plugin_install.go:50
github.com/spf13/cobra.(*Command).execute
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:914
github.com/spf13/cobra.(*Command).Execute
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main
        /home/circleci/helm.sh/helm/cmd/helm/helm.go:75
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1357

As a workaround, I have added --insecure option to curl command in this script (edit with vim):

~/.cache/helm/plugins/https-github.com-chartmuseum-helm-push/scripts/install_plugin.sh

Then I manually resumed the installation

$ cd ~/.cache/helm/plugins/https-github.com-chartmuseum-helm-push
$ bash     scripts/install_plugin.sh
Downloading and installing helm-push v0.7.1 ...
https://github.com/chartmuseum/helm-push/releases/download/v0.7.1/helm-push_0.7.1_linux_amd64.tar.gz

Support pushing the charts to the specified namespace when enabling multi-tenants

With chartmuseum, you can easily enable multiple tenants by setting depth > 0. But you need to helm repo add <name> <URL> to add the specified namespace as a separate helm repo (/:repo/index.yaml).

We have provided a unified single entry point (`/index.yaml') for all the namespaces(merge all the index.yaml into one with namespace prefix added) and then namespace info is required when pushing charts to the specified namespace through the single entry point. e.g.:

helm repo add myrepo https://repo-url/context

##
# The chart will be pushed to https://repo-url/context/library
helm push --namespace=library mychart-0.1.0.tgz myrepo

Error: 308: could not properly parse response JSON:

when i use the helm-push plugin to push a chart to harbor charts repository with command helm push demo2 hillstone, i get the result as below:

<title>308 Permanent Redirect</title>

308 Permanent Redirect


nginx/1.13.8 ]]>.

helm version: v2.11.0
helm-push version: 0.7.1
harbor version: 1.7.0
and the chartmuseum version in harbor is 0.7.1

Installation fails on ubuntu 16.04

Hello Chartmuseum folks,

I'm having trouble installing this plugin. It fails at line zero of the install script:

➜  helm-push git:(master) helm plugin install .
/bin/sh: 0: Illegal option -
Error: plugin install hook for "push" exited with error

I've tried changing the shebang to stuff I normally use (#!/usr/bin/env bash) but no luck. I've also tried to remove the -e flag. When I do that I get the following:

➜  helm-push git:(master) ✗ helm plugin install .
sh: 1: scripts/install_plugin.sh: not found
Error: plugin install hook for "push" exited with error
➜  helm-push git:(master) ✗ file scripts/install_plugin.sh
scripts/install_plugin.sh: POSIX shell script, ASCII text executable, with CRLF line terminators

So I'm confused about this. Help?

[Question] Are we able to use this with jfrog?

I'm using JFrog for chartmuseum.
Ive tried setting the following
HELM_REPO_AUTH_HEADER="X-JFrog-Art-Api"
HELM_REPO_ACCESS_TOKEN=<MYAPIKEY>
then running a helm push . chartmuseum however i get back a 404 when ever i try push.
Is there something that i'm missing?

Installation fails on windows 10

We have to run helm on windows 10. After install helm client using helm-v2.12.0-windows-amd64.zip,
I use helm plugin install command to install helm-push but failed.
The error as follows:
C:\WINDOWS\system32>helm plugin install https://github.com/chartmuseum/helm-push
Error: exec: "sh": executable file not found in %PATH%

It seem that helm-push plugin does not support windows.
Wish you response, thanks.

chart pushed by helm-push lost comments in values.yaml

I have a chart, there are comments in values.yaml

~/helm-app-sample » tree -L 1 .
.
├── Chart.yaml
├── README.md
├── charts
├── crds
├── templates
├── values.schema.json
└── values.yaml

3 directories, 4 files
-----------------------------------------------------------------------------------------------------------------------------------------------
~/helm-app-sample » cat values.yaml
# 应用挂在到roc树上哪一个目录下
rocDirectory: ""
# 应用的所有者/创建者
appOwner: ""
-----------------------------------------------------------------------------------------------------------------------------------------------

chart pushed to chartmuseum lost these comments

image

but chart upload from web page keep these comments

image

so I think it's necessary to keep these comments, this should be fixed.

Plugin installation will falsely "success" even if download fails

I am trying to install helm-push without public network, I transfer whole git repo to the machine and run:

helm plugin install ./helm-push

The install script will try to download release package, and it fails.
Then if I run:

helm plugin list

I got:

NAME    VERSION DESCRIPTION                      
push    0.8.1   Push chart package to ChartMuseum

cannot push if repo URL contains a path

I set up my Chart Museum behind a proxy. And added it to my helm client:

$ helm repo add acme https://www.acme.com/charts

And my nginx on the server side, sends all /charts/ to the proper kubernetes service.

Querying works fine as https://www.acme.com/charts goes to http://pod_url:port/

I also tested with curl and httpie, I can upload a chart fine (following the apis in chartmuseum doc).

$ curl --data-binary "@zzz-0.0.1.tgz" https://www.acme.com/charts/api/charts

Later on a helm fetch acme/zzz works fine as well.

Now a helm push will fail:

$ helm push mypath/ acme
Error: 404: not found
Error: plugin "push" exited with error

On my nginx reverse proxy, I can see the URL path is wrong as it receives: POST /api/charts/charts instead of POST /charts/api/charts.

I have a feeling the push plugin does not respect the base path of the repo when it was added, or at least messes up the said path.

Or am I missing something?

net/http: request canceled

helm repo list

stable	https://kubernetes-charts.storage.googleapis.com
harbor	http://xx/chartrepo/library 

helm push harbor-1.1.1.tgz harbor

Pushing harbor-1.1.1.tgz to harbor...
Error: Post http://xx/api/chartrepo/library/charts: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Error: plugin "push" exited with error

I don't know what happend. help!

Feature request: allow to set values

Similar to how we can set version, would be nice to be able to set other values,
allowing for something like:
helm push mychart/ --version="1.2.3" --set image.tag="1.2.3" --set image.imagePullPolicy="Always" chartmuseum etc.

the packaged chart would have the values set

Push force

Currently if the chart already exists, the push return a 409 error code:

/ # helm push yolo chartmuseum
Pushing yolo-0.1.0.tgz to chartmuseum...
Error: 409: yolo-0.1.0.tgz already exists
Error: plugin "push" exited with error

It would be nice to have a -f, --force option to overwrite the existing chart.

helm3 push giving error about not being able to find repositories.yaml

I currently installed helm3 along with the helm push plugin by running helm plugin install https://github.com/chartmuseum/helm-push

when i tried to do a helm push i get the following error:

Error: Couldn't load repositories file (/root/.local/share/helm/repository/repositories.yaml).

This path doesn't exist with helm3.

If i have helm2 install and i do the upgrade to helm3 i still have to do the following manual steps then helm3 push works fine:

mkdir /root/.local/share/helm/repository/
copy contents from /root/.helm/repository/ to /root/.local/share/helm/repository/

Has anyone else seen this issue and been able to solve it by just having helm3 (and not needing to do the helm2 to helm3 upgrade and doing manual steps)?

Why no new releases?

It's been quite some time. I do see that there's just one feature from last release - e6e7c32 - Adding flag to update dependencies before package. Do you think it's worth it to release?

There will also be another update, for this issue - #40 (PR - #41)

May be if we see some more features / bug fixes, we can wait for them, and then release sometime? @jdolitsky

Multiple API Sets Support

ChartMuseum is a well-known open-source Helm Chart Repository with support for multiple cloud storage backends. It not only is compatible with the helm repo command set at the API level but also provides an API set for uploading new chart packages and fetching existing ones. By leveraging that uploading API, the helm-push plugin provides an easy and quick way to push chart packages to a ChartMuseum server.

As time goes by, more and more cloud service provider like Microsoft Azure, Amazon Web Service, Google Cloud, and etc., may kick in and have their own Helm Chart Repository. Since there is no standard API for uploading a chart package to the cloud, cloud service providers may have their own API sets for pushing and pulling helm chart packages with/without provenance files. It would be nice and cool for helm-push plugin to support those API sets in addition to the ChartMuseum API. With multiple API sets support, open-source software users/developers will gain smoother and more convenient experiences.

In this issue, we propose two implementation directions:

  1. Use different API sets by analyzing the host name of the repository URL. If it belongs to a known cloud service provider, the helm-push plugin uses the API set specific to that cloud service provider for uploading the chart packages. Otherwise, the plugin uses the ChartMuseum API set as the default option.
  2. Have a config file or a command line flag to use a specific API set. For instance:
$ helm push --provider=microsoft mychart-0.3.2.tgz azure
Pushing mychart-0.3.2.tgz to azure...
Done.

Personally, the proposal 1 is preferable as it is transparent to the users.

Helm push not updating the requirements during package

Actual Behaviour:

I created a chart which depends on some other charts. I mentioned those chart details in requirements.yaml. When I did helm push . to chart museum, it is packaging only the files that exists in the folder.

Expected behavior:

helm push should pull the dependency charts mentioned in requirements.yaml & then do package it.

Fix:

Currently, helm push does helm package, instead it should do helm package --dependency-update which will update the dependencies in requirements.yaml

Install w/o internet access

Hi there,

Is it possible to install helm-push for helm 3.0 without internet access?

I installed it online and checked the plugin folder in /root/.cache/helm/plugins/https-github.com-chartmuseum-helm-push, it's different from unzip from helm-push_0.8.0_linux_amd64.tar.gz.

├── acceptance_tests
│   ├── 01-helm.robot
│   ├── 02-chartmuseum.robot
│   └── lib
│   ├── ChartMuseum.py
│   ├── common.py
│   ├── HelmPush.py
│   ├── Helm.py
│   └── init.py
├── bin
│   └── helmpush
├── cmd
│   └── helmpush
│   ├── main.go
│   └── main_test.go
├── go.mod
├── go.sum
├── LICENSE
├── Makefile
├── pkg
│   ├── chartmuseum
│   │   ├── client.go
│   │   ├── client_test.go
│   │   ├── download.go
│   │   ├── download_test.go
│   │   ├── option.go
│   │   ├── upload.go
│   │   └── upload_test.go
│   └── helm
│   ├── chart.go
│   ├── chart_test.go
│   ├── index.go
│   ├── index_test.go
│   ├── repo.go
│   ├── repo_test.go
│   ├── serverinfo.go
│   └── version.go
├── plugin.yaml
├── README.md
├── releases
│   ├── v0.8.0
│   │   ├── bin
│   │   ├── LICENSE
│   │   └── plugin.yaml
│   └── v0.8.0.tar.gz
├── scripts
│   ├── acceptance.sh
│   ├── install_plugin.sh
│   ├── setup_test_environment.sh
│   └── test.sh
└── testdata
├── charts
│   ├── helm2
│   │   └── mychart
│   │   ├── Chart.yaml
│   │   └── templates
│   │   └── pod.yaml
│   └── helm3
│   └── my-v3-chart
│   ├── Chart.yaml
│   ├── templates
│   │   ├── deployment.yaml
│   │   ├── _helpers.tpl
│   │   ├── ingress.yaml
│   │   ├── NOTES.txt
│   │   ├── serviceaccount.yaml
│   │   ├── service.yaml
│   │   └── tests
│   │   └── test-connection.yaml
│   └── values.yaml
├── pgp
│   ├── helm-test-key.pub
│   ├── helm-test-key.secret
│   └── NOTE.txt
└── tls
├── ca.crt
├── server_ca.crt
├── test_cert.crt
├── test_key.key
├── test_server.crt
└── test_server.key

scripts/install_plugin.sh: 14: [: Linux: unexpected operator

Hi,

Trying to deploy on Centos 7 gives :

helm plugin install https://github.com/chartmuseum/helm-push

Downloading and installing helm-push v0.4.0 ...
scripts/install_plugin.sh: 14: [: Linux: unexpected operator
scripts/install_plugin.sh: 16: [: Linux: unexpected operator
https://github.com/chartmuseum/helm-push/releases/download/v0.4.0/helm-push_0.4.0_windows_amd64.tar.gz

Checked the scripts/install_plugin.sh script and saw that you are using == to compare strings.
Using = instead of == fixes the issue.

Based on my experience, == will not work on every shell, and = should be the way to go.

Keep up the good work!

add pushed charts to cached index

when pushing a chart, it would be nice if the chart was added to the local repo index cache immediately, instead of requiring a slow helm repo update. My current CI workflow would speed up quite a bit if it didn't need to re-fetch the chart index it just pushed to to be able to pull the chart.

How to push a new package

{"error":"not found"}

How to push a new package?

[root@lab1 helm]# helm repo list
NAME            URL                                                                                   
local           https://charts.test.com                                         
[root@lab1 helm]# helm push charts/mysqlha-0.3.0.tgz local
Pushing mysqlha-0.3.0.tgz to local...
Error: 404: not found
Error: plugin "push" exited with error

Ability to push directly to repo URL

Should be able to use a repo URL in place of a repo name, which would not require the repo to be added locally:

$ helm push mychart/ https://mychartrepo.com

Detection can be based on prefix of "http://" or "https://" in the second positional arg.

Since the repo isnt added with helm repo add, we are unable to extract creds from ~/.helm/repository/repositories.yaml. Authentication mechanism can be determined by env vars, or user/pass on the url (e.g. https://user:[email protected]).

404: not found plugin "push" exited with error

So I deployed chartmuseum on my kubernetes. I have set it up to use my aws access key and secret key. I have this endpoint http://testhelm.test.com and I added this repo in my ec2 instance. I tried pushing my sample chart package using the push plugin:

helm push helloworld-0.1.6.tgz testhelm --context-path=/prod

Pushing helloworld-0.1.6.tgz to testhelm...
Error: 404: not found
Error: plugin "push" exited with error

**testhelm is the name of my helm repo

Any advice on this?

helm v3 repo add chartmuseum auth failed, unsupported protocol scheme "cm"

I am running a ChartMuseum that needs to be authenticated locally. When using helm v3 for repo add, I get an error message. The error message is

➜ repo add chartmuseum cm://localhost:8089 --debug
Error: looks like "cm://localhost:8089" is not a valid chart repository or cannot be reached: Get cm://localhost:8089/index.yaml: unsupported protocol scheme "cm"
helm.go:76: [debug] Get cm://localhost:8089/index.yaml: unsupported protocol scheme "cm"
looks like "cm://localhost:8089" is not a valid chart repository or cannot be reached
main.addRepository
        /go/src/helm.sh/helm/cmd/helm/repo_add.go:108
main.(*repoAddOptions).run
        /go/src/helm.sh/helm/cmd/helm/repo_add.go:73
main.newRepoAddCmd.func1
        /go/src/helm.sh/helm/cmd/helm/repo_add.go:57
helm.sh/helm/vendor/github.com/spf13/cobra.(*Command).execute
        /go/src/helm.sh/helm/vendor/github.com/spf13/cobra/command.go:762
helm.sh/helm/vendor/github.com/spf13/cobra.(*Command).ExecuteC
        /go/src/helm.sh/helm/vendor/github.com/spf13/cobra/command.go:850
helm.sh/helm/vendor/github.com/spf13/cobra.(*Command).Execute
        /go/src/helm.sh/helm/vendor/github.com/spf13/cobra/command.go:800
main.main
        /go/src/helm.sh/helm/cmd/helm/helm.go:75
runtime.main
        /usr/local/go/src/runtime/proc.go:200
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1337

I guess helm push is not compatible with the use of helm v3

Is there any plan for this helm v3 compatibility?

Helm push returns a 401, but curl and helm search/fetch work

We have a Chartmuseum instance running in our Kubernetes cluster (deployed via the helm chart chartmuseum-1.6.0) and for some reason I'm getting a Error: 401: unauthorized with helm push chart_name repo_name. I've added the repo via helm repo add --username correct_username --password correct_password repo_name https://chartmuseum.somedomain.com. I can successfully do helm search repo_name and helm fetch repo_name/chart_name, so the credentials seem to work unless I try to helm push. I can also successfully upload charts with curl --data-binary "@chart_name-1.0.0.tar.gz" https://chartmuseum.somedomain.com/api/charts -u correct_username:correct_password.

Any idea why helm push chart_name repo_name would give me a 401 or any further steps I could take to debug this?

Go Test fails

When trying to run the go test utility in /helm-push/cmd/ on the current source code it fails on Mac OSX.


main_test.go:224: unexpecting error uploading tarball: no repo named "helm-push-test" found
FAIL
exit status 1
FAIL github.com/chartmuseum/helm-push/cmd/helmpush 0.670s


make helm-push to gather auth token automatically

Hi @jdolitsky , I've been watching this great project for a while. 😄

I wonder why we are not implementing this access token in the docker way.

Like you mentioned in the using-with-helm-push , user need to gain an access token using curl before using helm-push. It might be painful to some users.

So I implemented this GetAuthTokenFromResponse, tries to get an access token from the auth server returned by chartmuseum. How do you like it? Can I pr this feature?

Great thanks

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.