Kubernetes configuration to link containers

I am trying to see if there are any example to create a Kubernetes POD
which starts 2-3 containers and these containers are linked with each other but couldn’t find any.

Does anybody tried linking containers using Kubernetes config.

  • Wrong copy of folder in Dockerfile
  • Edit apache configuration in docker
  • Postgres image from docker can't find initdb. What am I missing?
  • Haskell installation in docker container using stack failing: too many open files
  • Why docker containers can run, despite of docker-machine is not running?
  • Migrating existing Docker containers to Docker Compose
  • Requirement to accept network packets in container from host or outside? (docker port forwarding)
  • Error: EACCES: permission denied using docker-compose
  • Is there a way to detect programmatically whether a Docker container is running natively or using Docker Machine?
  • Can't install Docker on CentOS 7 running on Vagrant
  • Deploy .war on tomcat Docker container
  • Compile .NET project in Docker using .csproj file
  • 2 Solutions collect form web for “Kubernetes configuration to link containers”

    The containers in same pod shares the localhost, so you need not link containers, just use localhost:containerPort.

    You have to use the Kubernetes service (Proxy) https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md#how-do-they-work.

    Have a look how they work togehter: https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook

    To be specific, there is no concept of “linking” similarly to the way Docker does it. Every service endpoint is a fully qualified domain name and you just call it from one container to another, and every label on a container that can be picked up by a service endpoint can be used to direct network traffic. So, you don’t have to do ENV[“$FOO_BAR_BAZ”] to get the correct IP, just call it directly (curl http://foo_bar_baz).

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.