diff --git a/functions/kubeless/deploy_function.sh b/functions/kubeless/deploy_function.sh index a644210..e9a069c 100644 --- a/functions/kubeless/deploy_function.sh +++ b/functions/kubeless/deploy_function.sh @@ -4,8 +4,10 @@ #$3=function name #$4=handler +#add --cpu 50m flag if you want to use autoscale +# --dependencies Gopkg.toml flag if necessary kubeless function deploy $3 --runtime $1 --from-file $2 --handler $4 kubeless trigger http create $3 --function-name $3 --path $3 --hostname $3.kubeless -#kubeless autoscale create $3 --max 32 --metric "cpu" --min 3 --value "50" +#kubeless autoscale create $3 --max 32 --metric "cpu" --min 1 --value "50" #Test with curl --data '{"Another": "Echo"}' --header "Host: get-python.192.168.99.100.nip.io" --header "Content-Type:application/json" 192.168.99.100/echo diff --git a/functions/kubeless/helloget.js b/functions/kubeless/helloget.js deleted file mode 100644 index c694c22..0000000 --- a/functions/kubeless/helloget.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - foo: function (event, context) { - return 'hello world!'; - } -} diff --git a/functions/kubeless/isprime.js b/functions/kubeless/isprime.js deleted file mode 100644 index b43e5bc..0000000 --- a/functions/kubeless/isprime.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - handler: (event, context) => { - num=event.data; - if (num == 1) return "Not Prime"; - num += 2; - - var upper = Math.sqrt(num); - var sieve = new Array(num) - .join(',').split(',') // get values for map to work - .map(function(){ return "Prime" }); - - for (var i = 2; i <= num; i++) { - if (sieve[i]) { - for (var j = i * i; j < num; j += i) { - sieve[j] = false; - }; - }; - }; -if (sieve[num-2]) { - return "Prime"; - }; - else { - return "Not Prime"; -}; - }, -};