<p>i'm noob on Kubernetes. I've configured Kube successfully on my Raspberry pi4b, using kubeadm. I created my first deployment using demo image that expose a simple page with some info and if I logs the pod it says that it listen correctly to the port 8080.</p>

<p>After installing nginx-ingress-controller (status is running) with helm following this <a href="https://limpygnome.com/2019/09/21/raspberry-pi-kubernetes-cluster/" rel="nofollow noreferrer">https://limpygnome.com/2019/09/21/raspberry-pi-kubernetes-cluster/</a>, I've created a service that points to deployment and an ingress as tutorial explains, but the host that I specified into that ingress is not reachable. Status is running for every pod but I don't understand how to fix it.</p>

<p>I don't know if the problem is the ingress-controller, the ingress or something else.</p>

<p>Here are my yaml:</p>

<pre><code>---
apiVersion: v1
kind: Namespace
metadata:
  name: hello

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: hello-world
  name: hello-world-deploy
  namespace: hello
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-world
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      # - image: docker:stable-dind
      - image: pmorjan/demo:latest
        name: hello-world
        securityContext:
          privileged: true
        ports:
        - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: hello-world
  name: hello-world-service
  annotations:
    metallb.universe.tf/allow-shared-ip: home-network
  namespace: hello
spec:
  ports:
  - name: http
    port: 80
    targetPort: 8080
  selector:
    app: hello-world
  sessionAffinity: None
  type: LoadBalancer
  loadBalancerIP: 192.168.1.241

---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: hello-world-ingress
  namespace: hello
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - host: ciao.mirco.com
      http:
        paths:
        - path: /hello
          backend:
            serviceName: hello-world-service
            servicePort: 80

</code></pre>

<p>Thanks for your help</p>

sP0re90
<p>When you want to access your pod via ingress you don't need to create a LoadBalancer type service for your pod. Instead you create a LoadBalancer type service for the ingress controller itself and a cluserIP type service for the pod. Also to  access it via ciao.mirco.com you need to add an entry into /etc/hosts file of the system where you are accessing as below.</p>

<pre><code>ipaddress ciao.micro.com
</code></pre>

<p>The <code>ipadress</code> should be nodeip if you have created a Nodeport type service for ingress controller or LoadBalancer IP if you have created a LoadBalancer type service.</p>

<p>Create a NodePort service for nginx ingress controller in the namespace where nginx ingress controller is deployed.</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      targetPort: 80
      protocol: TCP
    - name: https
      port: 443
      targetPort: 443
      protocol: TCP
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
</code></pre>

<p>After this is created you can check the nodeport(ranging from 30000-32767) assigned to this service.</p>

<p>Find out the IP of the kubernetes node where nginx ingress controller pods are deployed.</p>

<p>Then you can access it via <code>nodeport:nodeip/hello</code> or <code>ciao.micro.com/hello</code> in your browser or via <code>curl nodeip:nodeport/hello -H 'Host:ciao.mirco.com'</code></p>
