alexellis / arkade

Open Source Marketplace For Developer Tools

Home Page:https://blog.alexellis.io/kubernetes-marketplace-two-year-update/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add easy option to "arkade install ingress-nginx" to set default IngressClass

afentoe opened this issue · comments

Expected Behaviour

Add an easy option to arkade install ingress-nginx to set it as the default IngressClass.

More info about the use of default ingress class:
https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class

Current Behaviour

When using arkade to install ingress-nginx, the added IngressClass is not set as the default ingress class.

Next, when creating a new Ingress defintion, if ingressClassName (or the deprecated annotation 'kubernetes.io/ingress.class: nginx') is omitted , the ingress is added without any error or warning, but it will not work.
The ingress controller pod logs something like: error="ingress does not contain a valid IngressClass",

To set the IngressClass as the default when using arkade install ingress-nginx, a user would need to run the following command:
arkade install ingress-nginx -n ingress-nginx --set controller.ingressClassResource.default=true

Possible Solutions

Add an easy to use flag for arkade install ingress-nginx, similar to --host-mode.
So something like: arkade install ingress-nginx --set-as-default

Add flag to the help text:

Examples:
  arkade install ingress-nginx --namespace default --set-as-default

Another solution would be to just add this as an example for the --set flags in the help text for install ingress-nginx -h:

      --set stringArray    Use custom flags or override existing flags
                           (example: --set image=org/repo:tag)
                           (example to set as default Ingress Class: --set controller.ingressClassResource.default=true)

But this way, this important setting, is a bit hidden.

Your Environment

  • What Kubernetes distribution are you using?
Client Version: v1.27.6
Kustomize Version: v5.0.1
Server Version: v1.27.6+k3s1
  • Operating System and version (e.g. Linux, Windows, MacOS):
Debian Bookworm
  • What arkade version is this?
Version: 0.10.13

Hi thanks for the suggestion.

Perhaps should should be on by default, then you can override it to off if you need two ingress controllers.

--default-ingress=true/false

Do you want to work on a PR and we'll take a look?

I think creating a PR will be a bit of a challenge for me, but I can give it a try.

I'll start with the contributing guide and work from there.

@Jasstkn can you take this instead?

@Jasstkn can you take this instead?

Sure, I will take care of it.

wired a PR.