<p>I have two microservices that communicate through http protocol. </p>

<ul>
<li><p>AC6K: C# microservice that gets data from an Atlas Copco 6000 device.</p></li>
<li><p>LocalWriter: python aplication that gets data from AC6K and stores the info in a data base</p></li>
</ul>

<p>I have tested it in Windows and Linux environments and it works fine. When I contenerize each microservice and make the deployment, there is no communication. Please find enclosed herewith the corresponding docker &amp; yaml files used to containerize and deploy the application</p>

<p>ac6k docker file:</p>

<pre><code>FROM microsoft/aspnetcore-build

EXPOSE 5010

WORKDIR /app

COPY . .

RUN dotnet restore

ENTRYPOINT ["dotnet", "ac6kcore.dll"]




-  ac6kUp.yaml

    apiVersion: v1
    kind: Service
    metadata:
      name: ac6kcore
      labels:
        run: ac6kcore  
    spec:
      type: NodePort
      ports: 
      - port: 5010
        name: ac6kcore
        targetPort: 5010
        nodePort: 32766
        protocol: TCP
      selector:
        run: ac6kcore
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: ac6kcore
    spec:
      selector:
        matchLabels:
          run: ac6kcore
      replicas: 1
      template:
        metadata:
          labels:
            run: ac6kcore
        spec:
          hostNetwork: true
          containers:
          - image: afierro/ac6kcore:lw
            name: ac6kcore
            ports:
            - containerPort: 5010
          restartPolicy: Always
</code></pre>

<p>local writer docker file:</p>

<pre><code>FROM python:3.6

RUN mkdir -p /mongodbapp

WORKDIR /mongodbapp

COPY requirements.txt /mongodbapp

RUN pip install --no-cache-dir -r requirements.txt

ADD . /mongodbapp

EXPOSE 9090

CMD ["python", "runapp.py"]

- LocalWriter.yaml

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
  name: localwriter
  labels:
    app: localwriter
spec:
  type: NodePort
  ports:
  - port: 9090
    name: localwriter
    targetPort: 9090
    nodePort: 32756
    protocol: TCP
  selector:
    app: localwriter
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: localwriter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: localwriter
  template:
    metadata:
      labels:
        app: localwriter
    spec:
      containers:
      - name: flasknode
        image: afierro/localwriter:v1
        imagePullPolicy: Always
        ports:
        - containerPort: 9090
</code></pre>

<p>Thanks in advance</p>

Alvaro Fierro Clavero
<p>According to Leandro Donizetti Soares's recommendation, I have entered the following commands to see the environment variables, and the results seem to me redundant.</p>

<pre><code>kubectl get pods

NAME                           READY   STATUS    RESTARTS   AGE
ac6kcore-77bc4c4987-dxn29      1/1     Running   0          14m
localwriter-55467c5495-px8m4   1/1     Running   0          14m
mongo                          1/1     Running   0          14m

kubectl exec ac6kcore-77bc4c4987-dxn29 -- printenv | grep SERVICE   

AC6KCORE_SERVICE_PORT_AC6KCORE=5010
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_SERVICE_PORT_HTTPS=443
AC6KCORE_SERVICE_PORT=5010
AC6KCORE_SERVICE_HOST=10.107.208.212
LOCALWRITER_SERVICE_HOST=10.100.103.114
LOCALWRITER_SERVICE_PORT=9090
LOCALWRITER_SERVICE_PORT_LOCALWRITER=9090
KUBERNETES_SERVICE_PORT=443

kubectl exec localwriter-55467c5495-px8m4 -- printenv | grep SERVICE    

KUBERNETES_SERVICE_HOST=10.96.0.1
LOCALWRITER_SERVICE_PORT_LOCALWRITER=9090
AC6KCORE_SERVICE_PORT_AC6KCORE=5010
KUBERNETES_SERVICE_PORT=443
AC6KCORE_SERVICE_HOST=10.107.208.212
LOCALWRITER_SERVICE_PORT=9090
KUBERNETES_SERVICE_PORT_HTTPS=443
AC6KCORE_SERVICE_PORT=5010
LOCALWRITER_SERVICE_HOST=10.100.103.114
</code></pre>
