10-ヘルム

チャート倉庫

ヘルムアーキテクチャhttps://helm.sh/docs/architecture/

メインコンセプト

  • チャートアプリケーションインスタンスに必要な情報Kubernetesのセットを作成します
  • 設定は、コンフィギュレーション情報をr eleaseグラフオブジェクトを作成するために、パッケージに組み込むことができる含んでいます。
  • 特定の設定を有する操作の放出チャートの例

パッケージ

ヘルムは、主に2つのコンポーネントがあります。

ヘルムクライアントは、コマンドラインクライアントの究極のユーザーです。お客様は、以下の機能があります。

  • ローカルの開発・チャート
  • 倉庫管理
  • ティラーは、サーバーとの対話します
    • インストールされているチャートを送ります
    • 情報のリリースに関するクエリ
    • アップグレードを要求したり、既存のリリースをアンインストールします

ティラーServerは、ヘルムがクライアントと対話し、サーバークラスタであり、サーバーはKubernetesのAPIに接続されています。Serverは、以下の役割があります。

  • ヘルムクライアントはからの着信要求をリッスン
  • チャートを組み合わせて、コンフィグのバージョンを構築します
  • チャートはKubernetesを搭載し、かつトレースリリース
  • アップグレードおよびアンインストールチャートと相互作用することによってKubernetes

要するに、クライアントは、サーバのバージョンを管理するための責任ある管理チャート、責任があります。

ヘルムコマンド

helm search
helm repo update
helm list

release 管理
helm inspect  # 查看chart信息
helm install  
helm delete
helm upgrade
helm rolleback

char 操作
helm create
helm fetch
helm inpect  查看chart的详细信息
helm package 打包chart文件

アリクラウドヘルム倉庫を使用します

helm init --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.5.1 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

カスタムチャート

wordpress/
  Chart.yaml          # A YAML file containing information about the chart
  LICENSE             # OPTIONAL: A plain text file containing the license for the chart
  README.md           # OPTIONAL: A human-readable README file
  requirements.yaml   # OPTIONAL: A YAML file listing dependencies for the chart
  values.yaml         # The default configuration values for this chart
  charts/             # A directory containing any charts upon which this chart depends.
  templates/          # A directory of templates that, when combined with values,
                      # will generate valid Kubernetes manifest files.
  templates/NOTES.txt # OPTIONAL: A plain text file containing short usage notes

CHART.YAMLファイル

Chart.yamlファイルは、チャートのために必要とされます。これは、次のフィールドがあります。

apiVersion: The chart API version, always "v1" (required)
name: The name of the chart (required)
version: A SemVer 2 version (required)
kubeVersion: A SemVer range of compatible Kubernetes versions (optional)
description: A single-sentence description of this project (optional)
keywords:
  - A list of keywords about this project (optional)
home: The URL of this project's home page (optional)
sources:
  - A list of URLs to source code for this project (optional)
maintainers: # (optional)
  - name: The maintainer's name (required for each maintainer)
    email: The maintainer's email (optional for each maintainer)
    url: A URL for the maintainer (optional for each maintainer)
engine: gotpl # The name of the template engine (optional, defaults to gotpl)
icon: A URL to an SVG or PNG image to be used as an icon (optional).
appVersion: The version of the app that this contains (optional). This needn't be SemVer.
deprecated: Whether this chart is deprecated (optional, boolean)
tillerVersion: The version of Tiller that this chart requires. This should be expressed as a SemVer range: ">2.0.0" (optional)

requirements.yaml

requirements.yamlファイルには、あなたの依存関係を一覧表示するための単純なファイルです。

dependencies:
  - name: apache
    version: 1.2.3
    repository: http://example.com/charts
  - name: mysql
    version: 3.2.1
    repository: http://another.example.com/charts

使用helm depダウンロード依存性

$ helm dep up foochart
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "example" chart repository
...Successfully got an update from the "another" chart repository
Update Complete. Happy Helming!
Saving 2 charts
Downloading apache from repo http://example.com/charts
Downloading mysql from repo http://another.example.com/charts

自動的に生成されたディレクトリ構造

テンプレートの構文を行きます

実権を握っカスタムキーコマンド倉庫

# 创建helm仓库
helm create

# helm 检测语法
helm lint

# helm 打包
helm package

# 启动本地helm 端口8879
helm serve

helm delete --purge

おすすめ

転載: www.cnblogs.com/pythonPath/p/11267441.html