Instruqt Labs (beta)
  • Instruqt
  • Getting started
    • Setting up Version Control
    • Install Instruqt CLI
    • Creating your first lab
    • Configuration basics
    • Exploring the lab configuration
    • Adding your first chapter
    • Configuring sandboxes
    • Adding quizzes
    • Adding tasks and gating content
    • Finishing up
  • Documentation
    • Writing Lab Content
      • Project Structure
      • Markdown and Components
    • Integrations
      • Version Control
    • Lab reference
      • Content
        • Lab
        • Page
        • Activities
          • Task
          • Quiz
            • Multiple Choice
            • Single Choice
            • Text Answer
            • Numeric Answer
        • Layout
        • Tabs
          • Terminal
          • Service
          • Editor
          • External Website
          • Note
      • Sandbox
        • Containers
          • Container
          • Sidecar Container
        • Kubernetes
          • Cluster
          • Config
          • Helm
        • Nomad
          • Cluster
          • Job
        • Networking
          • Network
          • Ingress
        • Cloud Accounts
          • AWS
          • Azure
          • Google Cloud
        • Terraform
        • Template
        • Exec
        • Copy
        • Certificates
          • Root
          • Leaf
        • Random
          • Number
          • ID
          • UUID
          • Password
          • Creature
      • Functions
    • Tools
      • Instruqt CLI
    • Glossary
Powered by GitBook
On this page
  • Config
  • HealthCheckKubernetes
Edit on GitHub
Export as PDF
  1. Documentation
  2. Lab reference
  3. Sandbox
  4. Kubernetes

Config

Config

The kubernetes_config resource allows Kubernetes configuraton to be applied to a kubernetes_cluster.

You can specify a list of paths or individual files and health checks for the resources. A kubernetes_config only completes once the configuration has been successfully applied and any health checks have passed. This allows you to create complex dependencies for your applications.

The system monitors changes to the config defined in the paths property and automatically recreates this resource when the configuration is applied.


resource "kubernetes_config" "name" {
  ...
}

Attributes

Attribute
Description

The reference to a cluster to apply the jobs to. Kubernetes config is only applied when the referenced cluster is created and healthy.

Paths paths required type: []string

Paths to the Kubernetes config files to apply to the cluster.

WaitUntilReady wait_until_ready required type: bool

Determines if the resource waits until all config defined in the paths has been accepted and started by the server. If set to `false` the resource returns immediately after submitting the job.

Optional health check to perform after the jobs have been applied, this resource will not complete until the health checks are passing.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Attribute
Description

Meta ID meta.id string

The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:

Meta Type meta.type string

The type of the resource. This taken from the type label of the resource definition.

Meta Name meta.name string

The name of the resource. This taken from the name label of the resource definition.


HealthCheckKubernetes

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


health_check {
  ...
}

Attributes

Attribute
Description

Timeout timeout required type: string

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.

Pods pods required type: []string

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

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

PreviousClusterNextHelm

Last updated 1 month ago

Cluster cluster required type: Reference to

HealthCheck health_check type: block

cluster = resource.kubernetes_cluster.dev
paths = ["./files/kubernetes", "./k8s/pods.yaml"]
wait_until_ready = true
health_check {
  timeout = "60s"
  pods = [
    "component=server,app=consul",
    "component=client,app=consul"
  ]
}
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting id will be
resource.container.ubuntu
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting type will be
container
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting name will be
ubuntu
timeout = "60s"
pods = ["app.kubernetes.io/name=vault"]
Cluster
HealthCheckKubernetes