import * as pulumi from "@pulumi/pulumi"; import * as yaml from "../../yaml/index"; /** * Chart is a component representing a collection of resources described by an arbitrary Helm * Chart. The Chart can be fetched from any source that is accessible to the `helm` command * line. Values in the `values.yml` file can be overridden using `ChartOpts.values` (equivalent * to `--set` or having multiple `values.yml` files). Objects can be transformed arbitrarily by * supplying callbacks to `ChartOpts.transformations`. * * `Chart` does not use Tiller. The Chart specified is copied and expanded locally; the semantics * are equivalent to running `helm template` and then using Pulumi to manage the resulting YAML * manifests. Any values that would be retrieved in-cluster are assigned fake values, and * none of Tiller's server-side validity testing is executed. * * ## Example Usage * ### Local Chart Directory * * ```typescript * import * as k8s from "@pulumi/kubernetes"; * * const nginxIngress = new k8s.helm.v3.Chart("nginx-ingress", { * path: "./nginx-ingress", * }); * ``` * ### Remote Chart * * ```typescript * import * as k8s from "@pulumi/kubernetes"; * * const nginxIngress = new k8s.helm.v3.Chart("nginx-ingress", { * chart: "nginx-ingress", * version: "1.24.4", * fetchOpts:{ * repo: "https://charts.helm.sh/stable", * }, * }); * ``` * ### Set Chart values * * ```typescript * import * as k8s from "@pulumi/kubernetes"; * * const nginxIngress = new k8s.helm.v3.Chart("nginx-ingress", { * chart: "nginx-ingress", * version: "1.24.4", * fetchOpts:{ * repo: "https://charts.helm.sh/stable", * }, * values: { * controller: { * metrics: { * enabled: true, * } * } * }, * }); * ``` * ### Deploy Chart into Namespace * * ```typescript * import * as k8s from "@pulumi/kubernetes"; * * const nginxIngress = new k8s.helm.v3.Chart("nginx-ingress", { * chart: "nginx-ingress", * version: "1.24.4", * namespace: "test-namespace", * fetchOpts:{ * repo: "https://charts.helm.sh/stable", * }, * }); * ``` * ### Chart with Transformations * * ```typescript * import * as k8s from "@pulumi/kubernetes"; * * const nginxIngress = new k8s.helm.v3.Chart("nginx-ingress", { * chart: "nginx-ingress", * version: "1.24.4", * fetchOpts:{ * repo: "https://charts.helm.sh/stable", * }, * transformations: [ * // Make every service private to the cluster, i.e., turn all services into ClusterIP instead of LoadBalancer. * (obj: any, opts: pulumi.CustomResourceOptions) => { * if (obj.kind === "Service" && obj.apiVersion === "v1") { * if (obj.spec && obj.spec.type && obj.spec.type === "LoadBalancer") { * obj.spec.type = "ClusterIP"; * } * } * }, * * // Set a resource alias for a previous name. * (obj: any, opts: pulumi.CustomResourceOptions) => { * if (obj.kind === "Deployment") { * opts.aliases = [{ name: "oldName" }] * }, * * // Omit a resource from the Chart by transforming the specified resource definition to an empty List. * (obj: any, opts: pulumi.CustomResourceOptions) => { * if (obj.kind === "Pod" && obj.metadata.name === "test") { * obj.apiVersion = "v1" * obj.kind = "List" * }, * ], * }); * ``` */ export declare class Chart extends yaml.CollectionComponentResource { /** * Returns true if the given object is an instance of Chart. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Chart; /** * Create an instance of the specified Helm chart. * @param releaseName Name of the Chart (e.g., nginx-ingress). * @param config Configuration options for the Chart. * @param opts A bag of options that control this resource's behavior. */ constructor(releaseName: string, config: ChartOpts | LocalChartOpts, opts?: pulumi.ComponentResourceOptions); parseChart(config: ChartOpts | LocalChartOpts, releaseName: string, opts?: pulumi.ComponentResourceOptions): pulumi.Output<{ [key: string]: pulumi.CustomResource; }>; } interface BaseChartOpts { /** * The optional kubernetes api versions used for Capabilities.APIVersions. */ apiVersions?: pulumi.Input[]>; /** * By default, Helm resources with the `test`, `test-success`, and `test-failure` hooks are not installed. Set * this flag to true to include these resources. */ includeTestHookResources?: boolean; /** * By default, CRDs are rendered along with Helm chart templates. Setting this to true will skip CRD rendering. */ skipCRDRendering?: boolean; /** * The optional namespace to install chart resources into. */ namespace?: pulumi.Input; /** * By default, the kubernetes version is derived from your k8s context, this allows it to be overridden. * Warning: This option should not be used unless you have a good reason to not use the auto-discovered * version as it is much more bug-prone. */ kubeVersion?: pulumi.Input; /** * Overrides for chart values. */ values?: pulumi.Inputs; /** * A set of transformations to apply to Kubernetes resource definitions before registering * with engine. */ transformations?: ((o: any, opts: pulumi.CustomResourceOptions) => void)[]; /** * An optional prefix for the auto-generated resource names. * Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName". */ resourcePrefix?: string; /** * Skip await logic for all resources in this Chart. Resources will be marked ready as soon as they are created. * Warning: This option should not be used if you have resources depending on Outputs from the Chart. */ skipAwait?: pulumi.Input; } /** * The set of arguments for constructing a Chart resource from a remote source. */ export interface ChartOpts extends BaseChartOpts { /** * The repository name of the chart to deploy. * Example: "stable" */ repo?: pulumi.Input; /** * The name of the chart to deploy. If [repo] is provided, this chart name will be prefixed by the repo name. * Example: repo: "stable", chart: "nginx-ingress" -> "stable/nginx-ingress" * Example: chart: "stable/nginx-ingress" -> "stable/nginx-ingress" */ chart: pulumi.Input; /** * The version of the chart to deploy. If not provided, the latest version will be deployed. */ version?: pulumi.Input; /** * Additional options to customize the fetching of the Helm chart. */ fetchOpts?: pulumi.Input; } /** * The set of arguments for constructing a Chart resource from a local source. */ export interface LocalChartOpts extends BaseChartOpts { /** * The path to the chart directory which contains the `Chart.yaml` file. */ path: string; } /** * Additional options to customize the fetching of the Helm chart. */ export interface FetchOpts { /** Specific version of a chart. Without this, the latest version is fetched. */ version?: pulumi.Input; /** Verify certificates of HTTPS-enabled servers using this CA bundle. */ caFile?: pulumi.Input; /** Identify HTTPS client using this SSL certificate file. */ certFile?: pulumi.Input; /** Identify HTTPS client using this SSL key file. */ keyFile?: pulumi.Input; /** * Location to write the chart. If this and tardir are specified, tardir is appended to this * (default "."). */ destination?: pulumi.Input; /** Keyring containing public keys (default "/Users/alex/.gnupg/pubring.gpg"). */ keyring?: pulumi.Input; /** Chart repository password. */ password?: pulumi.Input; /** Chart repository url where to locate the requested chart. */ repo?: pulumi.Input; /** * If untar is specified, this flag specifies the name of the directory into which the chart is * expanded (default "."). */ untardir?: pulumi.Input; /** Chart repository username. */ username?: pulumi.Input; /** Location of your Helm config. Overrides $HELM_HOME (default "/Users/alex/.helm"). */ home?: pulumi.Input; /** * Use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is * ignored. */ devel?: pulumi.Input; /** Fetch the provenance file, but don't perform verification. */ prov?: pulumi.Input; /** If set to false, will leave the chart as a tarball after downloading. */ untar?: pulumi.Input; /** Verify the package against its signature. */ verify?: pulumi.Input; } export {};