HelmDeploy@0 - Helm Chart v0 タスクのパッケージ化とデプロイ
このタスクを使用して、Helm コマンドを実行して、Azure Container Service で Kubernetes クラスターをデプロイ、構成、または更新します。
構文
# Package and deploy Helm charts v0
# Deploy, configure, update a Kubernetes cluster in Azure Container Service by running helm commands.
- task: HelmDeploy@0
inputs:
# Kubernetes Cluster
#connectionType: 'Azure Resource Manager' # 'Azure Resource Manager' | 'Kubernetes Service Connection' | 'None'. Required when command != logout && command != package && command != save. Connection Type. Default: Azure Resource Manager.
#azureSubscription: # string. Alias: azureSubscriptionEndpoint. Required when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Azure subscription.
#azureResourceGroup: # string. Required when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Resource group.
#kubernetesCluster: # string. Required when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Kubernetes cluster.
#useClusterAdmin: false # boolean. Optional. Use when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Use cluster admin credentials. Default: false.
#kubernetesServiceConnection: # string. Alias: kubernetesServiceEndpoint. Required when connectionType = Kubernetes Service Connection && command != logout && command != package && command != save. Kubernetes Service Connection.
#namespace: # string. Optional. Use when command != logout && command != package && command != save. Namespace.
# Azure Container Registry
#azureSubscriptionForACR: # string. Alias: azureSubscriptionEndpointForACR. Required when command == save. Azure subscription for Container Registry.
#azureResourceGroupForACR: # string. Required when command == save. Resource group.
#azureContainerRegistry: # string. Required when command == save. Azure Container Registry.
# Commands
command: 'ls' # 'create' | 'delete' | 'expose' | 'get' | 'init' | 'install' | 'login' | 'logout' | 'ls' | 'package' | 'rollback' | 'save' | 'upgrade' | 'uninstall'. Required. Command. Default: ls.
#chartType: 'Name' # 'Name' | 'FilePath'. Required when command == install || command == upgrade. Chart Type. Default: Name.
chartName: # string. Required when chartType == Name. Chart Name.
#chartPath: # string. Required when chartType == FilePath || command == package. Chart Path.
#chartVersion: # string. Alias: version. Optional. Use when command == package || command == install || command == upgrade. Version.
#releaseName: # string. Optional. Use when command == install || command == upgrade. Release Name.
#overrideValues: # string. Optional. Use when command == install || command == upgrade. Set Values.
#valueFile: # string. Optional. Use when command == install || command == upgrade. Value File.
#destination: '$(Build.ArtifactStagingDirectory)' # string. Optional. Use when command == package. Destination. Default: $(Build.ArtifactStagingDirectory).
#canaryimage: false # boolean. Optional. Use when command == init. Use canary image version. Default: false.
#upgradetiller: true # boolean. Optional. Use when command == init. Upgrade Tiller. Default: true.
#updatedependency: false # boolean. Optional. Use when command == install || command == package. Update Dependency. Default: false.
#save: true # boolean. Optional. Use when command == package. Save. Default: true.
#install: true # boolean. Optional. Use when command == upgrade. Install if release not present. Default: true.
#recreate: false # boolean. Optional. Use when command == upgrade. Recreate Pods. Default: false.
#resetValues: false # boolean. Optional. Use when command == upgrade. Reset Values. Default: false.
#force: false # boolean. Optional. Use when command == upgrade. Force. Default: false.
#waitForExecution: true # boolean. Optional. Use when command == init || command == install || command == upgrade. Wait. Default: true.
#arguments: # string. Optional. Use when command != login && command != logout. Arguments.
#chartNameForACR: # string. Required when command == save. Chart Name For Azure Container Registry.
#chartPathForACR: # string. Required when command == save. Chart Path for Azure Container Registry.
# TLS
#enableTls: false # boolean. Optional. Use when command != login && command != logout && command != package && command != save. Enable TLS. Default: false.
#caCert: # string. Required when enableTls == true && command != login && command != logout && command != package && command != save. CA certificate.
#certificate: # string. Required when enableTls == true && command != login && command != logout && command != package && command != save. Certificate.
#privatekey: # string. Required when enableTls == true && command != login && command != logout && command != package && command != save. Key.
# Advanced
#tillernamespace: # string. Optional. Use when command != login && command != logout && command != package && command != save. Tiller namespace.
#failOnStderr: false # boolean. Optional. Use when command != login && command != logout && command != package && command != save. Fail on Standard Error. Default: false.
#publishPipelineMetadata: true # boolean. Optional. Use when command != login && command != logout && command != package && command != save. Publish pipeline metadata. Default: true.
# Package and deploy Helm charts v0
# Deploy, configure, update a Kubernetes cluster in Azure Container Service by running helm commands.
- task: HelmDeploy@0
inputs:
# Kubernetes Cluster
#connectionType: 'Azure Resource Manager' # 'Azure Resource Manager' | 'Kubernetes Service Connection' | 'None'. Required when command != logout && command != package && command != save. Connection Type. Default: Azure Resource Manager.
#azureSubscription: # string. Alias: azureSubscriptionEndpoint. Required when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Azure subscription.
#azureResourceGroup: # string. Required when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Resource group.
#kubernetesCluster: # string. Required when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Kubernetes cluster.
#useClusterAdmin: false # boolean. Optional. Use when connectionType = Azure Resource Manager && command != logout && command != package && command != save. Use cluster admin credentials. Default: false.
#kubernetesServiceConnection: # string. Alias: kubernetesServiceEndpoint. Required when connectionType = Kubernetes Service Connection && command != logout && command != package && command != save. Kubernetes Service Connection.
#namespace: # string. Optional. Use when command != logout && command != package && command != save. Namespace.
# Azure Container Registry
#azureSubscriptionForACR: # string. Alias: azureSubscriptionEndpointForACR. Required when command == save. Azure subscription for Container Registry.
#azureResourceGroupForACR: # string. Required when command == save. Resource group.
#azureContainerRegistry: # string. Required when command == save. Azure Container Registry.
# Commands
command: 'ls' # 'create' | 'delete' | 'expose' | 'get' | 'init' | 'install' | 'login' | 'logout' | 'ls' | 'package' | 'rollback' | 'save' | 'upgrade'. Required. Command. Default: ls.
#chartType: 'Name' # 'Name' | 'FilePath'. Required when command == install || command == upgrade. Chart Type. Default: Name.
chartName: # string. Required when chartType == Name. Chart Name.
#chartPath: # string. Required when chartType == FilePath || command == package. Chart Path.
#chartVersion: # string. Alias: version. Optional. Use when command == package || command == install || command == upgrade. Version.
#releaseName: # string. Optional. Use when command == install || command == upgrade. Release Name.
#overrideValues: # string. Optional. Use when command == install || command == upgrade. Set Values.
#valueFile: # string. Optional. Use when command == install || command == upgrade. Value File.
#destination: '$(Build.ArtifactStagingDirectory)' # string. Optional. Use when command == package. Destination. Default: $(Build.ArtifactStagingDirectory).
#canaryimage: false # boolean. Optional. Use when command == init. Use canary image version. Default: false.
#upgradetiller: true # boolean. Optional. Use when command == init. Upgrade Tiller. Default: true.
#updatedependency: false # boolean. Optional. Use when command == install || command == package. Update Dependency. Default: false.
#save: true # boolean. Optional. Use when command == package. Save. Default: true.
#install: true # boolean. Optional. Use when command == upgrade. Install if release not present. Default: true.
#recreate: false # boolean. Optional. Use when command == upgrade. Recreate Pods. Default: false.
#resetValues: false # boolean. Optional. Use when command == upgrade. Reset Values. Default: false.
#force: false # boolean. Optional. Use when command == upgrade. Force. Default: false.
#waitForExecution: true # boolean. Optional. Use when command == init || command == install || command == upgrade. Wait. Default: true.
#arguments: # string. Optional. Use when command != login && command != logout. Arguments.
#chartNameForACR: # string. Required when command == save. Chart Name For Azure Container Registry.
#chartPathForACR: # string. Required when command == save. Chart Path for Azure Container Registry.
# TLS
#enableTls: false # boolean. Optional. Use when command != login && command != logout && command != package && command != save. Enable TLS. Default: false.
#caCert: # string. Required when enableTls == true && command != login && command != logout && command != package && command != save. CA certificate.
#certificate: # string. Required when enableTls == true && command != login && command != logout && command != package && command != save. Certificate.
#privatekey: # string. Required when enableTls == true && command != login && command != logout && command != package && command != save. Key.
# Advanced
#tillernamespace: # string. Optional. Use when command != login && command != logout && command != package && command != save. Tiller namespace.
#failOnStderr: false # boolean. Optional. Use when command != login && command != logout && command != package && command != save. Fail on Standard Error. Default: false.
#publishPipelineMetadata: true # boolean. Optional. Use when command != login && command != logout && command != package && command != save. Publish pipeline metadata. Default: true.
# Package and deploy Helm charts v0
# Deploy, configure, update a Kubernetes cluster in Azure Container Service by running helm commands.
- task: HelmDeploy@0
inputs:
# Kubernetes Cluster
#connectionType: 'Azure Resource Manager' # 'Azure Resource Manager' | 'Kubernetes Service Connection' | 'None'. Required when command != logout && command != package. Connection Type. Default: Azure Resource Manager.
#azureSubscription: # string. Alias: azureSubscriptionEndpoint. Required when connectionType = Azure Resource Manager && command != logout && command != package. Azure subscription.
#azureResourceGroup: # string. Required when connectionType = Azure Resource Manager && command != logout && command != package. Resource group.
#kubernetesCluster: # string. Required when connectionType = Azure Resource Manager && command != logout && command != package. Kubernetes cluster.
#useClusterAdmin: false # boolean. Optional. Use when connectionType = Azure Resource Manager && command != logout && command != package. Use cluster admin credentials. Default: false.
#kubernetesServiceConnection: # string. Alias: kubernetesServiceEndpoint. Required when connectionType = Kubernetes Service Connection && command != logout && command != package. Kubernetes Service Connection.
#namespace: # string. Optional. Use when command != logout && command != package. Namespace.
# Commands
command: 'ls' # 'create' | 'delete' | 'expose' | 'get' | 'init' | 'install' | 'login' | 'logout' | 'ls' | 'package' | 'rollback' | 'upgrade'. Required. Command. Default: ls.
#chartType: 'Name' # 'Name' | 'FilePath'. Required when command == install || command == upgrade. Chart Type. Default: Name.
chartName: # string. Required when chartType == Name. Chart Name.
#chartPath: # string. Required when chartType == FilePath || command == package. Chart Path.
#chartVersion: # string. Alias: version. Optional. Use when command == package. Version.
#releaseName: # string. Optional. Use when command == install || command == upgrade. Release Name.
#overrideValues: # string. Optional. Use when command == install || command == upgrade. Set Values.
#valueFile: # string. Optional. Use when command == install || command == upgrade. Value File.
#destination: '$(Build.ArtifactStagingDirectory)' # string. Optional. Use when command == package. Destination. Default: $(Build.ArtifactStagingDirectory).
#canaryimage: false # boolean. Optional. Use when command == init. Use canary image version. Default: false.
#upgradetiller: true # boolean. Optional. Use when command == init. Upgrade Tiller. Default: true.
#updatedependency: false # boolean. Optional. Use when command == install || command == package. Update Dependency. Default: false.
#save: true # boolean. Optional. Use when command == package. Save. Default: true.
#install: true # boolean. Optional. Use when command == upgrade. Install if release not present. Default: true.
#recreate: false # boolean. Optional. Use when command == upgrade. Recreate Pods. Default: false.
#resetValues: false # boolean. Optional. Use when command == upgrade. Reset Values. Default: false.
#force: false # boolean. Optional. Use when command == upgrade. Force. Default: false.
#waitForExecution: true # boolean. Optional. Use when command == init || command == install || command == upgrade. Wait. Default: true.
#arguments: # string. Optional. Use when command != login && command != logout. Arguments.
# TLS
#enableTls: false # boolean. Optional. Use when command != login && command != logout && command != package. Enable TLS. Default: false.
#caCert: # string. Required when enableTls == true && command != login && command != logout && command != package. CA certificate.
#certificate: # string. Required when enableTls == true && command != login && command != logout && command != package. Certificate.
#privatekey: # string. Required when enableTls == true && command != login && command != logout && command != package. Key.
# Advanced
#tillernamespace: # string. Optional. Use when command != login && command != logout && command != package. Tiller namespace.
#failOnStderr: true # boolean. Optional. Use when command != login && command != logout && command != package. Fail on Standard Error. Default: true.
入力
connectionType
-
接続の種類の
string
.
command != logout && command != package && command != save
する場合に必要です。 使用できる値: Azure Resource Manager
、Kubernetes Service Connection
、None
。 既定値: Azure Resource Manager
.
接続の種類を指定します。
-
Kubernetes Service Connection
-kubeconfig
または Azure サービス アカウントを使用して任意の Kubernetes クラスターに接続するKubernetes Service Connection
を指定します。 KubeConfig ファイルを指定したり、サービス アカウントを指定したり、Azure サブスクリプション オプションを使用して AKS インスタンスをインポートしたりできます。 Azure サブスクリプション オプションを使用して AKS インスタンスをインポートするには、サービス接続の構成時に Kubernetes クラスターにアクセスする必要があります。 -
Azure Resource Manager
- Azure サービス接続を使用して Azure Kubernetes Service に接続するAzure Resource Manager
を指定します。 サービス接続の構成時に Kubernetes クラスターにアクセスしません。 -
None
- ローカルに格納されている事前に作成された Kubernetes 構成を使用します。
詳細については、次の「解説」セクションの「サービス接続」を参照してください。
connectionType
-
接続の種類の
string
.
command != logout && command != package
する場合に必要です。 使用できる値: Azure Resource Manager
、Kubernetes Service Connection
、None
。 既定値: Azure Resource Manager
.
接続の種類を指定します。
-
Kubernetes Service Connection
-kubeconfig
または Azure サービス アカウントを使用して任意の Kubernetes クラスターに接続するKubernetes Service Connection
を指定します。 KubeConfig ファイルを指定したり、サービス アカウントを指定したり、Azure サブスクリプション オプションを使用して AKS インスタンスをインポートしたりできます。 Azure サブスクリプション オプションを使用して AKS インスタンスをインポートするには、サービス接続の構成時に Kubernetes クラスターにアクセスする必要があります。 -
Azure Resource Manager
- Azure サービス接続を使用して Azure Kubernetes Service に接続するAzure Resource Manager
を指定します。 サービス接続の構成時に Kubernetes クラスターにアクセスしません。 -
None
- ローカルに格納されている事前に作成された Kubernetes 構成を使用します。
詳細については、次の「解説」セクションの「サービス接続」を参照してください。
Azure サブスクリプション を
入力エイリアス: azureSubscriptionEndpoint
。
string
.
connectionType = Azure Resource Manager && command != logout && command != package && command != save
する場合に必要です。
Azure サービス接続の名前。 コンテナー レジストリを持つ Azure サブスクリプションを指定します。
Azure サブスクリプション を
入力エイリアス: azureSubscriptionEndpoint
。
string
.
connectionType = Azure Resource Manager && command != logout && command != package
する場合に必要です。
Azure サービス接続の名前。 コンテナー レジストリを持つ Azure サブスクリプションを指定します。
azureResourceGroup
-
リソース グループの
string
.
connectionType = Azure Resource Manager && command != logout && command != package && command != save
する場合に必要です。
サブスクリプション内のリソース グループの名前。 Azure リソース グループを指定します。
azureResourceGroup
-
リソース グループの
string
.
connectionType = Azure Resource Manager && command != logout && command != package
する場合に必要です。
サブスクリプション内のリソース グループの名前。 Azure リソース グループを指定します。
Kubernetes クラスターの kubernetesCluster
-
string
.
connectionType = Azure Resource Manager && command != logout && command != package && command != save
する場合に必要です。
AKS クラスターの名前。 Azure マネージド クラスターを指定します。
Kubernetes クラスターの kubernetesCluster
-
string
.
connectionType = Azure Resource Manager && command != logout && command != package
する場合に必要です。
AKS クラスターの名前。 Azure マネージド クラスターを指定します。
useClusterAdmin
-
クラスター管理者の資格情報を使用する
boolean
. 任意
connectionType = Azure Resource Manager && command != logout && command != package && command != save
するときに使用します。 既定値: false
.
既定のクラスター ユーザー資格情報ではなく、クラスター管理者の資格情報を使用します。
useClusterAdmin
-
クラスター管理者の資格情報を使用する
boolean
. 任意
connectionType = Azure Resource Manager && command != logout && command != package
するときに使用します。 既定値: false
.
既定のクラスター ユーザー資格情報ではなく、クラスター管理者の資格情報を使用します。
Kubernetes Service 接続の kubernetesServiceConnection
-
入力エイリアス: kubernetesServiceEndpoint
。
string
.
connectionType = Kubernetes Service Connection && command != logout && command != package && command != save
する場合に必要です。
Kubernetes サービス接続を指定します。
Kubernetes Service 接続の kubernetesServiceConnection
-
入力エイリアス: kubernetesServiceEndpoint
。
string
.
connectionType = Kubernetes Service Connection && command != logout && command != package
する場合に必要です。
Kubernetes サービス接続を指定します。
namespace
-
名前空間の
string
. 任意
command != logout && command != package && command != save
するときに使用します。
kubectl
コマンドを実行する名前空間。 指定しない場合、タスクは既定の名前空間を使用します。 使用する Kubernetes 名前空間を指定します。 タスクの詳細セクションで Tiller 名前空間を指定するか、引数として --tiller-namespace
オプションを渡します。
namespace
-
名前空間の
string
. 任意
command != logout && command != package
するときに使用します。
kubectl
コマンドを実行する名前空間。 指定しない場合、タスクは既定の名前空間を使用します。 使用する Kubernetes 名前空間を指定します。 タスクの詳細セクションで Tiller 名前空間を指定するか、引数として --tiller-namespace
オプションを渡します。
Container Registryの Azure サブスクリプションを azureSubscriptionForACR
- する
入力エイリアス: azureSubscriptionEndpointForACR
。
string
.
command == save
する場合に必要です。
Azure Container Registry を持つ Azure サブスクリプションを指定します。
azureResourceGroupForACR
-
リソース グループの
string
.
command == save
する場合に必要です。
コンテナー レジストリを持つ Azure リソース グループを指定します。
Azure Container Registryを azureContainerRegistry
- する
string
.
command == save
する場合に必要です。
Helm チャートのプッシュに使用する Azure Container Registry を指定します。
command
-
コマンド
string
. 必須。 使用できる値: create
, delete
, expose
, get
, init
, install
, login
, logout
, ls
, package
, rollback
, save
, upgrade
, uninstall
. 既定値: ls
.
Helm コマンドを指定します。
command
-
コマンド
string
. 必須。 使用できる値: create
, delete
, expose
, get
, init
, install
, login
, logout
, ls
, package
, rollback
, save
, upgrade
. 既定値: ls
.
Helm コマンドを指定します。
command
-
コマンド
string
. 必須。 使用できる値: create
、delete
、expose
、get
、init
、install
、login
、logout
、ls
、package
、rollback
、upgrade
。 既定値: ls
.
Helm コマンドを指定します。
chartType
-
グラフの種類の
string
.
command == install || command == upgrade
する場合に必要です。 使用できる値: Name
、FilePath
(ファイル パス)。 既定値: Name
.
グラフ情報の入力方法を指定します。 グラフの名前またはグラフのフォルダー/ファイル パスを指定できます。
グラフ名を chartName
- する
string
.
chartType == Name
する場合に必要です。
インストールするグラフ参照の名前。 URL またはグラフ名を指定できます。 たとえば、グラフ名が stable/mysql
されている場合、タスクは helm install stable/mysql
実行されます。
グラフ パスの chartPath
-
string
.
chartType == FilePath || command == package
する場合に必要です。
インストールするグラフへのパス。 パッケージ化されたグラフへのパス、またはアンパックされたグラフ ディレクトリへのパスを指定できます。 たとえば、./redis
を指定すると、タスクは helm install ./redis
実行されます。 成果物として発行されたグラフを使用している場合、パスは $(System.DefaultWorkingDirectory)/ARTIFACT-NAME/Charts/CHART-NAME
されます。
chartVersion
-
バージョン
入力エイリアス: version
。
string
. 任意
command == package || command == install || command == upgrade
するときに使用します。
インストールするグラフの正確なバージョンを指定します。 グラフのバージョンを指定しない場合、タスクは最新バージョンをインストールします。 グラフのバージョンをこの semver バージョンに設定します。
chartVersion
-
バージョン
入力エイリアス: version
。
string
. 任意
command == package
するときに使用します。
インストールするグラフの正確なバージョンを指定します。 グラフのバージョンを指定しない場合、タスクは最新バージョンをインストールします。 グラフのバージョンをこの semver バージョンに設定します。
releaseName
-
リリース名の
string
. 任意
command == install || command == upgrade
するときに使用します。
リリース名。 リリース名を指定しないと、タスクによって自動生成されます。
releaseName
入力は、install
コマンドと upgrade
コマンドでのみ有効です。
overrideValues
-
値の設定
string
. 任意
command == install || command == upgrade
するときに使用します。
コマンド ラインの値を指定します。 この入力では、複数または個別の値をコンマで指定できます: key1=val1,key2=val2
。
次のように、複数の値を新しい行で区切って指定することもできます。
- key1=val1
- key2=val2
新しい行を含む値がある場合は、valueFile
オプションを使用します。 それ以外の場合、タスクは新しい行を区切り記号として扱います。 タスクは、これらの設定値を使用して Helm コマンドを構築します。 たとえば、次のようなコマンドを使用して値を設定できます:helm install --set key1=val1 ./redis
。
valueFile
-
値ファイルの
string
. 任意
command == install || command == upgrade
するときに使用します。
YAML ファイルまたは URL の値を指定します。 たとえば、myvalues.yaml
を指定すると、helm install --values=myvals.yaml
になります。
destination
-
Destination
string
. 任意
command == package
するときに使用します。 既定値: $(Build.ArtifactStagingDirectory)
.
YAML ファイルまたは URL の値を指定します。
canaryimage
-
カナリア イメージ バージョンを使用します。
boolean
. 任意
command == init
するときに使用します。 既定値: false
.
カナリア ティラー イメージを指定します。 Tiller の最新のプレリリース バージョンを使用します。
ティラーをアップグレードする upgradetiller
-
boolean
. 任意
command == init
するときに使用します。 既定値: true
.
true
場合、Tiller が既にインストールされている場合は、この入力によって Tiller がアップグレードされます。
依存関係の更新の updatedependency
-
boolean
. 任意
command == install || command == package
するときに使用します。 既定値: false
.
true
場合、この入力により、グラフをインストールする前に Helm 依存関係の更新が更新されます。 パッケージ化する前に、依存関係を requirements.yaml
から charts/
ディレクトリに更新します。
save
-
保存
boolean
. 任意
command == package
するときに使用します。 既定値: true
.
true
に設定すると、パッケージ化されたグラフをローカル グラフ リポジトリに保存します。
install
-
リリースが存在しない場合はインストールします。
boolean
. 任意
command == upgrade
するときに使用します。 既定値: true
.
この名前のリリースがまだ存在しない場合、この入力によってインストールが実行されます。
recreate
-
ポッドを再作成します。
boolean
. 任意
command == upgrade
するときに使用します。 既定値: false
.
必要に応じて、リソースのポッドの再起動を実行します。
値のリセットを resetValues
- します。
boolean
. 任意
command == upgrade
するときに使用します。 既定値: false
.
グラフに組み込まれている値に値をリセットします。
force
-
強制
boolean
. 任意
command == upgrade
するときに使用します。 既定値: false
.
必要に応じて、削除または再作成アクションを使用してリソースの更新を強制します。
waitForExecution
-
wait
boolean
. 任意
command == init || command == install || command == upgrade
するときに使用します。 既定値: true
.
コマンドの実行が完了するまでアクションをブロックします。
arguments
-
引数
string
. 任意
command != login && command != logout
するときに使用します。
Helm コマンド オプション。
TLSを有効にする enableTls
-
boolean
. 任意
command != login && command != logout && command != package && command != save
するときに使用します。 既定値: false
.
Helm と Tiller の間で SSL を使用できるようにします。
TLSを有効にする enableTls
-
boolean
. 任意
command != login && command != logout && command != package
するときに使用します。 既定値: false
.
Helm と Tiller の間で SSL を使用できるようにします。
CA 証明書を caCert
- する
string
.
enableTls == true && command != login && command != logout && command != package && command != save
する場合に必要です。
Tiller および Helm クライアントの証明書を発行するために使用される CA 証明書。
CA 証明書を caCert
- する
string
.
enableTls == true && command != login && command != logout && command != package
する場合に必要です。
Tiller および Helm クライアントの証明書を発行するために使用される CA 証明書。
証明書の certificate
-
string
.
enableTls == true && command != login && command != logout && command != package && command != save
する場合に必要です。
Tiller 証明書または Helm クライアント証明書を指定します。
証明書の certificate
-
string
.
enableTls == true && command != login && command != logout && command != package
する場合に必要です。
Tiller 証明書または Helm クライアント証明書を指定します。
privatekey
-
キーの
string
.
enableTls == true && command != login && command != logout && command != package && command != save
する場合に必要です。
Tiller キーまたは Helm クライアント キーを指定します。
privatekey
-
キーの
string
.
enableTls == true && command != login && command != logout && command != package
する場合に必要です。
Tiller キーまたは Helm クライアント キーを指定します。
Tiller 名前空間を tillernamespace
- する
string
. 任意
command != login && command != logout && command != package && command != save
するときに使用します。
Tiller の Kubernetes 名前空間を指定します。
Tiller 名前空間を tillernamespace
- する
string
. 任意
command != login && command != logout && command != package
するときに使用します。
Tiller の Kubernetes 名前空間を指定します。
標準エラーで失敗する failOnStderr
-
boolean
. 任意
command != login && command != logout && command != package && command != save
するときに使用します。 既定値: false
.
この入力が true
場合、エラーがエラー パイプラインに書き込まれた場合、または標準エラー ストリームにデータが書き込まれた場合、このタスクは失敗します。 それ以外の場合、タスクは終了コードに依存してエラーを判断します。
標準エラーで失敗する failOnStderr
-
boolean
. 任意
command != login && command != logout && command != package
するときに使用します。 既定値: true
.
この入力が true
場合、エラーがエラー パイプラインに書き込まれた場合、または標準エラー ストリームにデータが書き込まれた場合、このタスクは失敗します。 それ以外の場合、タスクは終了コードに依存してエラーを判断します。
publishPipelineMetadata
-
パイプライン メタデータ を発行する
boolean
. 任意
command != login && command != logout && command != package && command != save
するときに使用します。 既定値: true
.
この入力が true
されている場合、タスクはデプロイ メタデータを収集して発行します。
Azure Container Registryのグラフ名の chartNameForACR
-
string
.
command == save
する場合に必要です。
Azure Container Registry のグラフの名前。
chartPathForACR
-
Azure Container Registry のグラフ パス
string
.
command == save
する場合に必要です。
Azure Container Registry のグラフ ディレクトリへのファイル パス。
タスク コントロールのオプション
すべてのタスクには、タスク入力に加えて制御オプションがあります。 詳細については、「コントロール オプションと一般的なタスク プロパティを参照してください。
出力変数
このタスクでは、次の 出力変数を定義します。この変数は、ダウンストリームのステップ、ジョブ、およびステージで使用できます。
helmExitCode
指定した Helm コマンドの実行から出力される終了コード。
helmOutput
指定した Helm コマンドの実行から出力される出力。
注釈
HelmDeploy@0を使用して、Helm コマンドを実行して、Azure Container Service で Kubernetes クラスターをデプロイ、構成、または更新します。 Helm は、グラフと呼ばれるパッケージ形式を使用して Kubernetes アプリのデプロイと管理を効率化するツールです。
Helm を使用すると、最も複雑な Kubernetes アプリを定義、バージョン管理、共有、インストール、アップグレードできます。
- Helm は、サービス、デプロイ、構成マップなどの複数の Kubernetes マニフェスト (yaml) を Helm Charts と呼ばれる 1 つのユニットに結合するのに役立ちます。 トークン化またはテンプレート ツールを発明または使用する必要はありません。
- Helm Chart を使用すると、アプリケーションの依存関係を管理したり、ユニットとしてロールバックしたりするのに役立ちます。 また、作成、バージョン管理、公開、他のパートナー チームとの共有も簡単です。
Azure Pipelines には、Helm チャートのサポートが組み込まれています。
- Helm Tool インストーラー タスク を使用して、エージェントに正しいバージョンの Helm をインストールできます。
- Helm パッケージとデプロイ タスクを使用して、アプリをパッケージ化し、Kubernetes クラスターにデプロイできます。 このタスクを使用すると、Tiller を Kubernetes 名前空間にインストールまたは更新したり、グラフをデプロイするために TLS 経由で Tiller に安全に接続したり、lint などの Helm コマンド実行したりできます。
- Helm タスクでは、Azure サービス接続を使用した Azure Kubernetes Service への接続がサポートされます。 kubeconfig またはサービス アカウント 使用して、任意の Kubernetes クラスターに接続できます。
- Helm デプロイは、Kubectl タスクを使用して補足できます。たとえば、作成/更新、imagepullsecret などです。
サービス接続
HelmDeploy@0は、Azure Resource Manager と Kubernetes Service Connection の 2 種類のサービス接続で動作します。 これら 2 つの接続の種類の構成例については、「例 を参照してください。
注
Kubernetes クラスターを指す環境リソースがパイプラインのステージで既に指定されている場合、サービス接続は必要ありません。
AKS にアクセスするときの Kubernetes サービス接続に関する考慮事項
次のいずれかのオプションを使用して、Kubernetes サービス接続を作成できます。
- KubeConfig
- サービス アカウント
- Azure サブスクリプション
Azure サブスクリプション オプションを選択する場合、サービス接続構成時に Azure DevOps から Kubernetes にアクセスできる必要があります。 サービス接続を作成できない理由はさまざまです。たとえば、プライベート クラスター を作成 場合や、クラスター ローカル アカウントが無効になっている場合などです。 このような場合、Azure DevOps はサービス接続の構成時にクラスターに接続できないため、名前空間の読み込み 画面が表示されます。
Kubernetes 1.24 以降では、有効期間の長いトークンは既定で作成 。 Kubernetes では、有効期間の長いトークンを使用しないことをお勧めします。 その結果、Azure サブスクリプション オプションで作成された Kubernetes サービス接続を使用するタスクは、認証に必要な永続的なトークンにアクセスできないため、Kubernetes クラスターにアクセスできません。 これにより、固定された 名前空間の読み込み ダイアログも表示されます。
Azure Resource Manager サービス接続を使用して AKS にアクセスする
AKS のお客様の場合、Azure Resource Manager サービス接続の種類は、プライベート クラスターまたはローカル アカウントが無効になっているクラスターに接続するための最適な方法を提供します。 この方法は、サービス接続の作成時にクラスター接続に依存しません。 AKS へのアクセスはパイプライン ランタイムに遅延されます。次の利点があります。
- (プライベート) AKS クラスターへのアクセスは、セルフホステッド エージェントまたはスケール セット エージェントからクラスターへの視線で実行できます。
- トークンは、Azure Resource Manager サービス接続を使用するすべてのタスクに対して作成されます。 これにより、有効期間の短いトークンを使用して Kubernetes に接続できるようになります。これは、Kubernetes の推奨事項です。
- ローカル アカウントが無効になっている場合でも、AKS にアクセスできます。
サービス接続に関する FAQ
次のエラー メッセージが表示されます。サービス アカウントに関連付けられているシークレットが見つかりませんでした。 どうしたんですか。
Azure サブスクリプションオプションで Kubernetes サービス接続を使用している。 このメソッドを更新して、有効期間の長いトークンを作成します。 これは、5 月中旬に利用可能になる予定です。 ただし、Kubernetes ガイダンス に従って、有効期間の長いトークンは使用せず、Azure サービス接続の種類使用しないことをお勧めします。
AKS を使用していて、何も変更したくない場合、Kubernetes サービス接続でタスクを引き続き使用できますか?
このメソッドを更新して、有効期間の長いトークンを作成します。 これは、5 月中旬に利用可能になる予定です。 ただし、このアプローチは Kubernetes ガイダンス に対する方法であることに注意してください。
Kubernetes タスクと Kubernetes サービス接続を使用していますが、AKS は使用していません。 私は心配する必要がありますか?
タスクは引き続き以前と同様に動作します。
Kubernetes サービスの接続の種類は削除されますか?
Kubernetes タスクは、実行されている場所に関係なく、任意の Kubernetes クラスターで動作します。 Kubernetes サービス接続は引き続き存在します。
私はAKSの顧客であり、すべてが正常に動作している、私は行動する必要がありますか?
何も変更する必要はありません。 作成中に Kubernetes サービス接続を使用し、選択した Azure サブスクリプションを使用している場合は、有効期間の長いトークンの使用に関する kubernetes のガイダンスに注意する必要があります。
Kubernetes 環境を作成しており、サービス接続を使用するオプションはありません
環境の作成時に AKS にアクセスできない場合は、空の環境を使用し、connectionType
入力を Azure Resource Manager サービス接続に設定できます。
Azure Active Directory RBAC を使用して AKS を構成しましたが、パイプラインが機能しません。 これらの更新プログラムによって解決されますか?
AAD RBAC が有効になっているときに Kubernetes にアクセスすることは、トークンの作成とは関係ありません。 対話型プロンプトを回避するために、今後の更新プログラムで kubelogin サポートします。
コマンド値
コマンド入力は、helm コマンドのいずれかを受け入れます。create/delete/expose/get/init/install/login/logout/ls/package/rollback/upgrade。 例は、「の例」セクションに記載されています。
各コマンド入力は、一連のタスク入力にマップされます。 タスク入力にマップされるコマンドは、YAML 構文ブロックとタスク入力テーブルで指定されます。
トラブルシューティング
HelmDeploy タスクは、Helm 3.0.2 バージョンで 'helm init --wait --client-only' を実行しているときにエラー 'unknown flag: --wait' をスローします。
Helm 2 と Helm 3 の間には、いくつかの破壊的変更があります。 そのうちの 1 つに tiller の削除が含まれるため、helm init
コマンドはサポートされなくなりました。 Remove command: init when you use Helm 3.0+ versions.
Helm 3 を使用する場合、System.debug が true に設定され、Helm アップグレードが使用されているコマンドである場合、アップグレードが成功した場合でもパイプラインは失敗します。
これは、いくつかのログを stderr に書き込むため、Helm 3 の既知の問題です。 stderr へのログがある場合、または終了コードが 0 以外の場合、Helm デプロイ タスクは失敗としてマークされます。 stderr に出力されたログを無視する場合は、タスク入力 failOnStderr: false を設定します。
例示
Azure Resource Manager
この YAML の例は、Azure Resource Manager を使用して Kubernetes クラスターを参照する方法を示しています。 これは、helm コマンド の 1 つと、コマンドに必要な適切な値と共に使用されます。
variables:
azureSubscriptionEndpoint: Contoso
azureContainerRegistry: contoso.azurecr.io
azureResourceGroup: Contoso
kubernetesCluster: Contoso
- task: HelmDeploy@0
displayName: Helm deploy
inputs:
connectionType: Azure Resource Manager
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureResourceGroup: $(azureResourceGroup)
kubernetesCluster: $(kubernetesCluster)
Kubernetes サービス接続
この YAML の例は、Kubernetes サービス接続を使用して Kubernetes クラスターを参照する方法を示しています。 これは、helm コマンド の 1 つと、コマンドに必要な適切な値と共に使用されます。
- task: HelmDeploy@0
displayName: Helm deploy
inputs:
connectionType: Kubernetes Service Connection
kubernetesServiceEndpoint: Contoso
コマンド
コマンド入力は、helm コマンドのいずれかを受け入れます。create/delete/expose/get/init/install/login/logout/ls/package/rollback/upgrade。
この YAML の例では、ls コマンドを示します。
- task: HelmDeploy@0
displayName: Helm list
inputs:
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureResourceGroup: $(azureResourceGroup)
kubernetesCluster: $(kubernetesCluster)
command: ls
arguments: --all
init コマンド
この YAML の例では、init コマンドを示します。
- task: HelmDeploy@0
displayName: Helm init
inputs:
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureResourceGroup: $(azureResourceGroup)
kubernetesCluster: $(kubernetesCluster)
command: init
upgradetiller: true
waitForExecution: true
arguments: --client-only
install コマンド
この YAML の例では、install コマンドを示します。
- task: HelmDeploy@0
displayName: Helm install
inputs:
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureResourceGroup: $(azureResourceGroup)
kubernetesCluster: $(kubernetesCluster)
command: install
chartType: FilePath
chartPath: Application/charts/sampleapp
package コマンド
この YAML の例では、パッケージ コマンドを示します。
- task: HelmDeploy@0
displayName: Helm package
inputs:
command: package
chartPath: Application/charts/sampleapp
destination: $(Build.ArtifactStagingDirectory)
upgrade コマンド
この YAML の例では、upgrade コマンドを示します。
- task: HelmDeploy@0
displayName: Helm upgrade
inputs:
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureResourceGroup: $(azureResourceGroup)
kubernetesCluster: $(kubernetesCluster)
command: upgrade
chartType: filepath
chartPath: $(Build.ArtifactStagingDirectory)/sampleapp-v0.2.0.tgz
releaseName: azuredevopsdemo
install: true
waitForExecution: false
save コマンド
この YAML の例では、save コマンドを示します。
- task: HelmDeploy@0
displayName: Helm save
inputs:
command: save
chartNameForACR: mycontainerregistry.azurecr.io/helm/hello-world:v1
chartPathForACR: Application/charts/sampleapp
azureSubscriptionEndpointForACR: $(azureSubscriptionEndpointForACR)
azureResourceGroupForACR: $(azureResourceGroupForACR)
azureContainerRegistry: $(azureContainerRegistry)
Helm チャートのパッケージ化と署名
このセクションでは、パイプラインで Helm チャートをパッケージ化して署名する方法について説明します。
GPG を使用して Helm チャートに署名する秘密キーと公開キーのペアを生成する
管理者モードでコマンド プロンプトを起動します。 次のコマンドを実行して秘密キーと公開キーのペアを生成し、gpg を使用して Helm チャートに署名します。 キーの作成時に、ユーザー名とメール アドレスの入力を求められます。 "メール アドレスの名前" は、後で作成される秘密キーと公開キーのペアの名前を付けるために使用されます。
gpg --full-generate-key
キーする
パスフレーズの入力を求められます。 値を指定し、[OK] をクリックします。
キーを作成した後、次のコマンドを使用して、プライベートとパブリックの両方を含むキーの一覧を表示できます。
秘密キーの一覧を表示するには
gpg --list-secret-keys
秘密キー
公開キーの一覧を表示するには
gpg --list-keys
公開キー
次に示すように、拡張子が gpg 、秘密キーと公開キーを 2 つの異なるファイルに格納します。
- 秘密キーの場合
gpg --export-secret-key AA11BB22CC33DD44EE55FF66AA77BB88CC99DD00 contoso@microsoft.com > C:/somepath/privatekeys.gpg
上記のパスにエクスポートされた privatekeys.gpg ファイルが表示されます。
- 公開キーの場合
gpg --export-key AA11BB22CC33DD44EE55FF66AA77BB88CC99DD00 contoso@microsoft.com > C:/somepath/publickey.gpg
上記のパスにエクスポートされた publickey.gpg ファイルが表示されます。
Azure DevOps で、privatekey.gpg ファイルをライブラリに保存 、セキュリティで保護されたファイル セクションに保存します。
例
pool:
name: Hosted Ubuntu 1604
variables:
# The below variable should be secure
HelmKeyPassphrase: contoso@123
keyName: contoso contoso@microsoft.com
azureSubscriptionEndpoint: contoso
azureResourceGroup: contoso
kubernetesCluster: contoso
steps:
- task: DownloadSecureFile@1
displayName: Download Secure file
inputs:
secureFile: privatekey.gpg
name: privateKeyRing
- task: HelmInstaller@0
displayName: Install Helm 2.12.0
inputs:
helmVersion: 2.12.0
- task: HelmDeploy@0
displayName: helm init
inputs:
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureResourceGroup: $(azureResourceGroup)
kubernetesCluster: $(kubernetesCluster)
command: init
arguments: --client-only
- task: HelmDeploy@0
displayName: helm package
inputs:
command: package
chartPath: Application/charts/sampleapp
arguments: --sign --key "$(keyName)" --keyring $(privateKeyRing.secureFilePath)
env:
HelmKeyPassphrase: $(HelmKeyPassphrase)