nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Add Partition on ConsulUpstream, ConsulTerminatingConfigEntry, ConsulIngressConfigEntry and ConsulIngressService

Open Sol-Stiep opened this issue 2 years ago • 1 comments

Description

Changes

  • Updated ConsulUpstream, ConsulTerminatingConfigEntry, ConsulIngressConfigEntry and ConsulIngressService Structs adding the Partition field.
  • Update related tests
  • Update Nomad Documentation for ConsulUpstream, ConsulTerminatingConfigEntry, ConsulIngressConfigEntry and ConsulIngressService Structs.

Progress

Work completed:

  • Added partition fields at api/consul.go and nomad/structs/services.go, on the following structs:
    • ConsulUpstream
    • ConsulIngressService
    • ConsulTerminatingConfigEntry
    • ConsulIngressConfigEntry
  • Update receiver functions at api/consul.go and nomad/structs/services.go:
    • Copy
    • Equal
  • Update parse and apiConnect on jobspec/parse_service.go and command/agent/job_endpoint.go
  • Update connect and conver functions on command/agent/consul/connect.go and nomad/consul.go
  • Update mdx docs.
  • Apply inherit behavior on partition field for ConsulIngressService:
    • When ConsulIngressService partition is empty, set value from ConsulIngressConfigEntry partition field.

Pending work:

  • We assumed that partition should only be inherited on ConsulIngressService, since is the only struct that have a partition defined in upper levels(ConsulIngressConfigEntry). Is pending if this assumption is correct, or if field value should be inherited in other cases too.
  • Running end-to-end tests. Since partitions are Consul Enterprise fields, we couldn't tested end to end, as we test other values.

Sol-Stiep avatar Apr 03 '23 14:04 Sol-Stiep

@mmcquillan I've been looking at this PR as part of the rest of the Consul API update work, and it's not clear to me this makes sense to for anything other than upstream blocks (which is done in https://github.com/hashicorp/nomad/pull/20167). The way we implemented admin partition support fingerprinting implies that everything originating from a specific Nomad node is associated with a specific Consul agent, which is in exactly one admin partition.

I'll probably circle back to this one after we've completed the remainder of the Consul work for 1.8.0.

tgross avatar Mar 21 '24 15:03 tgross

Implemented in https://github.com/hashicorp/nomad/pull/19665 https://github.com/hashicorp/nomad/pull/20167, and https://github.com/hashicorp/nomad/pull/19665

tgross avatar Jun 04 '24 19:06 tgross