This adds the function_namespace environment variable to the gateway
container. This is used for metrics in prometheus.
Tested this config setting in a multipass instance and now the metrics
are updating on the gateway UI and CLI. Before this the metrics were
entering the prom series with "fn-name" and being retrieved with
"fn-name.namespace" and therefore there were always 0 invocations seen.
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
This commit adds fprocess to the return values from faasd provider
/system/functions and /system/function/{name}
This has unit tests and has been tested on a faasd installation
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
This commit adds the EnvVars set on the process to the retuurn from the
faasd provider. It gets the container process and then filters out PATH
and fprocess (if found) and returns the remaining envVars as a map.
This has using tests for getting the EnvVars from procees.env and has
been tested on amd_64 faasd by building, deploying and using curl
against the provider and gateway.
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
As per the other OpenFaaS projects, faasd is moving to Go 1.15
The primary Go module is also being migrated to 1.15
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit allows the provider to return a list of the names of the
secrets mapped into an openfaas function. This was tested by building
and deploying faasd on multipass and curling the provider directly and
seeing the returned secrets list!
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
Pin scripts and automation to the latest version of faasd
which moves to use the openfaas namespace for the core
services instead of default.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
All services like docker and k8s.io use their own namespaces
for core services, this change moves openfaas services into
the openfaas namespace instead of the default one.
The main change is that logs will look like:
journalctl -t openfaas:gateway
Instead of "default:gateway"
Function logs will remain unaffected and scheduled in the
openfaas-fn namespace.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Custom containers in the compose file can have a directory
mounted to store state for things like a database. This requires
a specific user since influxdb/postgresql and other containers
create folders and update permissions on start-up.
Tested with influxdb on Ubuntu with userid 1000, which failed
before the change.
Adds a grace period in the e2e tests.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The update flow used to delete the active function before
synchronously pulling the next and starting it. That meant
functions would always face downtime during the pull.
This changes the order to pre-pull and reduce any down time.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
By moving to a reference instead of a value type, this patch
means the annotations are not leaked into other objects in
the result of ListFunctions. Tested on x86 with a Linux host
and I could no longer reproduce the issue in #128
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Provide support for annotations in faasd with namespaced container
labels. Unit tested and confirmed with end to end test via faasd
deployed to multipass VM
Signed-off-by: Alex Tomic <atomic777@gmail.com>