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:
Ta-Ching Chen
2019-09-27 00:49:23 +08:00
committed by GitHub
parent 49d60b19f3
commit b5341edec0
8 changed files with 288 additions and 15 deletions
+13
View File
@@ -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,