<p>I'm studying Kubernetes using my laptop(no cloud). I started with minikube by following the docs at kubernetes(.)io. I'm not sure what I'm missing since I can only access my web app using high TCP port 32744 and not the standard port 80. I want to be able to access my web app using a web browser by visiting http://ipaddress.</p>
<p>Here is my deployment.yaml</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
    name: webapp-deployment
spec:
    replicas: 2
    selector:
        matchLabels:
            app: nodejs
    template:
        metadata:
            labels:
                app: nodejs
        spec:
            containers:
            - name: nodeapp
              image: localregistry/nodeapp:1.0
              ports:
              - containerPort: 3000
</code></pre>
<pre class="lang-sh prettyprint-override"><code>$ minikube service webapp-deployment
|-----------|-------------------|-------------|---------------------------|
| NAMESPACE |       NAME        | TARGET PORT |            URL            |
|-----------|-------------------|-------------|---------------------------|
| default   | webapp-deployment |        3000 | http://192.168.64.2:32744 |
|-----------|-------------------|-------------|---------------------------|
</code></pre>

devwannabe
<p>This is just how Kubernetes works.</p>
<p><code>3000</code> is the port in your container and <code>32744</code> is the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">NodePort</a> where your application got exposed. There are multiple reasons for this, one of them is that port <code>80</code> and <code>443</code> are standard reserved ports 🔒🔒 for web services and Kubernetes needs to be able to run many containers and services. Another reason is that ports <code>0-1024</code> are <a href="https://unix.stackexchange.com/questions/16564/why-are-the-first-1024-ports-restricted-to-the-root-user-only">restricted to <code>root</code> only on *nix systems</a> 🚫🚫.</p>
<p>If you really would like to serve it on port <code>80</code> on your local machine I would just set up something like Nginx and proxy the traffic to <code>http://192.168.64.2:32744</code></p>
<pre><code># nginx.conf
...
location / {
    proxy_set_header Accept-Encoding &quot;&quot;;
    proxy_pass http://192.168.64.2:32744;
}
...
</code></pre>
<p>Or you can do <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer"><code>port-forward</code></a> from a non-restricted local post as the other answer here suggested.</p>
<p>✌️</p>
