{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/nomad/issues/1987","repository_url":"https://api.github.com/repos/hashicorp/nomad","labels_url":"https://api.github.com/repos/hashicorp/nomad/issues/1987/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/nomad/issues/1987/comments","events_url":"https://api.github.com/repos/hashicorp/nomad/issues/1987/events","html_url":"https://github.com/hashicorp/nomad/issues/1987","id":188964824,"number":1987,"title":"Problem deploying system task","user":{"login":"cetex","id":3268506,"avatar_url":"https://avatars.githubusercontent.com/u/3268506?v=3","gravatar_id":"","url":"https://api.github.com/users/cetex","html_url":"https://github.com/cetex","followers_url":"https://api.github.com/users/cetex/followers","following_url":"https://api.github.com/users/cetex/following{/other_user}","gists_url":"https://api.github.com/users/cetex/gists{/gist_id}","starred_url":"https://api.github.com/users/cetex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cetex/subscriptions","organizations_url":"https://api.github.com/users/cetex/orgs","repos_url":"https://api.github.com/users/cetex/repos","events_url":"https://api.github.com/users/cetex/events{/privacy}","received_events_url":"https://api.github.com/users/cetex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-13T11:14:00Z","updated_at":"2016-11-13T12:18:28Z","closed_at":null,"body":"I'm trying to deploy nginx through nomad as a system task and i'm failing to understand why it doesn't work, maybe i'm just blind or maybe i've seriously misunderstood something..\r\n```\r\njob \"nginx\" {\r\n    datacenters = [\"dc1\", \"dc2\"]\r\n    type = \"system\"\r\n    priority = 50\r\n    constraint {\r\n        attribute = \"${attr.kernel.name}\"\r\n        value = \"linux\"\r\n    }\r\n    constraint {\r\n        attribute = \"${consul.datacenter}\"\r\n        value = \"dc1\"\r\n    }\r\n    # Configure the job to do rolling updates\r\n    update {\r\n        stagger = \"10s\"\r\n        max_parallel = 1\r\n    }\r\n    group \"nginx\" {\r\n        restart {\r\n            attempts = 10\r\n            interval = \"5m\"\r\n            delay = \"25s\"\r\n            mode = \"delay\"\r\n        }\r\n        task \"nginx\" {\r\n            driver = \"docker\"\r\n            config {\r\n                image = \"docker-repo.service.consul:5000/trusty/nginx:latest\"\r\n                network_mode = \"host\"\r\n                interactive = true\r\n                command = \"/launch-nginx.sh\"\r\n                args = []\r\n            }\r\n            env {\r\n                ROLE = \"${ROLE}\"\r\n                HOSTNAME = \"$(hostname)\"\r\n                DATACENTER = \"${DATACENTER}\"\r\n                RACK = \"${RACK}\"\r\n                CLUSTER = \"${CLUSTER}\"\r\n                local_ipv4 = \"${local_ipv4}\"\r\n            }\r\n            service {\r\n                name = \"${TASKGROUP}-nginx\"\r\n                tags = [\"global\", \"nginx\"]\r\n                port = \"http\"\r\n                check {\r\n                    name = \"alive\"\r\n                    type = \"tcp\"\r\n                    interval = \"10s\"\r\n                    timeout = \"2s\"\r\n                }\r\n            }\r\n            resources {\r\n                cpu = 19200 # 20% of 40cores at 2.4Ghz.\r\n                memory = 16000 # 16GB\r\n                network {\r\n                    mbits = 2000\r\n                    port \"http\" {\r\n                        static = \"80\"\r\n                    }\r\n                    port \"https\" {\r\n                        static = \"443\"\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nWhen trying to run it:\r\n```\r\n==> Monitoring evaluation \"2bbb98d3\"\r\n    Evaluation triggered by job \"nginx\"\r\n    Evaluation status changed: \"pending\" -> \"complete\"\r\n==> Evaluation \"2bbb98d3\" finished with status \"complete\" but failed to place all allocations:\r\n    Task Group \"nginx\" (failed to place 22 allocations):\r\n      * Class \"slave\" filtered 1 nodes\r\n      * Constraint \"${consul.datacenter} = dc1\" filtered 1 nodes\r\n```\r\n\r\nI'm trying to deploy this to s01 and s02 in dc1\r\n```\r\n# nomad node-status\r\nID        DC   Name         Class   Drain  Status\r\nea233f64  dc1  s01.dc1      slave   false  ready\r\ne3073141  dc1  s02.dc1      master  false  ready\r\nce565d96  dc2  s17.r13.dc2  slave   false  ready\r\n10a3a35c  dc2  s18.r13.dc2  slave   false  ready\r\n22def55f  dc2  s19.r13.dc2  slave   false  ready\r\nb21fcfae  dc2  s10.r13.dc2  slave   false  ready\r\n92cba516  dc2  s09.r13.dc2  slave   false  ready\r\nd96b3acd  dc2  s12.r13.dc2  slave   false  ready\r\ne55af94a  dc2  s20.r13.dc2  slave   false  ready\r\nae6e3ba5  dc2  s08.r13.dc2  slave   false  ready\r\n4e59d2d4  dc2  s07.r13.dc2  slave   false  ready\r\n09c2f638  dc2  s11.r13.dc2  slave   false  ready\r\n520e6d42  dc2  s06.r13.dc2  slave   false  ready\r\n2ccaa2f3  dc2  s16.r13.dc2  slave   false  ready\r\n973e2db0  dc2  s05.r13.dc2  slave   false  ready\r\n9442eabb  dc2  s04.r13.dc2  slave   false  ready\r\nf968b71c  dc2  s03.r13.dc2  slave   false  ready\r\n9c429e1f  dc2  s02.r13.dc2  slave   false  ready\r\n4fd545f9  dc2  s01.r13.dc2  slave   false  ready\r\nae938452  dc2  s13.r13.dc2  master  false  ready\r\n7ee97540  dc2  s15.r13.dc2  master  false  ready\r\n9b6e4c7b  dc2  s14.r13.dc2  master  false  ready\r\n```\r\n\r\nAs you can see i'm basically trying to run jobs on the nomad masters and failing pretty badly.\r\n\r\n```# nomad version\r\nnomad version\r\nNomad v0.4.1\r\n```\r\n\r\nCommandline we use to run nomad:\r\n```\r\nnomad agent -server -bootstrap-expect=3 -client -config /tmp/nomad.cfg\r\ncat /tmp/nomad.cfg\r\ndatacenter = \"dc1\"\r\nclient {\r\n  enabled = true\r\n  node_class = \"master\"\r\n}\r\ndata_dir = \"/data/1/nomad\"\r\nbind_addr = \"0.0.0.0\"\r\ntelemetry {\r\n  \"statsd_address\" = \"127.0.0.1:8125\"\r\n}\r\nadvertise {\r\n  http = \"x.x.x.x:4646\"\r\n  rpc = \"x.x.x.x:4647\"\r\n  serf = \"x.x.x.x:4648\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/nomad/issues/comments/260182770","html_url":"https://github.com/hashicorp/nomad/issues/1987#issuecomment-260182770","issue_url":"https://api.github.com/repos/hashicorp/nomad/issues/1987","id":260182770,"user":{"login":"jippi","id":22841,"avatar_url":"https://avatars.githubusercontent.com/u/22841?v=3","gravatar_id":"","url":"https://api.github.com/users/jippi","html_url":"https://github.com/jippi","followers_url":"https://api.github.com/users/jippi/followers","following_url":"https://api.github.com/users/jippi/following{/other_user}","gists_url":"https://api.github.com/users/jippi/gists{/gist_id}","starred_url":"https://api.github.com/users/jippi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jippi/subscriptions","organizations_url":"https://api.github.com/users/jippi/orgs","repos_url":"https://api.github.com/users/jippi/repos","events_url":"https://api.github.com/users/jippi/events{/privacy}","received_events_url":"https://api.github.com/users/jippi/received_events","type":"User","site_admin":false},"created_at":"2016-11-13T12:18:28Z","updated_at":"2016-11-13T12:18:28Z","body":"does it place 0 allocations in your cluster?\r\n\r\ne.g. `nomad status nginx` shows nothing?"}}
{"actor":{"display_login":"jippi"}}