Open mrproper opened 1 year ago
@mrproper in my case nomad is registering the IP of the gateway of the CNI, instead of the IP of the container. My CNIs are NATted, and I can reach the containers IPs from the host, but when the job is spun up, the IP of the gateway is being registered.
One note for the Hashicorp folks:
we keep raising issues on Github that look more like support requests. I know that there is discuss.hashicorp.com
, but Slack would be much better, to create community and to get immediate support. I understand that the conversations in Slack vanish, but the fact that we tend to use Github, it's a demonstration that discuss.hashicorp.com does not really work IMO.
This is my configuration. I am using VXLAN interfaces and I get my service registered against the gateway, but I want to register the IP of the container, which is reachable from the host (because I am using bridging):
{
"cniVersion": "1.0.0",
"name": "gitea",
"plugins": [
{
"type": "loopback"
},
{
"type": "macvlan",
"master": "vxbr11882895",
"isDefaultGateway": false,
"forceAddress": false,
"ipMasq": true,
"ipam": {
"type": "host-local",
"ranges": [
[
{
"subnet": "192.168.2.0/24",
"rangeStart": "192.168.2.2",
"rangeEnd": "192.168.2.25",
"gateway": "192.168.2.1"
}
]
],
"routes": [
{
"dst": "0.0.0.0/0",
"gw": "192.168.2.1"
}
],
"dataDir": "/run/cni/ipam-state"
}
},
{
"type": "firewall",
"backend": "iptables",
"iptablesAdminChainName": "NOMAD-ADMIN"
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
},
"snat": true
}
]
}
This is the job:
nomad alloc status -json 81512e2b-638a-db5a-9650-0d8638b3cda3 | jq .AllocatedResources.Shared.Ports[]
{
"HostIP": "192.168.2.1",
"Label": "http_gitea",
"To": 0,
"Value": 3000
}
{
"HostIP": "192.168.2.1",
"Label": "ssh_pass",
"To": 0,
"Value": 2222
}
in my case the solution might be here: https://github.com/hashicorp/nomad/pull/12720 though I don't know how to advertise the container IP in the job specification
Hi @mrproper thanks for raising this request and apologies this slipped through our triaging process. This seems like something we would certainly want to support and I will therefore put this onto our backlog. When this makes it onto our current work, the engineer will assign themself.
we keep raising issues on Github that look more like support requests. I know that there is discuss.hashicorp.com, but Slack would be much better, to create community and to get immediate support. I understand that the conversations in Slack vanish, but the fact that we tend to use Github, it's a demonstration that discuss.hashicorp.com does not really work IMO.
Hi @maxadamo and thanks for the additional details you've added. In relation to the above sentence, if you're an enterprise customer with a support contract, I would encourage you to reach out to your account manager or via the support process if you require support. Outside of this, we are certainly looking at ways in which we can improve our OSS community interaction story and I'll pass this information on to the rest of the team.
GitHub is the correct place for bug or feature requests, which this seems to be unless I am mistaken. The engineering team and wider team do our best to support the OSS community, but this cannot generally be immediate due to the number of other factors which influence our working days. I hope this all makes sense.
@jrasell thanks for your reply. for the sake of completeness, I am running Nomad 1.5.4 on Ubuntu 20.04. I'm trying to get my head around, and I'm also looking at https://github.com/hashicorp/nomad/pull/12720 but:
address_mode = "alloc"
I keep getting the IP of the gatewayI've open this one, but I seem to have found a solution: https://github.com/hashicorp/nomad/issues/17107
Sorry my response slipped, my allocations register just fine to consul etc, its just that a status of the allocation doesnt tell you the cni ip address that nomad knows (through the debug log)
Nomad version
Operating system and Environment details
Issue
When using cni, nomad does not show the allocation's ip address anywhere in the nomad cli/ui in fact the only way to know what the ip address of an allocation is, is to look within the container itself (often most containers do not have binaries in them to look at ip details etc
Reproduction steps
configure cni:
configure nomad job:
plan and run job:
get the status of job and allocation:
relevant logs from nomad agent:
Expected Result
within nomad alloc status ${allocid} You should see the container's ip: something like:
yes im aware i have no port definition in the job but its a pointless thing to add given cni, however when adding a port definition)
You see the allocation addresses look like this:
Actual Result
Container ip no where to be found with inspection of the job/allocation