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
  • Ingress
  • TrafficTarget
Edit on GitHub
Export as PDF
  1. Documentation
  2. Lab reference
  3. Sandbox
  4. Networking

Ingress

Ingress

The ingress resource allows you to expose services in Kubernetes and Nomad tasks to the local machine.

It also allows you to expose applications that are running to the local machine to a Kubernetes or Nomad cluster.


resource "ingress" "name" {
  ...
}

Attributes

Attribute
Description

Port port required type: int

If the application to be exposed exists on the target then this is the port that will be opened on the local machine that will direct traffic to the remote service.

If the application exists on the local machine then this is the port where the application is running.

The target for the ingress.

ExposeLocal expose_local type: bool

If set to true a service running on the local machine will be exposed to the target cluster. If `false` then a service running on the target cluster will be exposed to the local machine.

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.

IngressID ingress_id type: string

The unique identifier for the created ingress.

LocalAddress local_address type: string

The full address where the exposed application can be reached from the local network.

Generally this is the local ip address of the machine running Jumppad and the port where the application is exposed.

RemoteAddress remote_address type: string

The address of the exposed service as it would be reachable from the target cluster.

This is generally a kubernetes service reference and port or for Nomad a reachable IP address and port.


TrafficTarget

Traffic defines either a source or a destination block for ingress traffic


resource "ingress" "name" {
  target {
    ...
  }
}

Attributes

Attribute
Description

A reference to the nomad_cluster or kubernetes_cluster resource.

Config config required type: map[string]string

The configuration parameters for the ingress, configuration parameters differ depending on the target type.

Port port type: int

The numerical reference for the target service port.

Either port or named_port must be specified.

NamedPort named_port type: string

The string reference for the target service port.

Either port or named_port must be specified.

Computed Attributes

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

PreviousNetworkNextCloud Accounts

Last updated 11 days ago

Target target required type: block

Resource resource required type: Reference to , ,

port = 8080
target {
  resource = resource.k8s_cluster.dev
  port     = 8500

    config = {
    service   = "consul-consul-server"
    namespace = "default"
  }
}
expose_local = true
// 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
resource = resource.k8s_cluster.dev
config {
  service   = "Kubernetes service name"
  namespace = "Kubernetes namespace where the service is deployed"
}
config {
  job   = "Name of the Nomad job"
  group = "Group in the job"
  task  = "Name of the task in the group"
}
port = 8500
named_port = "http"
Cluster
Cluster
Container
TrafficTarget