Helm helm

The helm resource allows Helm charts to be provisioned to k8s_cluster resources.

Properties

  • Name
    cluster
    Type
    (k8s_cluster: )
    Required
    required
    Readonly
    Description

    A reference to a kubernetes clusters to apply the chart to. Jumppad waits until the referenced cluster is healthy before attempting t apply any charts.

    resource "helm" "consul" {
      cluster = resource.k8s_cluster.k3s
    }
    
  • Name
    repository
    Type
    (helm_repository: {})
    Required
    Readonly
    Description

    The details for the Helm chart repository where the chart exists. If this property is not specifed, the chart location is assumed to be either a local directory or Git reference.

  • Name
    chart
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    The name of the chart within the repository, or a souce such as a git repository, URL, or file path where the chart file exist.

  • Name
    version
    Type
    (string: "")
    Required
    Readonly
    Description

    Semver of the chart to install, only used when repository is specified.

  • Name
    values
    Type
    (string: "")
    Required
    Readonly
    Description

    File path to a valid Helm values file to be used when applying the config.

    resource "helm" "mychart" {
      values = "./values.yaml"
    }
    
  • Name
    values_string
    Type
    (map[string]string: map[]{})
    Required
    Readonly
    Description

    Map containing helm values to apply with the chart.

    resource "helm" "mychart" {
      values_string = {
        "global.storage" = "128Mb"
      }
    }
    
  • Name
    namespace
    Type
    (string: default)
    Required
    Readonly
    Description

    Kubernetes namespace to apply the chart to.

  • Name
    create_namespace
    Type
    (bool: false)
    Required
    Readonly
    Description

    If the namespace does not exist, should the helm resource attempt to create it.

  • Name
    skip_crds
    Type
    (bool: false)
    Required
    Readonly
    Description

    If the chart defines custom resource definitions, should these be ignored.

  • Name
    retry
    Type
    (int: 1)
    Required
    Readonly
    Description

    Enables the ability to retry the installation of a chart.

  • Name
    timeout
    Type
    (string: 300s)
    Required
    Readonly
    Description

    Maximum time the application phase of a chart can run before failing. This duration is different to the health_check that runs after a chart has been applied.

  • Name
    health_check
    Type
    (health_check: {})
    Required
    Readonly
    Description

    Health check to run after installing the chart.

helm_repository

A helm_repository stanza defines the details for a remote helm repository.

  • Name
    name
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    The name of the repository.

  • Name
    url
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    The repository URL.

health_check

A health_check stanza allows the definition of a health check which must pass before the resource is marked as successfully created.

health_check {
  timeout = "60s"
  pods = [
    "component=server,app=consul", 
    "component=client,app=consul"
  ]
}
  • Name
    timeout
    Type
    (duration: )
    Required
    required
    Readonly
    Description

    The maximum duration to wait before marking the health check as failed. Expressed as a Go duration, e.g. 1s = 1 second, 100ms = 100 milliseconds.

  • Name
    pods
    Type
    ([]string: [])
    Required
    required
    Readonly
    Description

    An array of kubernetes selector syntax. The healthcheck ensures that all containers defined by the selector are running before passing the healthcheck.

Meta Properties

In addition to the main properties, all resources have meta properties, such as the id of the resource. To see the list of these properties please see the Meta Properties section in the documentation /docs/resources/meta.

Examples

Install Helm Chart from a Helm Repository

resource "helm" "consul" {
  cluster = resource.k8s_cluster.k3s

  repository {
    name = "hashicorp"
    url  = "https://helm.releases.hashicorp.com"
  }

  chart   = "hashicorp/consul"
  version = "v0.40.0"

  values = "./helm/consul-values.yaml"

  health_check {
    timeout = "240s"
    pods = [
      "component=connect-injector",
      "component=client",
      "component=controller",
      "component=server",
    ]
  }
}

Install Helm Chart from a GitHub Repository

resource "helm" "vault" {
  cluster = resource.k8s_cluster.k3s
  chart = "github.com/hashicorp/vault-helm"

  values_string = {
    "server.dataStorage.size" = "128Mb"
  }
}

Install Helm Chart from a Local Folder

resource "helm" "vault" {
  cluster = resource.k8s_cluster.k3s
  chart   = "./files/helm/vault"

  values_string = {
    "server.dataStorage.size" = "128Mb"
  }
}