<p>I have a simple Hello World app on Dockerhub and I'm trying to run it in Kubernetes but no luck, nothing shows up.</p>

<p>Dockerfile: </p>

<pre><code>FROM centos:7

RUN  yum install httpd -y

RUN echo "Hello World" &gt; /var/www/html/index.html

RUN chown -R apache:apache /var/www/html

EXPOSE 80

CMD  [ "/usr/sbin/httpd", "-D", "FOREGROUND" ]
</code></pre>

<p>Kubernetes YAML: </p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress-test
  labels:
    app: hello-world
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-world
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: helloworld
        image: 56789/world:v1
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: hello-world
spec:
  selector:
    app: hello-world
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: 80
  type: LoadBalancer
</code></pre>

Dilfuza Sakura
<p>As you are running a simple hello world app, I assume you might use minikube &amp; you are not doing this in the cloud.</p>

<p>Delete the service and create the service like this. Now you could be able to access your application <code>http://&lt;minikube-ip&gt;:30080</code></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: hello-world
spec:
  selector:
    app: hello-world
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: 30080
  type: NodePort
</code></pre>

<p><code>LoadBalancer</code> service is for cloud like AWS/Azure/Google cloud etc. So It can not create any LoadBalancer in your local minikube. There are workarounds to make it work by using externalIPs which you could find here - <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/</a></p>

<hr>

<p>To debug this issue, assuming pod is running and appropriate ports are open, create a ClusterIP service.</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: hello-world
spec:
  selector:
    app: hello-world
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: 80
  type: ClusterIP
</code></pre>

<p>Now first check if your application is accessible inside the cluster.</p>

<pre><code>kubectl run busybox --image=busybox --restart=Never -it --rm -- wget -O- http://hello-world/
</code></pre>

<p>If it does not work, something is wrong the pod itself! </p>
