This commit adds a line to the issue template
to request the faas-cli version and provider
information to the issue template to help diagnose
issues faster
Signed-off-by: Burton Rheutan <rheutan7@gmail.com>
Within MakeScalingHandler() there is a call to GetReplicas() which was not returning an error when a non-200 http response was received from /system/function/. The call would also return a populated struct, so the perception was that a function existed an had been scaled to zero. This meant that the function would be added to the function cache and the code would continue into SetReplicas() where an attempt would be made to scale up a non-existent function.
This change amends GetReplicas() so that it will return an error if the gateway returns anything other than a 200 reponse code from the /system/function/ endpoint. This causes MakeScalingHandler() to return earlier with an error indicating that the function could not be found. The cache.Set call is also moved to after the error check so that the cache is only updated to include existent functions.
During investigations as to the cause of #876 tests were added to function_cache to check that Get() is behaving as intended when function exists and when not. Tests are also added to plugin/external to test that GetReplicas() and SetReplicas() are following their intended modes of operation when 200 and non-200 responses are received from the gateway.
Signed-off-by: Richard Gee <richard@technologee.co.uk>
- the path was converted to lowercase which meant the samples
would not build, this fixes that error.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
- the shutdown sequence meant that the kubelet was still passing
work to the watchdog after the HTTP socket was closed. This change
means that the kubelet has a chance to run its check before we
finally stop accepting new connections. It will require some
basic co-ordination between the kubelet's checking period and the
"write_timeout" value in the container.
Tested with Kubernetes on GKE - before the change some Pods were
giving a connection refused error due to them being not detected
as unhealthy. Now I receive 0% error rate even with 20 qps.
Issue was shown by scaling to 20 replicas, starting a test with
hey and then scaling to 1 replica while tailing the logs from the
gateway. Before I saw some 502, now I see just 200s.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This change adds link to the table of contents on the
community.md file as well as adding links to return to top
from the headers.
Signed-off-by: Burton Rheutan <rheutan7@gmail.com>
- The path clipping / transforming behaviour must be turned-off
when we are not using direct_functions as is used in
faas-nomad and faas-ecs. This will need a change in each provider
to strip paths, but fixes a 404 error these users will see if they
upgrade to 0.9.2 or newer. 0.9.3 will have a this fix meaning
the whole un-edited path is passed to the provider when
direct_functions is set to false.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
- This commit moves us to faas-swarm 0.4.2 which uses basic auth
(when enabled) to prevent functions or other services from
accessing the administrative API endpoints.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
Bumping gateway to latest 0.9.2 release for docker-compose.yml
and docker-compose-armhf.yml files
Signed-off-by: Martin Dekov (VMware) <mdekov@vmware.com>
This means any repos which redirect here will pick up the standard
openfaas/faas guide instead of pointing to their local variant.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
- remove http client host override fix#847
- X-Forwarded-For and X-Forwarded-Host are usually handled by the ingress
controller, if those headers are not set then the gateway will create them
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Also, adjusted the previously added Chinese video to
retain the Chinese title and placed it in order
Signed-off-by: Burton Rheutan <rheutan7@gmail.com>
This commit adds basic authentication for `/system/async-report`
endpoint.
It also adds basic-auth secrets to `queue-worker` service which will be
used for gateway calls to `/system/async-report`.
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
Move Python example to use "return" and to use string formatting.
Tested example on Docker Swarm.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
The basic-auth middleware and credentials-loading code has been
moved into the faas-provider project. This has now been brought
back into the faas project via vendoring.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
Convert all sample-functions to use curl to get the watchdog as
it can be cached by Docker. Issue #841
Signed-off-by: Radoslav Dimitrov <rdimitrow@gmail.com>
Convert all sample-functions to use curl to get the watchdog as
it can be cached by Docker. Issue #841
Signed-off-by: Radoslav Dimitrov <rdimitrow@gmail.com>
Convert all sample-functions to use curl to get the watchdog as
it can be cached by Docker. Issue #841
Signed-off-by: Radoslav Dimitrov <rdimitrow@gmail.com>
Convert all sample-functions to use curl to get the watchdog as
it can be cached by Docker. Issue #841
Signed-off-by: Radoslav Dimitrov <rdimitrow@gmail.com>
Code-review/refactoring for #843. Closes#843.
FaaSHandlers has had info and query handlers added to its list
of types for consistency.
Secrets added to queue-worker component ready for next PR.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This changeset enables passing the basic auth credentials
to all /system/ calls to allow upstream providers to
perform authorization checks independent of the gateway.
This is essential for some providers, like Swarm, where
the system is accessible on the same network, and not
protected via the gateway
Signed-off-by: Burton Rheutan <rheutan7@gmail.com>
This updates the 2018 meetup event section to add an event for September 12th, 2018 in Sydney Australia.
Signed-off-by: James McAfee <mcafeej@vmware.com>
The scaling endpoint supports POST method, but in Swagger it was
documented with GET instead. Also bumped up the gateway version
to 0.8.12
Signed-off-by: Ivana Yovcheva (VMware) <iyovcheva@vmware.com>