### ChartMuseum CLI Startup Examples Source: https://context7.com/helm/chartmuseum/llms.txt Configure and start the ChartMuseum server using CLI flags, which correspond to `ServerOptions` fields and can also be set via environment variables. Examples cover local filesystem, Amazon S3, Minio, Google Cloud Storage, Microsoft Azure Blob Storage, and etcd. ```bash # Local filesystem storage chartmuseum --debug --port=8080 \ --storage="local" \ --storage-local-rootdir="./chartstorage" ``` ```bash # Amazon S3 chartmuseum --debug --port=8080 \ --storage="amazon" \ --storage-amazon-bucket="my-s3-bucket" \ --storage-amazon-prefix="" \ --storage-amazon-region="us-east-1" ``` ```bash # Minio / S3-compatible export AWS_ACCESS_KEY_ID="minio-access" export AWS_SECRET_ACCESS_KEY="minio-secret" chartmuseum --debug --port=8080 \ --storage="amazon" \ --storage-amazon-bucket="my-bucket" \ --storage-amazon-region="us-east-1" \ --storage-amazon-endpoint="http://localhost:9000" ``` ```bash # Google Cloud Storage export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json" chartmuseum --debug --port=8080 \ --storage="google" \ --storage-google-bucket="my-gcs-bucket" \ --storage-google-prefix="" ``` ```bash # Microsoft Azure Blob Storage export AZURE_STORAGE_ACCOUNT="myaccount" export AZURE_STORAGE_ACCESS_KEY="mykey" chartmuseum --debug --port=8080 \ --storage="microsoft" \ --storage-microsoft-container="mycontainer" \ --storage-microsoft-prefix="" ``` ```bash # etcd chartmuseum --debug --port=8080 \ --storage="etcd" \ --storage-etcd-endpoint="http://localhost:2379" \ --storage-etcd-cafile="/path/to/ca.crt" \ --storage-etcd-certfile="/path/to/server.crt" \ --storage-etcd-keyfile="/path/to/server.key" \ --storage-etcd-prefix="charts" ``` ```bash # Docker (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.6 ``` -------------------------------- ### Configuration File Example Source: https://context7.com/helm/chartmuseum/llms.txt An example of a YAML configuration file for ChartMuseum, specifying various operational parameters. ```APIDOC ### Configuration file — `config.yaml` ```yaml # chartmuseum --config config.yaml debug: true port: 8080 storage.backend: local storage.local.rootdir: /tmp/chartstorage allow-overwrite: true disable-delete: false depth: 0 index-limit: 50 cache-interval: 5m bearer-auth: false basic-auth-user: admin basic-auth-pass: secret cors-alloworigin: "*" enable-metrics: true log-json: true per-chart-limit: 10 # keep only 10 latest versions per chart max-storage-objects: 0 # unlimited web-template-path: /opt/chartmuseum/web artifact-hub-repo-id: my-repo-id ``` ``` -------------------------------- ### Start Chartmuseum Server with Multitenancy Source: https://github.com/helm/chartmuseum/blob/main/README.md Starts the Chartmuseum server with multitenancy enabled using the `--depth` flag. Requires specifying the storage backend and root directory. ```bash chartmuseum --debug --depth=2 --storage="local" --storage-local-rootdir=./charts ``` -------------------------------- ### Install Chart from ChartMuseum Source: https://github.com/helm/chartmuseum/blob/main/README.md Install a chart from the ChartMuseum repository into your Kubernetes cluster. ```bash helm install chartmuseum/mychart --generate-name ``` -------------------------------- ### Install Chartmuseum Script Source: https://github.com/helm/chartmuseum/blob/main/README.md Use this script to quickly install Chartmuseum. Ensure you have curl installed. ```bash curl https://raw.githubusercontent.com/helm/chartmuseum/main/scripts/get-chartmuseum | bash ``` -------------------------------- ### CLI Startup Examples Source: https://context7.com/helm/chartmuseum/llms.txt Demonstrates various command-line interface startup configurations for ChartMuseum with different storage backends. ```APIDOC ### CLI startup — `chartmuseum` binary All `ServerOptions` fields correspond to CLI flags (and equivalent `ENV_VAR` names). Every flag can be set via environment variable by uppercasing and replacing `-` with `_`. ```bash # Local filesystem storage chartmuseum --debug --port=8080 \ --storage="local" \ --storage-local-rootdir="./chartstorage" # Amazon S3 chartmuseum --debug --port=8080 \ --storage="amazon" \ --storage-amazon-bucket="my-s3-bucket" \ --storage-amazon-prefix="" \ --storage-amazon-region="us-east-1" # Minio / S3-compatible export AWS_ACCESS_KEY_ID="minio-access" export AWS_SECRET_ACCESS_KEY="minio-secret" chartmuseum --debug --port=8080 \ --storage="amazon" \ --storage-amazon-bucket="my-bucket" \ --storage-amazon-region="us-east-1" \ --storage-amazon-endpoint="http://localhost:9000" # Google Cloud Storage export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json" chartmuseum --debug --port=8080 \ --storage="google" \ --storage-google-bucket="my-gcs-bucket" \ --storage-google-prefix="" # Microsoft Azure Blob Storage export AZURE_STORAGE_ACCOUNT="myaccount" export AZURE_STORAGE_ACCESS_KEY="mykey" chartmuseum --debug --port=8080 \ --storage="microsoft" \ --storage-microsoft-container="mycontainer" \ --storage-microsoft-prefix="" # etcd chartmuseum --debug --port=8080 \ --storage="etcd" \ --storage-etcd-endpoint="http://localhost:2379" \ --storage-etcd-cafile="/path/to/ca.crt" \ --storage-etcd-certfile="/path/to/server.crt" \ --storage-etcd-keyfile="/path/to/server.key" \ --storage-etcd-prefix="charts" # Docker (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.6 ``` ``` -------------------------------- ### Start Chartmuseum with Redis Cache Source: https://github.com/helm/chartmuseum/blob/main/README.md Starts Chartmuseum with local storage and Redis as an external cache. Requires specifying Redis connection details. ```bash chartmuseum --debug --port=8080 \ --storage="local" \ --storage-local-rootdir="./chartstorage" \ --cache="redis" \ --cache-redis-addr="localhost:6379" \ --cache-redis-password="" \ --cache-redis-db=0 ``` -------------------------------- ### ChartMuseum Configuration File Example Source: https://context7.com/helm/chartmuseum/llms.txt Configure ChartMuseum settings using a YAML file. This example shows options for debug mode, port, storage backend, authentication, CORS, metrics, and chart limits. ```yaml # chartmuseum --config config.yaml debug: true port: 8080 storage.backend: local storage.local.rootdir: /tmp/chartstorage allow-overwrite: true disable-delete: false depth: 0 index-limit: 50 cache-interval: 5m bearer-auth: false basic-auth-user: admin basic-auth-pass: secret cors-alloworigin: "*" enable-metrics: true log-json: true per-chart-limit: 10 # keep only 10 latest versions per chart max-storage-objects: 0 # unlimited web-template-path: /opt/chartmuseum/web artifact-hub-repo-id: my-repo-id ``` -------------------------------- ### GET / Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves a welcome page from the server. This can be a default HTML page or a custom template if specified during configuration. ```APIDOC ## Server Info API ### `GET /` — welcome page Returns an HTML welcome page (or custom template if `--web-template-path` is set). ```bash curl http://localhost:8080/ ``` ``` -------------------------------- ### Chartmuseum Configuration File Example Source: https://github.com/helm/chartmuseum/blob/main/README.md Example of a YAML configuration file for Chartmuseum. Replace placeholder values with your specific settings. This file allows for detailed configuration of storage, authentication, and other parameters. ```yaml debug: true port: 8080 storage.backend: local storage.local.rootdir: bearerauth: 1 authrealm: authservice: authcertpath: authactionssearchpath: depth: 2 ``` -------------------------------- ### Start Locust Loadtest Source: https://github.com/helm/chartmuseum/blob/main/loadtesting/README.md Starts the Locust load testing tool against a running Chartmuseum instance. Assumes Chartmuseum is accessible at http://localhost:8080. ```bash # run locust on a running chartmuseum instance pipenv run locust --host http://localhost:8080 ``` -------------------------------- ### Helm Install ChartMuseum Source: https://github.com/helm/chartmuseum/blob/main/README.md Add the ChartMuseum Helm repository and install the chart. This is a convenient way to deploy ChartMuseum within a Kubernetes cluster. ```bash helm repo add chartmuseum https://chartmuseum.github.io/charts helm install chartmuseum/chartmuseum ``` -------------------------------- ### Install Chartmuseum Locust Loadtesting Source: https://github.com/helm/chartmuseum/blob/main/loadtesting/README.md Installs the necessary dependencies for Chartmuseum load testing using pipenv. Navigate to the loadtesting directory before running. ```bash cd loadtesting pipenv install ``` -------------------------------- ### Start ChartMuseum with Basic Authentication Source: https://context7.com/helm/chartmuseum/llms.txt Configures ChartMuseum to protect all routes using Basic Authentication. Allows anonymous GET requests if `--auth-anonymous-get` is set. ```bash # Start server with basic auth chartmuseum --storage=local --storage-local-rootdir=./charts \ --basic-auth-user=admin \ --basic-auth-pass=changeme \ --auth-anonymous-get # allow pulls without auth # Authenticated upload curl -u admin:changeme --data-binary "@mychart-1.0.0.tgz" \ http://localhost:8080/api/charts # Helm with credentials helm repo add mymuseum http://localhost:8080 \ --username admin --password changeme ``` -------------------------------- ### Construct and Initialize Chart Server with Go Source: https://context7.com/helm/chartmuseum/llms.txt Use `NewMultiTenantServer` to build the core server, configure storage, logging, and API options. Ensure to handle potential errors during server creation and start the server listening on the specified port. ```go import ( "helm.sh/chartmuseum/pkg/chartmuseum" cm_logger "helm.sh/chartmuseum/pkg/chartmuseum/logger" "github.com/chartmuseum/storage" ) logger, _ := cm_logger.NewLogger(cm_logger.LoggerOptions{ Debug: true, LogJSON: false, }) backend := storage.NewLocalFilesystemBackend("./chartstorage") server, err := chartmuseum.NewServer(chartmuseum.ServerOptions{ Version: "0.16.6", StorageBackend: backend, Logger: logger, EnableAPI: true, AllowOverwrite: true, AllowForceOverwrite: true, UseStatefiles: true, Depth: 0, // single-tenant IndexLimit: 50, // parallel indexers MaxStorageObjects: 0, // unlimited MaxUploadSize: 20971520, // 20 MB CacheInterval: 5 * time.Minute, Port: 8080, }) if err != nil { log.Fatal(err) } server.Listen(8080) ``` -------------------------------- ### Start ChartMuseum with Dynamic Depth Source: https://context7.com/helm/chartmuseum/llms.txt Configure ChartMuseum to serve charts from multiple depth levels simultaneously using dynamic depth. ```bash chartmuseum --depth-dynamic --depth=2 \ --storage="local" --storage-local-rootdir=./charts ``` -------------------------------- ### Install pipenv Source: https://github.com/helm/chartmuseum/blob/main/loadtesting/README.md Installs the pipenv package manager, which is used to manage project dependencies. ```bash pip install pipenv ``` -------------------------------- ### Configure Basic HTTP Authentication Source: https://github.com/helm/chartmuseum/blob/main/README.md Enable basic HTTP authentication for all routes by providing username and password. Use `--auth-anonymous-get` to allow anonymous GET operations. ```bash chartmuseum --debug --port=8080 \ --basic-auth-user= \ --basic-auth-pass= ``` -------------------------------- ### Configure Single-Tenant ChartMuseum Source: https://context7.com/helm/chartmuseum/llms.txt Use this configuration for a single-tenant setup. Ensure the artifact hub repository UUID is correctly set. ```bash chartmuseum --storage=local --storage-local-rootdir=./charts \ --artifact-hub-repo-id "your-artifact-hub-repo-uuid" ``` -------------------------------- ### ChartMuseum Server Info API - Welcome Page Source: https://context7.com/helm/chartmuseum/llms.txt Access the welcome page of the ChartMuseum server via a GET request to the root URL. This page returns HTML, or a custom template if specified via the `--web-template-path` flag. ```bash curl http://localhost:8080/ ``` -------------------------------- ### Get Prometheus Metrics Source: https://context7.com/helm/chartmuseum/llms.txt Fetches Prometheus metrics from the server. Requires the `--enable-metrics` flag to be set during server startup. ```bash curl http://localhost:8080/metrics # Returns Prometheus text format metrics, including: # chartmuseum_charts_served_total{repo=""} 5 # chartmuseum_chart_versions_served_total{repo=""} 12 # chartmuseum_request_duration_seconds{quantile="0.5"} 0.002 ``` -------------------------------- ### Start ChartMuseum with HTTPS Only Source: https://context7.com/helm/chartmuseum/llms.txt Configures ChartMuseum to serve traffic over HTTPS using provided TLS certificate and key files. ```bash # HTTPS only chartmuseum --storage=local --storage-local-rootdir=./charts \ --tls-cert=/etc/certs/server.crt \ --tls-key=/etc/certs/server.key ``` -------------------------------- ### Mirror Kubernetes Repositories and Serve with ChartMuseum Source: https://github.com/helm/chartmuseum/blob/main/README.md This script mirrors official Kubernetes repositories and then serves them using ChartMuseum. Ensure you have the script and ChartMuseum installed. ```bash scripts/mirror-k8s-repos.sh chartmuseum --debug --port=8080 --storage="local" --storage-local-rootdir="./mirror" ``` -------------------------------- ### Start ChartMuseum with Depth-based Multi-repo Routing Source: https://context7.com/helm/chartmuseum/llms.txt Configures ChartMuseum to route tenants based on URL depth, creating a hierarchical storage structure. Set `--depth=2` for an org/repo structure. ```bash # Start with depth=2 for org/repo structure chartmuseum --debug --depth=2 \ --storage="local" \ --storage-local-rootdir=./charts # Storage layout expected: # charts/ # org1/ # repoa/ # mychart-1.0.0.tgz # org2/ # repob/ # otherchart-2.0.0.tgz # Each tenant gets its own Helm repository endpoint: helm repo add org1-repoa http://localhost:8080/org1/repoa helm repo add org2-repob http://localhost:8080/org2/repob ``` -------------------------------- ### Download Chart Package Source: https://context7.com/helm/chartmuseum/llms.txt Downloads a specific chart package tarball. Can be used directly or with Helm install. ```bash # Download chart tarball curl -O http://localhost:8080/charts/mychart-1.0.0.tgz # Install directly via Helm helm install myrelease chartmuseum/mychart --version 1.0.0 ``` -------------------------------- ### Get Server Info Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the ChartMuseum server version. Useful for monitoring and debugging. ```bash curl http://localhost:8080/info # Response: {"version":"0.16.6"} ``` -------------------------------- ### Fetch Artifact Hub Repository YAML for a Specific Org Source: https://context7.com/helm/chartmuseum/llms.txt Fetch the Artifact Hub repository configuration YAML for a specific organization in a multitenant setup. ```bash curl http://localhost:8080/org1/artifacthub-repo.yml ``` -------------------------------- ### Start ChartMuseum with Redis Cache Source: https://context7.com/helm/chartmuseum/llms.txt Configure ChartMuseum to use Redis for caching index.yaml, suitable for large deployments. Ensure Redis is running and accessible. ```bash chartmuseum --debug --port=8080 \ --storage="local" \ --storage-local-rootdir="./chartstorage" \ --cache="redis" \ --cache-redis-addr="localhost:6379" \ --cache-redis-password="redispassword" \ --cache-redis-db=0 ``` ```bash # Equivalent with environment variables export STORAGE=local export STORAGE_LOCAL_ROOTDIR=./chartstorage export CACHE=redis export CACHE_REDIS_ADDR=localhost:6379 export CACHE_REDIS_PASSWORD=redispassword export CACHE_REDIS_DB=0 chartmuseum ``` -------------------------------- ### Get Chart Templates Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the templates and default values for a specific chart version. ```APIDOC ## GET /api/:repo/charts/:name/:version/templates — get chart templates ### Description Returns a JSON object containing the chart's templates and their default values. ### Method GET ### Endpoint /api/:repo/charts/:name/:version/templates ### Response #### Success Response (200) - **templates** (array) - An array of template objects, each with `name` and `data` (base64 encoded). - **values** (object) - The default values for the chart. ``` -------------------------------- ### Get Chart values.yaml Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the raw `values.yaml` content for a specific chart version. The response includes `Content-Type: application/yaml`. ```bash curl http://localhost:8080/api/charts/mychart/1.0.0/values # Response (YAML): # replicaCount: 1 # image: # repository: nginx # tag: latest # service: # type: ClusterIP # port: 80 ``` -------------------------------- ### Start ChartMuseum with Cache Interval Source: https://context7.com/helm/chartmuseum/llms.txt Configure ChartMuseum to periodically rebuild the index.yaml cache, useful when charts are uploaded directly to storage. Set the interval in minutes. ```bash # Rebuild index every 5 minutes to pick up external storage changes chartmuseum --storage=local --storage-local-rootdir=./charts \ --cache-interval=5m ``` ```bash # Disable statefiles (index-cache.yaml) for pure in-memory operation chartmuseum --storage=local --storage-local-rootdir=./charts \ --disable-statefiles ``` -------------------------------- ### Start ChartMuseum with HTTPS and Mutual TLS Source: https://context7.com/helm/chartmuseum/llms.txt Sets up ChartMuseum for HTTPS communication and enforces mutual TLS authentication using a client CA certificate. ```bash # HTTPS with mutual client certificate authentication chartmuseum --storage=local --storage-local-rootdir=./charts \ --tls-cert=/etc/certs/server.crt \ --tls-key=/etc/certs/server.key \ --tls-ca-cert=/etc/certs/ca.crt ``` -------------------------------- ### Get Chart Templates and Values Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the chart's templates and their default values in a JSON format. Template data is base64 encoded. ```bash curl http://localhost:8080/api/charts/mychart/1.0.0/templates # Response: # { # "templates": [{"name":"templates/deployment.yaml","data":""},{"name":"templates/service.yaml","data":""}], # "values": {"replicaCount": 1, "image": {"repository": "nginx"}} # } ``` -------------------------------- ### Describe Specific Chart Version Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves detailed information about a specific version of a chart. Use 'latest' as the version to get the most recent one. ```bash curl http://localhost:8080/api/charts/mychart/1.0.0 # Response: # {"name":"mychart","version":"1.0.0","apiVersion":"v2","appVersion":"1.0.0","description":"A sample chart","digest":"def456","urls":["charts/mychart-1.0.0.tgz"],"created":"2024-01-10T08:00:00Z"} # Get latest version curl http://localhost:8080/api/charts/mychart/latest ``` -------------------------------- ### List All Charts Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves a JSON map of all chart names to their versions. Supports pagination via `offset` and `limit` query parameters. For multitenant setups, specify the repository path. ```bash # List all charts curl http://localhost:8080/api/charts # Response: # { # "mychart": [ # {"name":"mychart","version":"1.1.0","description":"...","digest":"abc","urls":["charts/mychart-1.1.0.tgz"],"created":"2024-01-15T10:00:00Z"}, # {"name":"mychart","version":"1.0.0","description":"...","digest":"def","urls":["charts/mychart-1.0.0.tgz"],"created":"2024-01-10T08:00:00Z"} # ] # } # Paginate: skip first 5, return next 5 curl "http://localhost:8080/api/charts?offset=5&limit=5" # Multitenant (depth=1): list charts in org1/repoa curl http://localhost:8080/api/org1/repoa/charts ``` -------------------------------- ### Upload Chart to a Specific Repository Source: https://github.com/helm/chartmuseum/blob/main/README.md Uploads a Helm chart to a specific repository within a multitenant setup using `curl`. The repository name is part of the API route. ```bash curl -F "chart=@mychart-0.1.0.tgz" http://localhost:8080/api/org1/repoa/charts ``` -------------------------------- ### Start ChartMuseum with Bearer/JWT Authentication Source: https://context7.com/helm/chartmuseum/llms.txt Enables Bearer Token authentication for ChartMuseum, validating RS256 JWT tokens. Requires specifying authentication server details and a public certificate path. ```bash # Start server with bearer auth chartmuseum --storage=local --storage-local-rootdir=./charts \ --bearer-auth \ --auth-realm="https://my-auth-server.example.com/oauth2/token" \ --auth-service="chartmuseum.example.com" \ --auth-cert-path="/etc/chartmuseum/auth-server-public.pem" # JWT token payload must include access claims: # { # "exp": 1700000000, # "iat": 1699999700, # "access": [ # { # "type": "artifact-repository", # "name": "repo", # "actions": ["pull", "push"] # } # ] # } # Use token in request TOKEN=$(curl -s "https://my-auth-server.example.com/oauth2/token?service=chartmuseum.example.com&scope=artifact-repository:repo:pull,push" | jq -r .token) curl -H "Authorization: Bearer $TOKEN" \ --data-binary "@mychart-1.0.0.tgz" \ http://localhost:8080/api/charts # Custom JMESPath to find actions in non-standard JWT structure chartmuseum ... --auth-actions-search-path "access[?name=='$NAMESPACE' && type=='$ACCESS_ENTRY_TYPE'].actions[]" ``` -------------------------------- ### Serve Static Assets for Welcome Page Source: https://context7.com/helm/chartmuseum/llms.txt Static assets like CSS and JavaScript for the custom welcome page are served from the `/static` path. Ensure your web directory structure includes a `static/` subdirectory. ```bash curl http://localhost:8080/static/main.css ``` -------------------------------- ### Server Startup with NewMultiTenantServer Source: https://context7.com/helm/chartmuseum/llms.txt Constructs and initializes the ChartMuseum server with specified options, including storage backend, logger, and API enablement. ```APIDOC ## Server Startup and Configuration ### `NewMultiTenantServer` — construct and initialize the chart server `NewMultiTenantServer` builds the core server, wires all storage/cache/router dependencies, primes the cache, and starts background event and cache-timer goroutines. ```go import ( "helm.sh/chartmuseum/pkg/chartmuseum" cm_logger "helm.sh/chartmuseum/pkg/chartmuseum/logger" "github.com/chartmuseum/storage" ) logger, _ := cm_logger.NewLogger(cm_logger.LoggerOptions{ Debug: true, LogJSON: false, }) backend := storage.NewLocalFilesystemBackend("./chartstorage") server, err := chartmuseum.NewServer(chartmuseum.ServerOptions{ Version: "0.16.6", StorageBackend: backend, Logger: logger, EnableAPI: true, AllowOverwrite: true, AllowForceOverwrite: true, UseStatefiles: true, Depth: 0, // single-tenant IndexLimit: 50, // parallel indexers MaxStorageObjects: 0, // unlimited MaxUploadSize: 20971520, // 20 MB CacheInterval: 5 * time.Minute, Port: 8080, }) if err != nil { log.Fatal(err) } server.Listen(8080) ``` ``` -------------------------------- ### Serve Custom Welcome Page Source: https://context7.com/helm/chartmuseum/llms.txt Configure ChartMuseum to serve a custom branded HTML welcome page from a specified directory. The `index.html` file is rendered as a Go template at the root path. ```bash chartmuseum --storage=local --storage-local-rootdir=./charts \ --web-template-path=./web ``` -------------------------------- ### Get Chart Values Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the raw `values.yaml` content for a specific chart version. ```APIDOC ## GET /api/:repo/charts/:name/:version/values — get chart values.yaml ### Description Returns the raw `values.yaml` content for a specific chart version. The `Content-Type` header will be `application/yaml`. ### Method GET ### Endpoint /api/:repo/charts/:name/:version/values ### Response #### Success Response (200) - Returns the raw YAML content of the `values.yaml` file. ``` -------------------------------- ### Configure Chartmuseum with Alibaba Cloud OSS Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Set up Chartmuseum for Alibaba Cloud OSS by defining the `ALIBABA_CLOUD_ACCESS_KEY_ID` and `ALIBABA_CLOUD_ACCESS_KEY_SECRET` environment variables, and specifying the bucket, prefix, and endpoint. ```bash chartmuseum --debug --port=8080 \ --storage="alibaba" \ --storage-alibaba-bucket="my-oss-bucket" \ --storage-alibaba-prefix="" \ --storage-alibaba-endpoint="oss-cn-beijing.aliyuncs.com" ``` -------------------------------- ### Fetch Artifact Hub Repository YAML Source: https://context7.com/helm/chartmuseum/llms.txt Fetch the Artifact Hub repository configuration YAML from the ChartMuseum server. ```bash curl http://localhost:8080/artifacthub-repo.yml ``` -------------------------------- ### Package and Upload Chart Source: https://github.com/helm/chartmuseum/blob/main/README.md Use the Helm CLI to package a chart and then upload the tgz file to ChartMuseum using curl. ```bash cd mychart/ helm package . ``` ```bash curl --data-binary "@mychart-0.1.0.tgz" http://localhost:8080/api/charts ``` -------------------------------- ### Configure Baidu Cloud BOS Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Configure ChartMuseum with Baidu Cloud BOS Storage. Ensure Baidu Cloud access key environment variables are set. ```bash chartmuseum --debug --port=8080 \ --storage="baidu" \ --storage-baidu-bucket="my-bos-bucket" \ --storage-baidu-prefix="" \ --storage-baidu-endpoint="bj.bcebos.com" ``` -------------------------------- ### Upload Chart and Provenance with Multipart Source: https://github.com/helm/chartmuseum/blob/main/README.md Upload both the chart package and its provenance file simultaneously using multipart/form-data with curl. ```bash curl -F "chart=@mychart-0.1.0.tgz" -F "prov=@mychart-0.1.0.tgz.prov" http://localhost:8080/api/charts ``` -------------------------------- ### Generate Index.yaml and Exit Source: https://context7.com/helm/chartmuseum/llms.txt Use the --gen-index flag to generate the index.yaml file and print it to stdout, then exit. This is useful for offline index generation. ```bash # Only generate and print index.yaml to stdout, then exit (depth=0 only) chartmuseum --gen-index \ --storage="local" \ --storage-local-rootdir="./chartstorage" > my-index.yaml cat my-index.yaml ``` -------------------------------- ### Configure Chartmuseum with S3-Compatible Services (Force Path Style) Source: https://github.com/helm/chartmuseum/blob/main/README.md When S3-compatible storage providers disable path-style access, use `storage-amazon-force-path-style=false` to force virtual hosted-style access. Set AWS credentials via environment variables. ```bash 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 ``` -------------------------------- ### Upload Chart Package via cURL (Binary) Source: https://context7.com/helm/chartmuseum/llms.txt Uploads a chart package using cURL with binary data. Use the `?force` query parameter to overwrite an existing version. ```bash cd mychart/ helm package . # Creates mychart-1.0.0.tgz curl --data-binary "@mychart-1.0.0.tgz" http://localhost:8080/api/charts # Response (201 Created): {"saved":true} # Response (409 Conflict): {"error":"file already exists"} # Overwrite existing version curl --data-binary "@mychart-1.0.0.tgz" "http://localhost:8080/api/charts?force" # Response (201 Created): {"saved":true} ``` -------------------------------- ### Configure Chartmuseum with Google Cloud Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Set up Chartmuseum for Google Cloud Storage by defining the `GOOGLE_APPLICATION_CREDENTIALS` environment variable pointing to your service account key file. ```bash export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/[FILE_NAME].json" ``` ```bash chartmuseum --debug --port=8080 \ --storage="google" \ --storage-google-bucket="my-gcs-bucket" \ --storage-google-prefix="" ``` -------------------------------- ### Upload and List Charts via API Source: https://context7.com/helm/chartmuseum/llms.txt Use curl to upload a chart package and then list charts from a specific repository. ```bash curl --data-binary "@mychart-1.0.0.tgz" \ http://localhost:8080/api/org1/repoa/charts ``` ```bash curl http://localhost:8080/api/org1/repoa/charts ``` -------------------------------- ### Configure Chartmuseum with S3-Compatible Services (Minio, DigitalOcean) Source: https://github.com/helm/chartmuseum/blob/main/README.md For S3-compatible services, set AWS credentials via environment variables and specify the endpoint. Ensure your IAM policy includes necessary S3 permissions. ```bash 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" ``` ```yaml { "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/*" } ] } ``` -------------------------------- ### Upload Chart using helm-push plugin Source: https://github.com/helm/chartmuseum/blob/main/README.md Utilize the helm-push plugin to upload a chart to ChartMuseum. ```bash helm cm-push mychart/ chartmuseum ``` -------------------------------- ### Configure Chartmuseum with DigitalOcean Spaces Source: https://github.com/helm/chartmuseum/blob/main/README.md Configure Chartmuseum for DigitalOcean Spaces by setting access keys and secret keys as environment variables, and specifying the bucket, prefix, region, and endpoint. ```bash 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" ``` -------------------------------- ### Configure Bearer/Token Authentication Source: https://github.com/helm/chartmuseum/blob/main/README.md Enable bearer token authentication for all routes. Requires authorization server details and a public PEM file. JWT tokens are expected in the Authorization header. ```bash chartmuseum --debug --port=8080 \ --bearer-auth \ --auth-realm= \ --auth-service= \ --auth-cert-path= \ --auth-actions-search-path= ``` -------------------------------- ### Example JWT Token Payload Source: https://github.com/helm/chartmuseum/blob/main/README.md This JSON structure represents a valid JWT token payload for accessing ChartMuseum resources. Ensure the 'access' section contains the necessary 'type', 'name', and 'actions' for the desired permissions. ```json { "exp": 1543995770, "iat": 1543995470, "access": [ { "type": "artifact-repository", "name": "org1/repo1", "actions": [ "pull" ] } ] } ``` -------------------------------- ### Configure Multitenant ChartMuseum (depth=1) Source: https://context7.com/helm/chartmuseum/llms.txt Configure ChartMuseum for multitenancy, allowing different repository IDs per organization. The `--depth=1` flag enables this mode. ```bash chartmuseum --storage=local --storage-local-rootdir=./charts \ --depth=1 \ --artifact-hub-repo-id "org1=uuid-for-org1" \ --artifact-hub-repo-id "org2=uuid-for-org2" ``` -------------------------------- ### Configure Local Filesystem Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Use this command to configure ChartMuseum with local filesystem storage. The specified directory will be created if it doesn't exist. ```bash chartmuseum --debug --port=8080 \ --storage="local" \ --storage-local-rootdir="./chartstorage" ``` -------------------------------- ### Configure Oracle Cloud Infrastructure Object Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Set up ChartMuseum to use Oracle Cloud Infrastructure Object Storage. Refer to OCI documentation for authentication details. ```bash chartmuseum --debug --port=8080 \ --storage="oracle" \ --storage-oracle-bucket="my-ocs-bucket" \ --storage-oracle-prefix="" \ --storage-oracle-compartmentid="ocid1.compartment.oc1..1234" ``` -------------------------------- ### Configure Tencent Cloud COS Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Set up ChartMuseum for Tencent Cloud COS Storage. Requires Tencent Cloud Secret ID and Secret Key environment variables. ```bash chartmuseum --debug --port=8080 \ --storage="tencent" \ --storage-tencent-bucket="my-cos-bucket" \ --storage-tencent-prefix="" \ --storage-tencent-endpoint="cos.ap-beijing.myqcloud.com" ``` -------------------------------- ### Programmatic Index Manipulation in Go Source: https://context7.com/helm/chartmuseum/llms.txt Demonstrates how to use ChartMuseum's Go SDK to programmatically add, update, remove, and check for chart entries in an index. Requires importing necessary packages. ```go import ( cm_repo "helm.sh/chartmuseum/pkg/repo" helm_chart "helm.sh/helm/v3/pkg/chart" helm_repo "helm.sh/helm/v3/pkg/repo" ) // Create a new index serverInfo := &cm_repo.ServerInfo{ContextPath: ""} index := cm_repo.NewIndex("http://localhost:8080", "", serverInfo, false) // Add a chart version entry cv := &helm_repo.ChartVersion{ Metadata: &helm_chart.Metadata{ Name: "mychart", Version: "1.0.0", }, URLs: []string{"charts/mychart-1.0.0.tgz"}, Digest: "sha256:abc123", } index.AddEntry(cv) // Update an existing entry cv.Digest = "sha256:newdigest" index.UpdateEntry(cv) // Remove an entry index.RemoveEntry(cv) // Check existence exists := index.HasEntry(cv) // false after removal // Regenerate raw YAML/JSON bytes (updates index.Raw) if err := index.Regenerate(); err != nil { log.Fatal(err) } fmt.Println(string(index.Raw)) ``` -------------------------------- ### Add ChartMuseum Repository to Helm Source: https://github.com/helm/chartmuseum/blob/main/README.md Add the ChartMuseum instance URL to your local Helm repository list. ```bash helm repo add chartmuseum http://localhost:8080 ``` -------------------------------- ### Configure etcd Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Configure ChartMuseum to use etcd as a backend. Requires CA certificate and signed key pair for secure communication. ```bash 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" ``` -------------------------------- ### Build Filename from Name and Version in Go Source: https://context7.com/helm/chartmuseum/llms.txt Use `ChartPackageFilenameFromNameVersion` to construct the standard Helm chart package filename using the chart's name and version. ```go import cm_repo "helm.sh/chartmuseum/pkg/repo" filename := cm_repo.ChartPackageFilenameFromNameVersion("mychart", "1.0.0") fmt.Println(filename) // "mychart-1.0.0.tgz" ``` -------------------------------- ### List All Versions of a Chart Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves a list of all available versions for a specific chart name. The response is a JSON array of chart version objects. ```bash curl http://localhost:8080/api/charts/mychart # Response: # [ # {"name":"mychart","version":"1.1.0","apiVersion":"v2","appVersion":"2.0.0","description":"A sample chart","digest":"abc123","urls":["charts/mychart-1.1.0.tgz"],"created":"2024-01-15T10:00:00Z"}, # {"name":"mychart","version":"1.0.0","apiVersion":"v2","appVersion":"1.0.0","description":"A sample chart","digest":"def456","urls":["charts/mychart-1.0.0.tgz"],"created":"2024-01-10T08:00:00Z"} # ] ``` -------------------------------- ### Server Information Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the server version information. ```APIDOC ## GET /info — server version ### Description Returns the server version information. ### Method GET ### Endpoint /info ### Response #### Success Response (200) - **version** (string) - The server version. ``` -------------------------------- ### Custom Welcome Page Structure Source: https://github.com/helm/chartmuseum/blob/main/README.md Specifies the directory structure for custom welcome pages. ChartMuseum uses gin-gonic, allowing go-template rendering. ```bash web/ index.html xyz.html static/ main.css main.js ``` -------------------------------- ### Configure Openstack Swift V1 Auth Source: https://github.com/helm/chartmuseum/blob/main/README.md Configure ChartMuseum for Openstack Swift V1 authentication. Requires specific Swift environment variables to be set. ```bash chartmuseum --debug --port=8080 \ --storage="openstack" \ --storage-openstack-auth="v1" \ --storage-openstack-container="mycontainer" \ --storage-openstack-prefix="" ``` -------------------------------- ### Check Index Availability Source: https://context7.com/helm/chartmuseum/llms.txt Performs a HEAD request to check if the index.yaml file is available for a repository. Returns HTTP 200 OK if available, otherwise a 404. ```bash curl -I http://localhost:8080/index.yaml # HTTP/1.1 200 OK ``` -------------------------------- ### Fetch Repository Index Source: https://context7.com/helm/chartmuseum/llms.txt Retrieves the repository's index.yaml file. This is used automatically by Helm for adding and updating repositories. ```bash # Single-tenant (depth=0): repo param is always empty path segment curl http://localhost:8080/index.yaml # Add to Helm helm repo add mymuseum http://localhost:8080 helm repo update # With basic auth helm repo add mymuseum http://admin:secret@localhost:8080 # Expected response: standard Helm index.yaml # apiVersion: v1 # entries: # mychart: # - apiVersion: v2 # created: "2024-01-15T10:00:00Z" # description: My chart # digest: sha256:abc123... # name: mychart # urls: # - charts/mychart-1.0.0.tgz # version: 1.0.0 # generated: "2024-01-15T10:00:00Z" # serverInfo: # contextPath: "" ``` -------------------------------- ### Multitenant Chart Upload via cURL Source: https://context7.com/helm/chartmuseum/llms.txt Uploads a chart package to a specific repository within a tenant structure using cURL. ```bash curl --data-binary "@mychart-1.0.0.tgz" http://localhost:8080/api/org1/repoa/charts ``` -------------------------------- ### Fetch Repository Index Source: https://context7.com/helm/chartmuseum/llms.txt Fetches the repository index file, used by Helm for repository operations. ```APIDOC ## GET /:repo/index.yaml — fetch repository index ### Description Returns a dynamically generated `index.yaml` file for the specified repository. This is used automatically by `helm repo add` and `helm repo update`. ### Method GET ### Endpoint /:repo/index.yaml ### Response #### Success Response (200) - Returns a standard Helm `index.yaml` file. ``` -------------------------------- ### Configure Openstack Object Storage Source: https://github.com/helm/chartmuseum/blob/main/README.md Use this command to configure ChartMuseum with Openstack Object Storage. Ensure environment variables for authentication are set. ```bash chartmuseum --debug --port=8080 \ --storage="openstack" \ --storage-openstack-container="mycontainer" \ --storage-openstack-prefix="" \ --storage-openstack-region="myregion" ``` -------------------------------- ### ChartMuseum Multitenancy Configuration Source: https://github.com/helm/chartmuseum/blob/main/README.md For multitenancy, provide key-value pairs to the artifact-hub-repo-id flag. The artifacthub-repo.yml file will be served at paths corresponding to the provided keys. ```bash chartmuseum --storage local --storage-local-rootdir /tmp/ --depth 1 --artifact-hub-repo-id org1= --artifact-hub-repo-id org2= ``` -------------------------------- ### Upload Provenance File Source: https://context7.com/helm/chartmuseum/llms.txt Uploads a provenance file for a chart package to the server. ```APIDOC ## POST /api/:repo/prov — upload a provenance file ### Method POST ### Endpoint `/api/:repo/prov` ### Request Body - Accepts binary body (`application/octet-stream`) for the provenance file. ### Request Example ```bash curl --data-binary "@mychart-1.0.0.tgz.prov" http://localhost:8080/api/prov ``` ### Response #### Success Response (201 Created) - **saved** (boolean) - Indicates if the provenance file was saved successfully. ``` -------------------------------- ### Configure Helm Client with Custom CA and Client Certificates Source: https://context7.com/helm/chartmuseum/llms.txt Adds a ChartMuseum repository to Helm, configuring it to use a custom CA certificate for verification and client certificates for mutual TLS authentication. ```bash # Helm with custom CA helm repo add mymuseum https://localhost:8080 \ --ca-file /etc/certs/ca.crt \ --cert-file /etc/certs/client.crt \ --key-file /etc/certs/client.key ``` -------------------------------- ### TLS Configuration Source: https://context7.com/helm/chartmuseum/llms.txt Details on configuring TLS for HTTPS and mutual TLS authentication. ```APIDOC ## TLS Configuration ### HTTPS only Configure TLS using `--tls-cert` and `--tls-key`. ### HTTPS with mutual client certificate authentication Configure TLS using `--tls-cert`, `--tls-key`, and `--tls-ca-cert`. ### Helm Configuration with Custom CA ```bash helm repo add mymuseum https://localhost:8080 --ca-file /etc/certs/ca.crt --cert-file /etc/certs/client.crt --key-file /etc/certs/client.key ``` ``` -------------------------------- ### List All Versions of a Chart Source: https://context7.com/helm/chartmuseum/llms.txt Lists all available versions for a specific chart within a repository. ```APIDOC ## GET /api/:repo/charts/:name — list all versions of a chart ### Description Returns a list of all versions for a given chart name in the repository. ### Method GET ### Endpoint /api/:repo/charts/:name ### Parameters #### Path Parameters - **name** (string) - The name of the chart. ``` -------------------------------- ### Check if Chart Version Exists Source: https://context7.com/helm/chartmuseum/llms.txt Performs a HEAD request to verify the existence of a specific chart version. Returns HTTP 200 OK if the version exists, otherwise 404 Not Found. ```bash curl -I http://localhost:8080/api/charts/mychart/1.0.0 # HTTP/1.1 200 OK (version exists) # HTTP/1.1 404 Not Found (version does not exist) ``` -------------------------------- ### List All Charts Source: https://context7.com/helm/chartmuseum/llms.txt Lists all charts in a repository, with support for pagination. ```APIDOC ## GET /api/:repo/charts — list all charts (with pagination) ### Description Returns a JSON map of all chart names to their versions within a repository. Supports `offset` and `limit` query parameters for pagination. ### Method GET ### Endpoint /api/:repo/charts ### Parameters #### Query Parameters - **offset** (integer) - Optional. The number of charts to skip. - **limit** (integer) - Optional. The maximum number of charts to return. ```