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
+7 -3
View File
@@ -145,7 +145,9 @@ func htCreate(c *cli.Context) error {
}
createIngress := c.Bool("createingress")
ingressConfig, err := httptrigger.GetIngressConfig(c.StringSlice("ingressannotation"), c.String("ingressrule"), triggerUrl, nil)
ingressConfig, err := httptrigger.GetIngressConfig(
c.StringSlice("ingressannotation"), c.String("ingressrule"),
c.String("ingresstls"), triggerUrl, nil)
util.CheckErr(err, "parse ingress configuration")
host := c.String("host")
@@ -271,8 +273,10 @@ func htUpdate(c *cli.Context) error {
log.Warn(fmt.Sprintf("--host is now marked as deprecated, see 'help' for details"))
}
if c.IsSet("ingressrule") || c.IsSet("ingressannotation") {
_, err = httptrigger.GetIngressConfig(c.StringSlice("ingressannotation"), c.String("ingressrule"), ht.Spec.RelativeURL, &ht.Spec.IngressConfig)
if c.IsSet("ingressrule") || c.IsSet("ingressannotation") || c.IsSet("ingresstls") {
_, err = httptrigger.GetIngressConfig(
c.StringSlice("ingressannotation"), c.String("ingressrule"),
c.String("ingresstls"), ht.Spec.RelativeURL, &ht.Spec.IngressConfig)
util.CheckErr(err, "parse ingress configuration")
}