<p>I want to install nginx-controller in my Kubernetes cluster. I setup my master node at one server, and worker node at another server. I am using Ubuntu 20.04.</p>
<p>I followed the link (<a href="https://github.com/kubernetes/ingress-nginx/blob/main/deploy/static/provider/cloud/1.23/deploy.yaml" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/blob/main/deploy/static/provider/cloud/1.23/deploy.yaml</a>) and use 'kubectl apply -f file_name.yaml' to install the controller.</p>
<p>The controller pod is running:</p>
<pre><code>NAME                                       READY   STATUS    RESTARTS   AGE
ingress-nginx-controller-c57bb9674-p2z9d   1/1     Running   0          70s
</code></pre>
<p>Now I want to create an Ingress resource. I used this yaml file:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-hello
  namespace: ingress-nginx
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - http:
        paths:
        - path: /hello
          pathType: Exact
          backend:
            service:
              name: ingress-hello
              port:
                number: 80
</code></pre>
<p>However, when I applied this yaml file, and use '<em>kubectl get ingress -n ingress-nginx</em>', I saw:</p>
<pre><code>NAME            CLASS    HOSTS   ADDRESS   PORTS   AGE
ingress-hello   &lt;none&gt;   *                 80      24s
</code></pre>
<p>I noticed that the address for this Ingress resource is empty.</p>
<p>I am just wondering is it possible to assign an IP address to it? Any method/ setting to assign the address?</p>
<p>Thanks.</p>

maantarng
<p>You can access to your service by <code>http://localhost:80/hello</code>, and if you wanan specify a custom host you need to modify your ingnx file.</p>
<p>This is an example:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-hello
  namespace: ingress-nginx
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - host: your_host  
      http:
        paths:
        - path: /hello
          pathType: Exact
          backend:
            service:
              name: ingress-hello
              port:
                number: 80
</code></pre>
<p>and you need to open your hosts files in your <code>/system32/etc/hosts</code> directory and add your customized <code>host</code>, and then your service will be accessible through
<code>http://your_host:80/hello</code></p>
