kubernetes_endpoints_v1

An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service.

Example Usage

resource "kubernetes_endpoints_v1" "example" {
  metadata {
    name = "terraform-example"
  }

  subset {
    address {
      ip = "10.0.0.4"
    }

    address {
      ip = "10.0.0.5"
    }

    port {
      name     = "http"
      port     = 80
      protocol = "TCP"
    }

    port {
      name     = "https"
      port     = 443
      protocol = "TCP"
    }
  }

  subset {
    address {
      ip = "10.0.1.4"
    }

    address {
      ip = "10.0.1.5"
    }

    port {
      name     = "http"
      port     = 80
      protocol = "TCP"
    }

    port {
      name     = "https"
      port     = 443
      protocol = "TCP"
    }
  }
}

resource "kubernetes_service_v1" "example" {
  metadata {
    name = "${kubernetes_endpoints_v1.example.metadata.0.name}"
  }

  spec {
    port {
      port        = 8080
      target_port = 80
    }

    port {
      port        = 8443
      target_port = 443
    }
  }
}

Argument Reference

The following arguments are supported:

Nested Blocks

metadata

Arguments

Attributes

subset

Arguments

address

Attributes

not_ready_address

Attributes

port

Arguments

Import

An Endpoints resource can be imported using its namespace and name, e.g.

$ terraform import kubernetes_endpoints_v1.example default/terraform-name