Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to connect stanza get ignored on job re-run #6459

Closed
shoenig opened this issue Oct 9, 2019 · 1 comment
Closed

Changes to connect stanza get ignored on job re-run #6459

shoenig opened this issue Oct 9, 2019 · 1 comment
Assignees
Labels
theme/consul/connect Consul Connect integration type/bug
Milestone

Comments

@shoenig
Copy link
Member

shoenig commented Oct 9, 2019

If for example I have a job.nomad file with a consul connect stanza defined like,

connect {
  sidecar_service {
    proxy {
      upstreams {
        destination_name = "count-api"
        local_bind_port = 8080
      }
    }
  }
}

and then modify something like the local_bind_port to be something different,

local_bind_port = 8888

and then re-run the job.nomad job,

nomad job run job.nomad

I'd expect to see the change get applied, but nothing happens (the container is left as-is), e.g.

$ docker inspect dashboard-7dd35aec-30e4-e412-314b-5310be43ff4a | jq -r .[0].Config.Env[] | grep NOMAD_UPSTREAM
NOMAD_UPSTREAM_ADDR_count-api=127.0.0.1:8080
NOMAD_UPSTREAM_ADDR_count_api=127.0.0.1:8080
NOMAD_UPSTREAM_IP_count-api=127.0.0.1
NOMAD_UPSTREAM_IP_count_api=127.0.0.1
NOMAD_UPSTREAM_PORT_count-api=8080
NOMAD_UPSTREAM_PORT_count_api=8080

On the other hand, issuing a job stop and job run destroys everything and creates the new job with the changes as expected.

From the logs, it seems the change gets ignored

    2019-10-09T18:04:05.880Z [DEBUG] worker.service_sched: reconciled current state with desired state: eval_id=ab10fcba-c7c2-7ece-6c88-69aac89fef49 job_id=myjob namespace=default results="Total changes: (place 0) (destructive 0) (inplace 2) (stop 0)
Created Deployment: "c5278f31-e75e-16e6-0799-68f15ea0de2f"
Desired Changes for "dashboard": (place 0) (inplace 1) (destructive 0) (stop 0) (migrate 0) (ignore 0) (canary 0)
Desired Changes for "api": (place 0) (inplace 1) (destructive 0) (stop 0) (migrate 0) (ignore 0) (canary 0)"
...
    2019-10-09T18:04:17.389Z [DEBUG] worker.service_sched: reconciled current state with desired state: eval_id=c5a395e0-d516-68b9-e75f-5084809e359c job_id=myjob namespace=default results="Total changes: (place 0) (destructive 0) (inplace 0) (stop 0)
Deployment Update for ID "c5278f31-e75e-16e6-0799-68f15ea0de2f": Status "successful"; Description "Deployment completed successfully"
Desired Changes for "api": (place 0) (inplace 0) (destructive 0) (stop 0) (migrate 0) (ignore 1) (canary 0)
Desired Changes for "dashboard": (place 0) (inplace 0) (destructive 0) (stop 0) (migrate 0) (ignore 1) (canary 0)"
@shoenig shoenig added the theme/consul/connect Consul Connect integration label Oct 9, 2019
@shoenig shoenig added this to the 0.10.1 milestone Oct 9, 2019
@shoenig shoenig self-assigned this Oct 11, 2019
@schmichael schmichael modified the milestones: 0.10.1, 0.10.2 Nov 5, 2019
@shoenig shoenig modified the milestones: 0.10.2, 0.10.3 Nov 20, 2019
@shoenig shoenig modified the milestones: 0.10.4, 0.11.0 Feb 13, 2020
shoenig added a commit that referenced this issue Feb 19, 2020
Fix a bug where consul service definitions would not be updated if changes
were made to the service in the Nomad job. Currently this only fixes the
bug for cases where the fix is a matter of updating consul agent's service
registration. There is related bug where destructive changes are required
(see #6877) which will be fixed in another PR.

The enable_tag_override configuration setting for the parent service is
applied to the sidecar service.

Fixes #6459
shoenig added a commit that referenced this issue Mar 20, 2020
shoenig added a commit that referenced this issue Mar 30, 2020
shoenig added a commit that referenced this issue Mar 30, 2020
josemaia added a commit to josemaia/nomad that referenced this issue Oct 20, 2020
Issue hashicorp#6459 has been fixed for a while, but the docs still point to it as a limitation
fredrikhgrelland pushed a commit to fredrikhgrelland/nomad that referenced this issue Oct 22, 2020
Issue hashicorp#6459 has been fixed for a while, but the docs still point to it as a limitation
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/consul/connect Consul Connect integration type/bug
Projects
None yet
Development

No branches or pull requests

2 participants