# Self/service and stack metadata missing inside container

**URL:** <https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494>\
**Category:** Rancher 1.x\
**Created:** [July 21, 2016, 9:08pm UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494 "2016-07-21T21:08:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cookandy](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@cookandy](https://forums.suse.com/u/cookandy)\
**Post date:** [July 21, 2016, 9:08pm UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/1 "2016-07-21T21:08:17Z")

</div>

Hello,

I deployed a custom set of services via a home-brew Catalog. I wanted to use the rancher metadata service to get information about the service and stack, however, I notice they’re missing. The only thing available is “host”. From within a container I can view this by using curl:

```
root@c01nhvd614:/opt# curl rancher-metadata/latest/self/
host/

```

Any ideas? Thank you!

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [July 21, 2016, 10:58pm UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/2 "2016-07-21T22:58:46Z")

</div>

Have you taken a look at the docs?

[http://docs.rancher.com/rancher/latest/en/rancher-services/metadata-service/](http://docs.rancher.com/rancher/latest/en/rancher-services/metadata-service/)

---

<div class="post-metadata">

**Author:** ![cookandy](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@cookandy](https://forums.suse.com/u/cookandy)\
**Post date:** [July 21, 2016, 11:10pm UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/3 "2016-07-21T23:10:30Z")

</div>

Hi @denise. Yes, and according to the docs I should be able to hit `self/service`

> Provides metadata on the service of the container that you are executing the command in

However, this isn’t available to me in my container. Is it because I’m running in `host` mode? This sentence is kinda confusing:

> Using Rancher Compose, any service, that doesn’t have another networking mode (net) specified, is launched in the managed network.

Thanks

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [July 22, 2016, 12:46am UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/4 "2016-07-22T00:46:23Z")

</div>

Yes, metadata is based on the source-ip of the request… with host networking the source is the host, and there is no way to differentiate which container “self” is.

---

<div class="post-metadata">

**Author:** ![cookandy](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@cookandy](https://forums.suse.com/u/cookandy)\
**Post date:** [July 22, 2016, 2:39am UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/5 "2016-07-22T02:39:42Z")

</div>

Thank you @vincent. Sorry for the question, but is there any way for me to start a container and bind it to the HOST IP when I’m not running in `host` mode? I would like the self metadata, but I also have a bunch of ports to expose, and they need to be bound to the host IP and not the internal one.

Thanks!

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [July 22, 2016, 3:22am UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/6 "2016-07-22T03:22:04Z")

</div>

If you actually need `net:host` then no, but you can get info about the container (or service, etc) by name from the rest of metadata.

Managed network + normal port mapping makes ports available on the host’s public IP address(es), so you may be misunderstanding what `net:host` is for and not actually need it?

---

<div class="post-metadata">

**Author:** ![cookandy](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@cookandy](https://forums.suse.com/u/cookandy)\
**Post date:** [July 22, 2016, 7:55pm UTC](https://forums.suse.com/t/self-service-and-stack-metadata-missing-inside-container/3494/7 "2016-07-22T19:55:33Z")

</div>

@vincent, it’s really only for one port - 53 (TCP/UDP). I am running a DNS server in one of my containers and I need port 53 to be exposed back to the machines. I tried to run the DNS servers on port 54 in my container, and then use a load balancer to setup a rule to forward 53 to 54, but the load balancer doesn’t support UDP. Any other ideas on how I could do this while running n the managed network? I’ve got port 53 mapped in my docker-compose.yml - both UDP and TCP.
