title: I expose my pod in kubernetes but I can´t seem to establish a connection with it
body: <p>I am trying to expose a deployment I made on minikube:</p>
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: deployment-test
    labels:
      app: debian
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: debian
    strategy: {}
    template:
      metadata:
        labels:
          app: debian
      spec:
        containers:
        - image: agracia10/debian_bash:latest
          name: debian
          ports:
          - containerPort: 8006
          resources: {}
        restartPolicy: Always
  status: {}
  </code></pre>
  <p>I decided to follow was is written on <a href="https://stackoverflow.com/questions/46245508/how-create-service-on-minikube-with-yaml-configuration-which-accessible-from-hos">here</a></p>
  <p>I try to expose the deployment using the following command:</p>
  <pre><code>kubectl expose pod deployment-test-8497d6f458-xxhgm --type=NodePort --port=8080 --target-port=80
  </code></pre>
  <p>but when I try to then access the service created by the expose command, using the url provided by</p>
  <pre><code>minikube service deployment-test-8497d6f458-xxhgm --url
  </code></pre>
  <p>it throws an error using packetsender to try and connect to the service:
  <a href="https://i.stack.imgur.com/df275.png" rel="nofollow noreferrer">packet sender log</a></p>
  <p>Im not really sure what the reason for this could be, I think it has something to do with the fact that when I get the services it says  on the external ip field. Also, when I try and retrieve the node IP using <code>minikube ip</code> it gives an address, but when the <code>minikube service --url</code> it gives the 127.0.0.1 address. In any case, using either one does not work.</p>