<p>Using K8S deployment, our project is based on springcloud. I want to know that in K8S, because the multi-node deployment passes the default host name of the registry, the gateway is deployed in A, and the config is deployed in B. They can't access each other through eureka before. I changed to <code>eureka.instance.prefer-ip-address: true</code>, but I found that they can only access each other on the same host. He is not using cluster-ip of K8S. I want to know how to access each other between services in K8S.</p>

<p>In version 7-201712-EA of Activiti Cloud we provided an example using services running the netflix libraries in kubernetes - the stable <a href="https://github.com/Activiti/activiti-cloud-examples/tree/7-201712-EA" rel="nofollow noreferrer">github tags</a> and docker images are available to refer to. We approached it by creating Kubernetes Services for each component and getting the component to <a href="https://stackoverflow.com/questions/52066141/zuul-unable-to-route-traffic-to-service-on-kubernetes">register with eureka using the k8s service name</a>.</p>

<p>To make sure the component declared the correct service name to eureka we <a href="https://github.com/Activiti/example-runtime-bundle/blob/7-201712-EA/src/main/resources/application.properties#L35" rel="nofollow noreferrer">set the eureka.instance.hostname</a> in the component, which can be set <a href="https://github.com/Activiti/activiti-cloud-examples/blob/7-201712-EA/kubernetes/kubectl/application.yml#L157" rel="nofollow noreferrer">in the Deployment yaml by specifying an environment variable</a> or using the default environment variable <code>EUREKA_INSTANCE_HOSTNAME</code>. We also kept thing simple by using the same port for the java app in the Pod and for the Service. Again this can be set to match by setting the port in the Pod spec and passing the <code>SERVER_PORT</code> environment variable to the spring boot app.</p>
