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

Example Redis deployment doesn't work on 1.3.0 without consul #12958

Closed
mr-karan opened this issue May 12, 2022 · 3 comments · Fixed by #13044
Closed

Example Redis deployment doesn't work on 1.3.0 without consul #12958

mr-karan opened this issue May 12, 2022 · 3 comments · Fixed by #13044
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/jobspec theme/service-discovery type/bug
Milestone

Comments

@mr-karan
Copy link
Contributor

mr-karan commented May 12, 2022

Nomad version

Output from nomad version

Nomad v1.3.0 (52e95d64113e01be05d585d8b4c07f6f19efebbc)

Operating system and Environment details

uname -a                         
Linux pop-os 5.17.5-76051705-generic #202204271406~1651504840~22.04~63e51bd SMP PREEMPT Mon May 2 15: x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	Pop
Description:	Pop!_OS 22.04 LTS
Release:	22.04
Codename:	jammy

Issue

The example deployment from nomad init doesn't seem to run anymore on a single node Nomad acting as server+client (and no consul).

Reproduction steps

  1. Save the file as nomad.hcl
datacenter = "dc1"
data_dir   = "/opt/nomad/data"

log_level = "DEBUG"

bind_addr = "0.0.0.0"

server {
  enabled          = true
  bootstrap_expect = 1
}

client {
  enabled = true
}

plugin "docker" {
  config {
    allow_privileged = true
    volumes {
      enabled = true
    }
    extra_labels = ["job_name", "job_id", "task_group_name", "task_name", "namespace", "node_name", "node_id"]
  }
}
  1. Run nomad with:
nomad agent -dev -config=nomad.hcl
  1. Run the example file
nomad init
nomad run example.nomad
  1. Visit the UI for failed alloc

image

Expected Result

As of 1.2.6 until yesterday this worked normally, so it should also continue to work on 1.3.0?

Actual Result

It seems to check whether consul is present on the client or not and errors out with Constraint ${attr.consul.version} semver >= 1.7.0 filtered 1 node

When I go to the client attributes list (at http://localhost:4646/ui/clients/c8927149-1161-f27c-7079-1adce6d56697), I don't see any consul block. Which makes sense because this consul block doesn't exist in the agent config file. The same issue happens even if I run nomad agent -dev so the agent config is not the issue here, I suppose.

Job file (if appropriate)

Same as nomad init

@mr-karan
Copy link
Contributor Author

mr-karan commented May 12, 2022

Ah, my bad. The example file contains a default service stanza without any provider. When I explicitly set provider=nomad, it works as expected. Should we update the default init file ?

@jrasell
Copy link
Member

jrasell commented May 12, 2022

Hi @mr-karan and thanks for raising this.

This is an oversight on my part; Nomad 1.3 adds implicit constraints on task groups that utilise Consul service registration so they only get placed on nodes where Consul has been fingerprinted. I had not account for the non-short example job which includes this block.

I think updating the default file to set the provider to Nomad is the correct choice, however, i'll raise this internally to gather opinions also.

@jrasell jrasell self-assigned this May 12, 2022
@jrasell jrasell added theme/jobspec stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery labels May 12, 2022
@jrasell jrasell added this to Needs Triage in Nomad - Community Issues Triage via automation May 12, 2022
@jrasell jrasell moved this from Needs Triage to In Progress in Nomad - Community Issues Triage May 12, 2022
shoenig added a commit that referenced this issue May 17, 2022
Closes #12927
Closes #12958

This PR updates the version of redis used in our examples from 3.2 to 7.
The old version is very not supported anymore, and we should be setting
a good example by using a supported version.

The long-form example job is now fixed so that the service stanza uses
nomad as the service discovery provider, and so now the job runs without
a requirement of having Consul running and configured.
@shoenig shoenig self-assigned this May 17, 2022
@shoenig shoenig modified the milestones: 1.4.0, 1.3.x May 17, 2022
Nomad - Community Issues Triage automation moved this from In Progress to Done May 17, 2022
@lgfa29 lgfa29 modified the milestones: 1.3.x, 1.3.2 Aug 24, 2022
@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 Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/jobspec theme/service-discovery type/bug
Projects
Development

Successfully merging a pull request may close this issue.

4 participants