2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

helm-importプラグイン作った

Posted at

Chart Repositoryの公開されていないHelm Chartに稀によく遭遇するので、そういったChartをローカルリポジトリに取り込むためのhelm-importプラグインを作りました。

GitHub - k-kinzal/helm-import: Import Helm Chart where only public code into local repository.

とりあえずtgzもしくはGitHubリポジトリで公開されているChartをローカルリポジトリに取り込むことができます。

$ helm import https://github.com/helm/charts/tree/master/stable/acs-engine-autoscaler
$ helm serve &
$ helm search local
NAME                             	CHART VERSION	APP VERSION	DESCRIPTION                                                 
local/acs-engine-autoscaler      	2.2.2        	2.1.1      	DEPRECATED Scales worker nodes within agent pool

まぁリリースのときに自前でgit cloneすれば良い話ではあるのですが、例えばhelmfileでChartを管理するときに毎回処理を書くのが面倒臭いのでそういうときにちょうど良いです。

releases:
  - name: acs-engine-autoscaler
    namespace: acs-engine-autoscaler
    chart: "{{ exec "helm" (list "home") | trim }}/repository/local/acs-engine-autoscaler-2.2.2.tgz"
    values:
    - values/values.yaml.gotmpl
    hooks:
    - events:
      - prepare
      command: helm
      args:
      - import
      - https://github.com/helm/charts/tree/master/stable/acs-engine-autoscale

helmfileで使うときはこんな感じ。
本当はhelm serveを使いたかったのですがhelmfileの問題なのかうまく動作しないのでtgzを直指定しています。(もしくはhelmfileの実行前にhelm serve使うとシンプルになります)
過去に取り込んだChartを永続化する場合CIサーバーとかで$HELM_HOME/repository/localを永続化すれば溜め込んでいくことができると思います。

余談ですが、これは元々atlantisとかalb-ingress-controllerのChartを取り込むために作成しました。
が、気がついたらどちらも公式のhelm/chartに取り込まれてて作る必要なかった!!!という感じでとても悔しい気持ちです。
公式に入ってChart Repository経由で扱えるのは良いことなんですけどね!本当に便利になるので良いことなんですけどね!!!

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?