Skip to content

Instantly share code, notes, and snippets.

@taking
Last active June 22, 2022 00:23
Show Gist options
  • Save taking/eaa8c040d2e1978f2166748a5c901ba6 to your computer and use it in GitHub Desktop.
Save taking/eaa8c040d2e1978f2166748a5c901ba6 to your computer and use it in GitHub Desktop.

Chartmuseum Installation with Helm

Repo

Document

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+
  • [If enabled] A persistent storage resource and RW access to it
  • [If enabled] Kubernetes StorageClass for dynamic provisioning

helm update

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

install

helm install chartmuseum chartmuseum/chartmuseum \
  --create-namespace \
  --namespace=chartmuseum \
  --set env.open.DISABLE_API=false \
  --set env.open.ALLOW_OVERWRITE=true \
  --set env.secret.BASIC_AUTH_USER=admin \
  --set env.secret.BASIC_AUTH_PASS=password

(Option) Chartmuseum Frontend UI

cat <<'EOF' | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: chartmuseum-ui
  namespace: chartmuseum
  labels:
    app: chartmuseum-ui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: chartmuseum-ui
  template:
    metadata:
      labels:
        app: chartmuseum-ui
    spec:
      containers:
      - name: chartmuseum-ui
        image: idobry/chartmuseumui:latest
        ports:
        - containerPort: 8080
        env:
        - name: CHART_MUSEUM_URL
          value: http://chartmuseum.chartmuseum.svc.cluster.local
---
apiVersion: v1
kind: Service
metadata:
  name: chartmuseum-ui
  namespace: chartmuseum
spec:
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 8080
    nodePort: 32073
  selector:
    run: chartmuseum-ui
  type: NodePort
EOF

How-to

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 push mychart/ chartmuseum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment