nabsul/kcert

It is not possible to set annotations className using environment variables

mdgomes opened this issue · 2 comments

Hello,

It is not possible to set the ChallengeIngress.Annotations.kubernetes.io/ingress.class because when you try to do it via kubernetes environment variables the / is not an allowed character as such you end up with something like this:

  annotations:
    kubernetes.io-ingress.class: nginx-horizontal
    kubernetes.io/ingress.class: nginx

For

            - name: CHALLENGEINGRESS__USEANNOTATIONS
              value: 'true'
            - name: CHALLENGEINGRESS__ANNOTATIONS__kubernetes.io-ingress.class
              value: nginx-horizontal

In my opinion the annotation value should be its on appsettings.json field where only the value matters instead of merging the entire field to the ingress as is.

I'll need to double check this, but I think you can place an additional appsettings.Production.json file in the app directory, and it will get merged with the default appsettings.json...

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-7.0#default-application-configuration-sources

slovx2 commented

To set ingress class name, you ONLY need to add this to 070-Deployment.yaml , spec.template.spec.containers[0].env
- name: CHALLENGEINGRESS__ClASSNAME value: YOUR_CLASS_NAME