ChartArgs

data class ChartArgs(val chart: Output<String>? = null, val dependencyUpdate: Output<Boolean>? = null, val devel: Output<Boolean>? = null, val keyring: Output<AssetOrArchive>? = null, val name: Output<String>? = null, val namespace: Output<String>? = null, val postRenderer: Output<PostRendererArgs>? = null, val repositoryOpts: Output<RepositoryOptsArgs>? = null, val resourcePrefix: Output<String>? = null, val skipAwait: Output<Boolean>? = null, val skipCrds: Output<Boolean>? = null, val valueYamlFiles: Output<List<AssetOrArchive>>? = null, val values: Output<Map<String, Any>>? = null, val verify: Output<Boolean>? = null, val version: Output<String>? = null) : ConvertibleToJava<ChartArgs>

Looking for the Release resource? Please use the /registry/packages/kubernetes/api-docs/helm/v3/release/ for production use cases, and stay tuned for an updated Release resource, coming soon. See also: /blog/kubernetes-chart-v4/ Chart is a component representing a collection of resources described by a Helm Chart. Helm charts are a popular packaging format for Kubernetes applications, and published to registries such as Artifact Hub. Chart does not use Tiller or create a Helm Release; the semantics are equivalent to running helm template --dry-run=server and then using Pulumi to deploy the resulting YAML manifests. This allows you to apply Pulumi Transformations and Pulumi Policies to the Kubernetes resources. You may also want to consider the Release resource as an alternative method for managing helm charts. For more information about the trade-offs between these options, see: Choosing the right Helm resource for your use case.

Chart Resolution

The Helm Chart can be fetched from any source that is accessible to the helm command line. The following variations are supported:

  1. By chart reference with repo prefix: chart: "example/mariadb"

  2. By path to a packaged chart: chart: "./nginx-1.2.3.tgz"

  3. By path to an unpacked chart directory: chart: "./nginx"

  4. By absolute URL: chart: "https://example.com/charts/nginx-1.2.3.tgz"

  5. By chart reference with repo URL: chart: "nginx", repositoryOpts: { repo: "https://example.com/charts/" }

  6. By OCI registry: chart: "oci://example.com/charts/nginx", version: "1.2.3" A chart reference is a convenient way of referencing a chart in a chart repository. When you use a chart reference with a repo prefix (example/mariadb), Pulumi will look in Helm's local configuration for a chart repository named example, and will then look for a chart in that repository whose name is mariadb. It will install the latest stable version of that chart, unless you specify devel to also include development versions (alpha, beta, and release candidate releases), or supply a version number with version. Use the verify and optional keyring inputs to enable Chart verification. By default, Pulumi uses the keyring at $HOME/.gnupg/pubring.gpg. See: Helm Provenance and Integrity.

Chart Values

Values files (values.yaml) may be supplied with the valueYamlFiles input, accepting Pulumi Assets. A map of chart values may also be supplied with the values input, with highest precedence. You're able to use literals, nested maps, Pulumi outputs, and Pulumi assets as values. Assets are automatically opened and converted to a string. Note that the use of expressions (e.g. --set service.type) is not supported.

Chart Dependency Resolution

For unpacked chart directories, Pulumi automatically rebuilds the dependencies if dependencies are missing and a Chart.lock file is present (see: Helm Dependency Build). Use the dependencyUpdate input to have Pulumi update the dependencies (see: Helm Dependency Update).

Templating

The Chart resource renders the templates from your chart and then manages the resources directly with the Pulumi Kubernetes provider. A default namespace is applied based on the namespace input, the provider's configured namespace, and the active Kubernetes context. Use the skipCrds option to skip installing the Custom Resource Definition (CRD) objects located in the chart's crds/ special directory. Use the postRenderer input to pipe the rendered manifest through a post-rendering command.

Resource Ordering

Sometimes resources must be applied in a specific order. For example, a namespace resource must be created before any namespaced resources, or a Custom Resource Definition (CRD) must be pre-installed. Pulumi uses heuristics to determine which order to apply and delete objects within the Chart. Pulumi also waits for each object to be fully reconciled, unless skipAwait is enabled. Pulumi supports the config.kubernetes.io/depends-on annotation to declare an explicit dependency on a given resource. The annotation accepts a list of resource references, delimited by commas. Note that references to resources outside the Chart aren't supported. Resource reference A resource reference is a string that uniquely identifies a resource. It consists of the group, kind, name, and optionally the namespace, delimited by forward slashes. | Resource Scope | Format | | :--------------- | :--------------------------------------------- | | namespace-scoped | <group>/namespaces/<namespace>/<kind>/<name> | | cluster-scoped | <group>/<kind>/<name> | For resources in the “core” group, the empty string is used instead (for example: /namespaces/test/Pod/pod-a).

Example Usage

Local Chart Directory

package generated_program;
import com.pulumi.Pulumi;
import com.pulumi.kubernetes.helm.v4.Chart;
import com.pulumi.kubernetes.helm.v4.ChartArgs;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var nginx = new Chart("nginx", ChartArgs.builder()
.chart("./nginx")
.build());
});
}
}

Repository Chart

