reminders added

This commit is contained in:
Torma Kristóf 2019-10-14 21:38:06 +02:00
parent babc8b83d3
commit 1cd4e1854c
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
3 changed files with 3 additions and 32 deletions

View File

@ -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

View File

@ -1,5 +0,0 @@
module.exports = {
foo: function (event, context) {
return 'hello world!';
}
}

View File

@ -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";
};
},
};