-
Couldn't load subscription status.
- Fork 23
Description
Expected Behaviour
Instead of using spec.ingressType to select an Ingress class, we should use the default annotation kubernetes.io/ingress.class, since #7 was implemented.
Current Behaviour
In the version 0.4.0, by the docs, we need to define the Ingress class using the spec.ingressType configuration.
BUT
After merging #7 we actually don't need that. I tested two cases:
Empty annotation and spec.ingressType
Deploying the following FunctionIngress without spec.ingressType and without kubernetes.io/ingress.class annotation defaults the Ingress class to nginx and works. I believe this should be considered a bug and specifying an Ingress class should be mandatory.
apiVersion: openfaas.com/v1alpha2
kind: FunctionIngress
metadata:
name: nodeinfo
namespace: openfaas
spec:
domain: "nodeinfo.deployeveryday.com"
function: "nodeinfo"
# ingressType: "nginx" # disable ingressTypeUse kubernetes.io/ingress.class annotation
Deploying the following FunctionIngress without spec.ingressType but using the kubernetes.io/ingress.class works like a charm. I believe this should be the default way of doing things.
apiVersion: openfaas.com/v1alpha2
kind: FunctionIngress
metadata:
name: nodeinfo
namespace: openfaas
annotations:
# Uses default K8S annotation
kubernetes.io/ingress.class: "nginx"
spec:
domain: "nodeinfo.deployeveryday.com"
function: "nodeinfo"
# ingressType: "nginx" # disable ingressTypePossible Solution
- getClass should yield an error if not class is defined.
- makeAnnotations should get the Class from annotations and not from
function.Spec.IngressType.
Context
Using the default K8S annotation to select an Ingress class requires lower learning curve and it's more a standard across other K8S controllers.