Add Ingress host, path and annotations support (#1325)

For each ingress controller, the format of ingress host,
path and annotations are different. To support different
kinds of controller, this PR adds new ingress config field
to http trigger spec. A user can set annotations, host and
path based on the type of underlying ingress controller
with CLI.

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/*"
This commit is contained in:
Ta-Ching Chen
2019-09-26 16:54:16 +08:00
committed by GitHub
parent 82a7acf408
commit 49d60b19f3
14 changed files with 1421 additions and 138 deletions
+18 -2
View File
@@ -44,9 +44,25 @@ clean_resource_by_id() {
}
test_fn() {
url="http://$FISSION_ROUTER/$1"
expect=$2
test_response $url $expect
}
export -f test_fn
test_ingress() {
url="http://$INGRESS_CONTROLLER/$1"
expect=$2
echo $url
test_response $url $expect
}
export -f test_ingress
test_response() {
# Doing an HTTP GET on the function's route
# Checking for valid response
url="http://$FISSION_ROUTER/$1"
url=$1
expect=$2
set +e
@@ -69,7 +85,7 @@ test_fn() {
done
set -e
}
export -f test_fn
export -f test_response
test_post_route() {
# Doing an HTTP POST on the function's route