This is the 8th day of my participation in the August More text Challenge. For details, see: August More Text Challenge

gossip

ChartMuseum’s official website is an open source helm Chart repository written in Go, also known as the private server. It can be deployed locally and supports many storage backends, including Alibaba and Tencent object storage, minio and etc

ChartMuseum

Before installing ChartMuseum, the support of helm-push plug-in is required. This plug-in is used to upload chart package to ChartMuseum, and the plug-in and private server are both official productions of helm, which is a complete one-stop service

Building such a private server, one is security, two is convenient, three is automation, like Maven private server, Docker private server, play the role of connecting all links

helm-push

Installing the helm-push plug-in is as simple as a single command

helm plugin install https://github.com/chartmuseum/helm-push.git
Copy the code

You can wait until the completion. If the server is slow to access github or cannot access it at all, you are advised to use the Github520 tool, swipe hosts and write to the hosts file on the server

ChartMuseum installation

ChartMuseum can be installed in a variety of ways, such as starting directly on the machine as a process, running with one click of Docker, or installing with helm, all of which are very convenient. You can use whichever you like

Docker installation mode

This is stored locally

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:v013.1.
Copy the code

Examples are S3 storage, OSS and so on

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:v013.1.
Copy the code

Helm installation

Helm mode or old routine, add the warehouse address, install finished

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

Shell Installation

One-click installation, or you can use your own packaged executable package,

curl https://raw.githubusercontent.com/helm/chartmuseum/main/scripts/get-chartmuseum | bashChartmuseum --versionCopy the code

Create private servers

After we finally installed ChartMuseum in docker style, we added a repo with helm and then uploaded a chart package to test it out

Here you download a package from the Bitnami repository and upload it to the private server (repo) you just set up.

# private server (repo) helm repo add chartmuseum//ip:8080# Download nginx chart helm pull bitnami/nginx # Download nginx chart helm push bitnami -9.41..tgz chartmuseum
Copy the code

Error handling

Error: 500: open /charts/nginx-9.4.1. TGZ: permission denied

It is ok to change the permission of the whole Charts directory to 777. It is not the directory where helm push is located, but the Docker launched by Chartmuseum. The Charts folder is mounted, so it is necessary to go to chartmuseum server and set the Charts directory to 777

Operating private servers

List all charts with curl HTTP://ip:8080/api/charts# Charts curl://ip:8080/api/charts/nginx# Charts curl -s-x DELETE HTTP:/ / IP: 8080 / API/charts/consul/also 6.1.3
Copy the code

View the results

Update the repo and search to find the packages on your private server

helm repo update
helm search repo chartmuseum
Copy the code

conclusion

ChartMuseum is very simple to deploy to use, and provides many apis for secondary development, or direct access to a third UI management tool, such as Kubeapps, directly produced on the website but not maintained Monocular