helm-dashboard

可以管理 helm chart 的網頁工具。

https://github.com/komodorio/helm-dashboard

有兩種使用方式

  • 指令列
  • 用 helm 佈署到容器平台

指令列

安裝 (以下假定你已經安裝 helm)

helm plugin install https://github.com/komodorio/helm-dashboard.git

使用

helm dashboard -b --bind=0.0.0.0 -p 8080

這會在 port 8080 啟動一個網頁伺服器,然後就可以用瀏覽器存取了。

用 helm 佈署到容器平台

加入 helm repo

helm repo add komodorio https://helm-charts.komodor.io

更新 helm repo

helm repo update komodorio

取出 chart 可設定的參數

helm show values komodorio/helm-dashboard >values.yaml

修改 values.yaml,主要修改以下內容

  • ingress:我使用 tailscale ,所以 ingress 設為 tailscale
  • service:port 調整為 9090,這改不改沒關係
  • dashboard:因網頁介面內可以直接 upgrade chart,所以把 allowWriteActions 設為 true

ingress:
enabled: true
className: “tailscale”
hosts:
– host: “”
service:
port: 9090
dashboard:
allowWriteActions: true

安裝

helm upgrade --install helm-dashboard komodorio/helm-dashboard \
  --namespace helm-dashboard \
  --create-namespace \
  -f values.yaml

安裝以後,就可以使用 ingress 的 address 登入了。

畫面可參考:https://github.com/komodorio/helm-dashboard/blob/main/images/screenshot.png

helm images

適用情境,客戶是離線環境,沒辦法直接拉 container image,所以要先知道 helm chart 裏面用到的 container image,用這指令,就可以找到所有 helm chart 所使用到的 image,再用 skopeo/podman pull/docker pull 拉取下來,存為 tarball ,並帶到客戶端。

專案網址:https://github.com/nikhilsbhat/helm-images

安裝

安裝好 helm 以後,可以用以下指令安裝

helm plugin install https://github.com/nikhilsbhat/helm-images

使用

簡單說,就是拿 helm install 的指令來用,並改為 helm images get。

所以在配置好 helm repo 以後,就可以用 helm images 取得

例如 redis-operator

helm images get redis redis-operator/redis-operator

又例如 zabbix operator

helm images get zabbix zabbix-chart-7.0/zabbix-helm-chrt

就可以取得 container images 的網址。


題外話,應該要來熟悉一下 skopeo 怎麼用才是。

如何檢查GitOps Manifests

Kubernetes 主要會用這幾種檔案格式:

  1. YAML
  2. Kustomize
  3. Helm Chart

在使用前,是否可以檢查呢?以下就分別來介紹

YAMLint

YAML 可以使用 yamllint 來檢查,在 RHEL9 裡可以直接安裝 yamllint 。

sudo yum install yamllint

用以下指令檢查

yamllint service.yml

可以使用 -f 來指定輸出格式。

Kustomize

kustomize 可以用 kustomize build 來檢查。

kustomize build path/to/folder

Red Hat 有寫一個輔助腳本:validate_manifest.sh

Helm

helm 本身有提供 subcommand 來檢查:helm lint

helm lint Chart.yaml

參考資料