<p>How do I create an ingress(ping) to expose a single service(hello) given a path (/hello )and a port (6789) in a given namespace (dev)?</p>
<p>the following is right? Also how to verify the same?</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ping
  namespace: dev
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /hello
        pathType: Prefix
        backend:
          service:
            name: hello
            port:
              number: 6789
</code></pre>

NelsonVasu
<p>You might need to add the host into the ingress YAML if you are looking forward to use the domain for resolution like</p>
<p><strong>hello-world.info</strong> forward the traffic to <strong>hello</strong> service.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - host: hello-world.info
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web
                port:
                  number: 8080
</code></pre>
<p>to verify the changes you can use the Curl to check and test the endpoint also.</p>
<p>Once your YAML file is applied and ingress is created on cluster you can hit the endpoint and verify.</p>
<p>i would recommend checking out the part test your ingress :</p>
<p><a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/#test-your-ingress" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/#test-your-ingress</a></p>
