Search code examples
kuberneteskubernetes-helmkubernetes-ingressnginx-ingress

Setup Ingress whith Helm using the chart stable/nginx-ingress


I would like to install Ingress on my Kubernetes cluster with Helm, so I did

$> helm install stable/nginx-ingress
... a lot of output
NOTES:
The nginx-ingress controller has been installed.
It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace default get services -o wide -w solemn-toucan-nginx-ingress-controller'

An example Ingress that makes use of the controller:

  apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    annotations:
      kubernetes.io/ingress.class: nginx
    name: example
    namespace: foo
  spec:
    rules:
 ...

Because I'm installing everything with Helm, it is not clear to me how I should install Ingress. As you can see in the output generated by Helm, they show an example Ingress but not how I should provide it.

I can think of 2:

  • Copy the whole chart and move my ingress.yaml into the templates folder
  • Use kubectl
  • Create a Helm Chart which provides the Ingress resource

From the above 3 I like the last one most, but maybe there is another way (maybe with some configuration option)?


Solution

  • helm install stable/nginx-ingress will install the Ingress controller, but it will not create an Ingress for your service (application). If you have a service and want to deploy it using Helm Charts, you need to add Ingress.yaml in the template folder of the service's Helm Charts. As an example, you can check Kubernetes-dashboard