title: Mapping incoming port in kubernetes service to different port on docker container
body: <p>This is the way I understand the flow in question:</p>
  
  <ol>
  <li>When requesting a kubernetes service (via http for example) I am using port 80.</li>
  <li>The request is forwarded to a pod (still on port 80)</li>
  <li>The port forwards the request to the (docker) container that exposes port 80</li>
  <li>The container handles the request</li>
  </ol>
  
  <p>However my container exposes a different port, let's say 3000.
  How can make a port mapping like 80:3000 in step 2 or 3?</p>
  
  <p>There are confusing options like <code>targetport</code> and <code>hostport</code> in the kubernetes docs which didn't help me. <code>kubectl port-forward</code> seems to forward only my local (development) machine's port to a specific pod for debugging.</p>
  
  <p>These are the commands I use for setting up a service in the google cloud:</p>
  
  <pre><code>kubectl run test-app --image=eu.gcr.io/myproject/my_app --port=80
  kubectl expose deployment test-app --type="LoadBalancer"
  </code></pre>