Jeanluca Scaljeri
Jeanluca Scaljeri

Reputation: 29129

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:

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

Upvotes: 1

Views: 1544

Answers (2)

Takouna
Takouna

Reputation: 36

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

Upvotes: 2

Amit Kumar Gupta
Amit Kumar Gupta

Reputation: 18567

A rough analogy here is that using Helm to install the nginx Ingress controller is like using apt-get or brew to install nginx on a machine. But you wouldn’t use apt-get to create your nginx configuration for your application and install it on that machine.

If you just have a Hello World app, apply the Ingress resources directly with kubectl. If you get to the point that you want to encapsulate all the resources that constitute your application (Services, Ingress, Deployments, Roles, RoleBindings, ServiceAccounts, etc.) into a single artifact so that other people could consume to deploy their own copies of your application on their own K8s clusters, Helm would be a packaging and distribution option you could explore using. You would put templates for your Ingress resources in your Helm chart, there’s no reason for you to try to modify the nginx controller Helm chart.

Upvotes: 3

Related Questions