package generated_program;
import com.pulumi.Pulumi;
import com.pulumi.kubernetes.helm.v4.Chart;
import com.pulumi.kubernetes.helm.v4.ChartArgs;
import com.pulumi.kubernetes.helm.v4.inputs.RepositoryOptsArgs;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var nginx = new Chart("nginx", ChartArgs.builder()
.chart("nginx")
.repositoryOpts(RepositoryOptsArgs.builder()
.repo("https://charts.bitnami.com/bitnami")
.build())
.build());
});
}
}

OCI Chart

package generated_program;
import com.pulumi.Pulumi;
import com.pulumi.kubernetes.helm.v4.Chart;
import com.pulumi.kubernetes.helm.v4.ChartArgs;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var nginx = new Chart("nginx", ChartArgs.builder()
.chart("oci://registry-1.docker.io/bitnamicharts/nginx")
.version("16.0.7")
.build());
});
}
}

Chart Values

package generated_program;
import java.util.Map;
import com.pulumi.Pulumi;
import com.pulumi.kubernetes.helm.v4.Chart;
import com.pulumi.kubernetes.helm.v4.ChartArgs;
import com.pulumi.kubernetes.helm.v4.inputs.RepositoryOptsArgs;
import com.pulumi.asset.FileAsset;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var nginx = new Chart("nginx", ChartArgs.builder()
.chart("nginx")
.repositoryOpts(RepositoryOptsArgs.builder()
.repo("https://charts.bitnami.com/bitnami")
.build())
.valueYamlFiles(new FileAsset("./values.yaml"))
.values(Map.of(
"service", Map.of(
"type", "ClusterIP"),
"notes", new FileAsset("./notes.txt")))
.build());
});
}
}

Chart Namespace

package generated_program;
import com.pulumi.Pulumi;
import com.pulumi.kubernetes.core.v1.Namespace;
import com.pulumi.kubernetes.core.v1.NamespaceArgs;
import com.pulumi.kubernetes.helm.v4.Chart;
import com.pulumi.kubernetes.helm.v4.ChartArgs;
import com.pulumi.kubernetes.helm.v4.inputs.RepositoryOptsArgs;
import com.pulumi.kubernetes.meta.v1.inputs.ObjectMetaArgs;
import com.pulumi.core.Output;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var ns = new Namespace("nginx", NamespaceArgs.builder()
.metadata(ObjectMetaArgs.builder()
.name("nginx")
.build())
.build());
var nginx = new Chart("nginx", ChartArgs.builder()
.namespace(ns.metadata().apply(m -> Output.of(m.name().get())))
.chart("nginx")
.repositoryOpts(RepositoryOptsArgs.builder()
.repo("https://charts.bitnami.com/bitnami")
.build())
.build());
});
}
}

Constructors

Link copied to clipboard
constructor(chart: Output<String>? = null, dependencyUpdate: Output<Boolean>? = null, devel: Output<Boolean>? = null, keyring: Output<AssetOrArchive>? = null, name: Output<String>? = null, namespace: Output<String>? = null, postRenderer: Output<PostRendererArgs>? = null, repositoryOpts: Output<RepositoryOptsArgs>? = null, resourcePrefix: Output<String>? = null, skipAwait: Output<Boolean>? = null, skipCrds: Output<Boolean>? = null, valueYamlFiles: Output<List<AssetOrArchive>>? = null, values: Output<Map<String, Any>>? = null, verify: Output<Boolean>? = null, version: Output<String>? = null)

Properties

Link copied to clipboard
val chart: Output<String>? = null

Chart name to be installed. A path may be used.

Link copied to clipboard
val dependencyUpdate: Output<Boolean>? = null

Run helm dependency update before installing the chart.

Link copied to clipboard
val devel: Output<Boolean>? = null

Use chart development versions, too. Equivalent to version '>0.0.0-0'. If version is set, this is ignored.

Link copied to clipboard
val keyring: Output<AssetOrArchive>? = null

Location of public keys used for verification. Used only if verify is true

Link copied to clipboard
val name: Output<String>? = null

Release name.

Link copied to clipboard
val namespace: Output<String>? = null

Namespace for the release.

Link copied to clipboard
val postRenderer: Output<PostRendererArgs>? = null

Specification defining the post-renderer to use.

Link copied to clipboard
val repositoryOpts: Output<RepositoryOptsArgs>? = null

Specification defining the Helm chart repository to use.

Link copied to clipboard
val resourcePrefix: Output<String>? = null

An optional prefix for the auto-generated resource names. Example: A resource created with resourcePrefix="foo" would produce a resource named "foo:resourceName".

Link copied to clipboard
val skipAwait: Output<Boolean>? = null

By default, the provider waits until all resources are in a ready state before marking the release as successful. Setting this to true will skip such await logic.

Link copied to clipboard
val skipCrds: Output<Boolean>? = null

If set, no CRDs will be installed. By default, CRDs are installed if not already present.

Link copied to clipboard
val values: Output<Map<String, Any>>? = null

Custom values set for the release.

Link copied to clipboard
val valueYamlFiles: Output<List<AssetOrArchive>>? = null

List of assets (raw yaml files). Content is read and merged with values.

Link copied to clipboard
val verify: Output<Boolean>? = null

Verify the chart's integrity.

Link copied to clipboard
val version: Output<String>? = null

Specify the chart version to install. If this is not specified, the latest version is installed.

Functions

Link copied to clipboard
open override fun toJava(): ChartArgs