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

The network stanza is not documented in resources #8785

Closed
remilapeyre opened this issue Aug 29, 2020 · 9 comments
Closed

The network stanza is not documented in resources #8785

remilapeyre opened this issue Aug 29, 2020 · 9 comments
Labels
stage/duplicate theme/docs Documentation issues and enhancements type/bug

Comments

@remilapeyre
Copy link
Contributor

The output of nomad job init -short is:

job "example" {
  datacenters = ["dc1"]

  group "cache" {
    task "redis" {
      driver = "docker"

      config {
        image = "redis:3.2"

        port_map {
          db = 6379
        }
      }

      resources {
        cpu    = 500
        memory = 256

        network {
          mbits = 10
          port "db" {}
        }
      }
    }
  }
}

with a network stanza in job > group > task > resources but it is not documented at https://www.nomadproject.io/docs/job-specification/resources.

@remilapeyre
Copy link
Contributor Author

Also in the documentation for the network stanza the mbits attribute is not documented.

@remilapeyre
Copy link
Contributor Author

volume_mount is also not in https://www.nomadproject.io/docs/job-specification/task, and I think it's missing restart too but I've not tried to use it in a task yet.

@notnoop
Copy link
Contributor

notnoop commented Aug 31, 2020

Hi @remilapeyre ! Very sorry for the confusion here. We will update the sample docs.

FWIW, network under task > resources as well as mbits are being deprecated - but our documentation is a bit confusing there, as we didn't update all the locations they appear in. We will clarify that. Thanks for raising.

@notnoop notnoop added theme/docs Documentation issues and enhancements type/bug stage/duplicate labels Aug 31, 2020
@Legogris
Copy link

Legogris commented Sep 2, 2020

@notnoop I can't find if there's a repo for learn.hashicorp.com (or a proper place to report that) but I noticed there's a good amount of guides and examples there explicitly relying on now deprecated (but without runtime warnings or errors to that end) behavior or configuration.

@shantanugadgil
Copy link
Contributor

shantanugadgil commented Sep 22, 2020

given that the network inside resources is being deprecated, what would be the right way to be able to allocate a single job to any node?

Assuming that I can force set the network_speed of all my worker nodes to say 1000, what can I use to be able to block an entire machine?

Previously I used to do it using mbits = 999 so no other job could get the machine as "free"

@nickethier
Copy link
Member

This was fixed in #8911

@shantanugadgil that is an interesting unintended use of that! I think its also another example that it was not a useful resource from a networking perspective 😅

This usecase is being planned and is currently tracked in #2299

@shantanugadgil
Copy link
Contributor

@nickethier I am confused ... I don't want jobs to land up on any specific node(s).
If I do want specific nodes, I can already achieve it via contraints or meta tags.

All I wanted to do using the network "mbits = 999" thing was to schedule (and allocate) 1-and-only-1 job (i.e. task) onto any node.

@shantanugadgil
Copy link
Contributor

shantanugadgil commented Sep 25, 2020

There was another ugly hack which I had discovered, which was to use a static port for the task, which would cause any other job/task trying to come onto the same node to fail, and eventually go elsewhere (or fail).

I keep mentioning job/task, as for now, all I have is 1-job-1-group-1-task scenario.

@github-actions
Copy link

github-actions bot commented Nov 1, 2022

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 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/duplicate theme/docs Documentation issues and enhancements type/bug
Projects
None yet
Development

No branches or pull requests

5 participants