hashicorp / hashicorp/nomad

Expose `NOMAD_ENVOY_ADMIN_ADDR_<service>` / `NOMAD_ENVOY_READY_ADDR_<service>` to all tasks in alloc

Open
#28,049 2 comments 0 reactions 0 assignees View on GitHub
hcc/jira stage/needs-discussion theme/consul/connect type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal

Expose `NOMAD_ENVOY_ADMIN_ADDR_` and `NOMAD_ENVOY_READY_ADDR_` to all tasks in alloc. Right now they are only exposed to the connect sidecar task.

### Use-cases

I'm currently dealing with https://github.com/hashicorp/nomad/issues/15709 and trying to implement the proposed workaround. (Adding a ephemeral prestart task that sleeps until envoy is ready).
The proposed workaround requires hardcoding the admin/ready ports to the job file. In my case, I don't know them in advance.
My task groups usually contain multiple tasks and multiple connect sidecar tasks. Some contain a dynamic number of tasks (using dynamic blocks).
So, I'm unable to predict which port is being used.

### Attempted Solutions

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how Nomad injects Connect sidecar environment variables into allocation tasks, focusing on the existing NOMAD_ENVOY_ADMIN_ADDR_ and NOMAD_ENVOY_READY_ADDR_ handling. Verify the behavior with multiple tasks and sidecars, including dynamically defined tasks; done means every task in the allocation receives the appropriate variables without requiring hardcoded ports.

Written by the indexing model from the issue text.

Assessment

Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.