<p>I am trying to run an Angular CLI project on my MAC using Docker Desktop and Kubernetes. I have a dockerfile here, which works fine when running the image strictly through docker.</p>
<pre class="lang-yaml prettyprint-override"><code>FROM node:14.16.0-alpine3.13 as node
WORKDIR /app
COPY package.json package.json
RUN npm install
COPY . .
RUN npm run build -- --prod

FROM nginx:alpine
VOLUME /var/cache/nginx
COPY --from=node /app/dist/ngDockerApp/* /usr/share/nginx/html/
COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf
</code></pre>
<p>The nginx config file is here:</p>
<pre class="lang-json prettyprint-override"><code>server {
    listen 0.0.0.0:80;
    listen [::]:80;
    default_type application/octet-stream;

    gzip                    on;
    gzip_comp_level         6;
    gzip_vary               on;
    gzip_min_length         1000;
    gzip_proxied            any;
    gzip_types              text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers            16 8k;
    client_max_body_size    256M;

    root /usr/share/nginx/html;

    location / {
        try_files $uri $uri/ /index.html =404;
    }
}

</code></pre>
<p>When I run <code>docker run -d -p 8080:80 nginx-angular</code> it spins up the image and runs fine. However, I have a kubernetes deployment I am trying to run via docker desktop, and have no idea what I am doing wrong, and why I cant bring it up.</p>
<p>The deployment file is here:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: ui-svc
  labels:
    app: ui
spec:
  type: NodePort
  selector:
    app: ui
  ports:
  - port: 80
    targetPort: 80
    nodePort: 31000

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ui
  labels:
    app: ui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ui
  template:
    metadata:
      labels:
        app: ui 
    spec:
      containers:
        - name : ui
          image: nginx-angular
          imagePullPolicy: Never
          ports:
            - containerPort: 80
          resources:
            limits:
              memory: &quot;500Mi&quot;
              cpu: &quot;90m&quot;
</code></pre>
<p><em>EDIT</em></p>
<pre class="lang-json prettyprint-override"><code>## kubectl get all -o wide
NAME                      READY   STATUS    RESTARTS   AGE   IP           NODE             NOMINATED NODE   READINESS GATES
pod/ui-6cc55b59c4-24tv7   1/1     Running   0          7s    10.1.0.124   docker-desktop   &lt;none&gt;           &lt;none&gt;

NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE   SELECTOR
service/kubernetes   ClusterIP   10.96.0.1      &lt;none&gt;        443/TCP        21d   &lt;none&gt;
service/ui-svc       NodePort    10.100.72.12   &lt;none&gt;        80:31000/TCP   8s    app=ui

NAME                 READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES          SELECTOR
deployment.apps/ui   1/1     1            1           8s    ui           nginx-angular   app=ui

NAME                            DESIRED   CURRENT   READY   AGE   CONTAINERS   IMAGES          SELECTOR
replicaset.apps/ui-6cc55b59c4   1         1         1       8s    ui           nginx-angular   app=ui,pod-template-hash=6cc55b59c4


## kubectl get nodes -o wide
NAME             STATUS   ROLES    AGE   VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE         KERNEL-VERSION      CONTAINER-RUNTIME
docker-desktop   Ready    master   21d   v1.19.7   192.168.65.4   &lt;none&gt;        Docker Desktop   4.19.121-linuxkit   docker://20.10.5

</code></pre>
<p>Just to clarify, 10.100.72.12:31000 (nodeport) and 192.168.65.4:31000 do not work.</p>
<p>I've tried localhost:80, and I have tried the internal node IP address:80, and nothing shows up. What am I missing?</p>

foo_bar_zing
<p>Here is what I found out. For local deployments, run <code>kubectl cluster info</code>. This gave me the following:</p>
<pre class="lang-json prettyprint-override"><code>$ kubectl cluster-info
Kubernetes master is running at https://kubernetes.docker.internal:6443
KubeDNS is running at https://kubernetes.docker.internal:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
</code></pre>
<p>I then took <code>http://kubernetes.docker.internal:&lt;nodeport&gt;</code> and put that in the browser.I could then see my app.</p>
