<p>Heres image of my Kubernetes services.</p>

<p><a href="https://i.stack.imgur.com/XHZk1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XHZk1.png" alt="My kubernetes services"></a></p>

<p>Todo-front-2 is working instance of my app, which I deployed with command line:</p>

<pre><code>kubectl run todo-front --image=todo-front:v7 --image-pull-policy=Never
kubectl expose deployment todo-front --type=NodePort --port=3000
</code></pre>

<p>And it's working great. Now I want to move on and use <strong>todo-front.yaml</strong> file to deploy and expose my service. Todo-front service refers to my current try on it. My deployment file looks like this:</p>

<pre><code>kind: Deployment
apiVersion: apps/v1
metadata:
  name: todo-front
spec:
  replicas: 1
  selector:
    matchLabels:
      app: todo-front
  template:
    metadata:
      labels:
        app: todo-front
    spec:
      containers:
        - name: todo-front
          image: todo-front:v7
          env:
          - name: REACT_APP_API_ROOT
            value: "http://localhost:12000"
          imagePullPolicy: Never
          ports:
            - containerPort: 3000
---
kind: Service
apiVersion: v1
metadata:
  name: todo-front
spec:
  type: NodePort
  ports:
    - port: 3000
      targetPort: 3000
  selector:
    app: todo-front
</code></pre>

<p>I deploy it using: </p>

<pre><code>kubectl apply -f deployment/todo-front.yaml
</code></pre>

<p>Here is the output</p>

<p><a href="https://i.stack.imgur.com/j5NBS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j5NBS.png" alt="Output for deploying app"></a></p>

<p>But when I run</p>

<pre><code>minikube service todo-front
</code></pre>

<p>It redirects me to URL saying "Site can't be reached".
I can't figure out what I'm doing wrong. Ports should be ok, and my cluster should be ok since I can get it working by only using command-line without external YAML files. Both deployments are also using the same docker-image. I have also tried changing all ports now "3000" to something different, in case they clash with existing deployment todo-front-2, no luck.
Here is also a screenshot of pods and their status:</p>

<p><a href="https://i.stack.imgur.com/JzNFG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JzNFG.png" alt="enter image description here"></a></p>

<p>Anyone with more experience with Kube and Docker cares to take a look? Thank you!</p>

Riku 
<p>You can run below commands to generate the yaml files without applying it to the cluster and then compare it with the yamls you manually created and see if there is a mismatch. Also instead of creating yamls manually yourself you can apply the generated yamls itself.</p>

<pre><code>kubectl run todo-front --image=todo-back:v7 --image-pull-policy=Never --dry-run -o yaml &gt; todo-front.yaml


kubectl expose deployment todo-front --type=NodePort --port=3000 --dry-run -o yaml &gt; todo-depoloyment.yaml
</code></pre>
