Add Ingress TLS support (#1326)
This PR aims to add the Ingress TLS support by specifying the
TLS secret when creating/updating the HTTP trigger.
Command example:
fission route create --name foo \
--url /foo/{bar} --function foofn --createingress \
--ingressannotation "nginx.ingress.kubernetes.io/ssl-redirect=false" \
--ingressannotation "nginx.ingress.kubernetes.io/use-regex=true" \
--ingressrule "*=/foo/*"
--ingresstls "foobartls"
This commit is contained in:
@@ -38,6 +38,18 @@ func GetIngressSpec(namespace string, trigger *fv1.HTTPTrigger) *v1beta1.Ingress
|
||||
host = "" // wildcard Ingress host
|
||||
}
|
||||
|
||||
var ingTLS []v1beta1.IngressTLS
|
||||
if len(trigger.Spec.IngressConfig.TLS) > 0 {
|
||||
ingTLS = []v1beta1.IngressTLS{
|
||||
{
|
||||
Hosts: []string{
|
||||
trigger.Spec.IngressConfig.Host,
|
||||
},
|
||||
SecretName: trigger.Spec.IngressConfig.TLS,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
ing := &v1beta1.Ingress{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Labels: GetDeployLabels(trigger),
|
||||
@@ -49,6 +61,7 @@ func GetIngressSpec(namespace string, trigger *fv1.HTTPTrigger) *v1beta1.Ingress
|
||||
Annotations: trigger.Spec.IngressConfig.Annotations,
|
||||
},
|
||||
Spec: v1beta1.IngressSpec{
|
||||
TLS: ingTLS,
|
||||
Rules: []v1beta1.IngressRule{
|
||||
{
|
||||
Host: host,
|
||||
|
||||
Reference in New Issue
Block a user