454 Commits

Author SHA1 Message Date
David Muckle
5824d865c6 Add a title to the index.html for the gateway
This will replace the gateway URL showing up as the title.

Signed-off-by: David Muckle <dvdmuckle@dvdmuckle.xyz>
2018-03-23 16:38:19 +00:00
John McCabe
fac3345668 Use http package consts for http methods
This commit replaces occurences of http method strings with the
corresponding consts from the http package.

*Note* UPDATE is not strictly speaking a valid method and as such isn't
part of the http package (should be a PUT or PATCH?)

Signed-off-by: John McCabe <john@johnmccabe.net>
2018-03-23 16:37:33 +00:00
Alex Ellis
0c7e59fe8a Add direct_functions mode to gateway for tuning
Adds a pair of configuration options for performance tuning. The
gateway can now invoke functions directly and can bypass the
provider. See updated table in README.md for configuration values.

BaseURLResolver is added with unit tests that decouples resolving
upstream URL from the reverse proxy client code.

- SingleHostBaseURLResolver resolves a single upstream host
- FunctionAsHostBaseURLResolver resolves host based upon conventions
within the URL of the request to a function for direct access

Tested with Kubernetes (faas-netes) and faas-swarm through UI, CLI
calling system endpoints and functions directly.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-23 16:35:37 +00:00
Alex Ellis (VMware)
c716c54868 Break out logging / metrics for functions in forwarding_proxy
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-20 09:51:42 +00:00
Alex Ellis
3897d1f54e Bump swarm versions
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-13 17:30:28 +00:00
Ken Fukuyama
7d860bff41 fixed unexpected behavior where the selected function properties don't get
updated after adding/deleting a different function.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-08 22:30:45 +01:00
Ken Fukuyama
02642ffb3f Edited unnecessary fields and $scopes.
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
b9d705ebd4 UI: in-line ready directive
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
a8d91590ab UI: fix ng-model complaint
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
ccfb8f7be4 Make UI block until function reports readiness
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
37ef024df7 Proxy fix - copy request headers into upstream
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-05 15:31:25 +00:00
Alex Ellis
6efaee5b4f Add upstream_timeout as env-var
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-05 12:49:25 +00:00
Alex Ellis
30928739ee Use context for upstream timeouts
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-05 12:49:25 +00:00
Ken Fukuyama
4cc51adffb added missing return statement
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-03 17:41:56 +00:00
Ken Fukuyama
d96674468c fixed another missing closing tag.
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-03 17:41:56 +00:00
Ken Fukuyama
a6a657295f fixed ES6 syntax accidentally used in JavaScript.
fixed markup closing typo.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-03 17:41:56 +00:00
Alex Ellis
76526b0be3 Bump LTS Go version
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis
fdc7f08ba2 Pass along status code
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis
7120e4c5f4 Apply comments and naming conventions to HTTP proxy
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis
26e0de3497 Remove Golang reverseproxy and use http Client
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis (VMware)
b67d0526ce Expose function endpoint from underlying provider
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-01 08:34:32 +00:00
Ivan Mikushin
8dd646cf5a Add AvailableReplicas field to requests.Function
Signed-off-by: Ivan Mikushin <imikushin@vmware.com>
2018-03-01 08:26:05 +00:00
Ken Fukuyama
365e348865 upgraded angularjs from 1.5.5 to 1.6.9
The $https service deprecated the `success` method, so changed `success`
to `then`.

This will fix #528

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-02-25 12:07:41 +00:00
Ken Fukuyama
ead18a3059 Fixed UI to use relative paths for ajax requests in order to work with kube proxy.
This fixes issue #519.

Signed-off-by: Ken Fukuyama <fukuyama@supersoftware.co.jp>
2018-02-25 11:55:54 +00:00
Vivek Singh
b12a4d0bf2 adds Go durations for timeout configs
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

applied go fmt on config_test file

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

removes extra line in config_test

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2018-02-10 18:46:23 +00:00
Alex Ellis
6eca86f31e
Update README.md 2018-02-07 09:13:48 +00:00
Alex Ellis
cb1f76a51f Inject arm64 store at build time
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-05 08:42:13 +00:00
Alex Ellis
b79d11d07f Update arm64 Dockerfile
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-04 21:48:25 +00:00
Alex Ellis
ff9f7a5541 Make debugging less verbose
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:37:05 +00:00
Alex Ellis
f954bf0733 Merge master into breakout_swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:29:54 +00:00
Alex Ellis
e8f8231c39
Update README.md 2018-01-28 09:45:59 +00:00
Alex Ellis
262b0afda7 Make gateway compatible with Prometheus 1.0 and 2.0
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-01-13 09:32:49 +00:00
Alex Ellis
f2baa956b5 Add re-direct for ARMHF function store
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-30 09:34:18 +00:00
Alex Ellis
979e44bf8c Escape PromQL query
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-29 16:39:24 +00:00
Lucas Roesler
fe7dd9068f Remove code duplicated during a rebase
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2017-12-16 16:08:52 +00:00
Lucas Roesler
1a055deb49 Add secret management to the update handler
**What**
- Pass secrets to the updateSpec method

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2017-12-16 16:08:52 +00:00
Alex Ellis
7c28f7d97e Add label support to Swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-16 16:08:52 +00:00
Lucas Roesler
35f0e9e657 Clean up docs and refactor createhandler
**What**
- Add a description for the secret key to the api swagger spec.
- Remove optional examples from the secret management guide.
- Update the ApiKeyProtected README to point at the new guide.
- Refactor the `makeSpec` function to accept the already assembled secrets
array because this should be easier to unit test.

Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
2017-12-16 16:08:52 +00:00
Lucas Roesler
5dce1deb21 Add advanced secret management
**What**
- Add the ability to specify secrets as a csv
- Vendor the docker/cli/opts
- Update the guide for secrets to use the `faas-cli`

**Why**
- Allowing the csv specification of secrets gives users more control about how
those secrets are mounted into the container.  This is good for things like
key rotation and for developers that are building on top of OpenFaaS.

Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
2017-12-16 16:08:52 +00:00
Lucas Roesler
0fef825fb4 Add support to specify secrets in services
**What**
- During function creation, accept an array of strings defining swarm secrets
that are required for the service
- Update docs
- Add new guide on using the secrets capability
- Add new sample function to highlight using environment variables
- Update `ApiKeyProtected` sample function to utilize the new secrets
capabilities

**Why**
- This allows secrets to remain encrypted at rest instead of being unencrypted
in environment variables and yaml files.

Fixes #285

Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
2017-12-16 16:08:52 +00:00
Ken Fukuyama
cc103ada94 added repo link to func store. will open repo page on new window or tab
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2017-12-16 16:04:59 +00:00
Eric Stoekl
4d785c8dfb Remove Content-Type forwarding from Request
Signed-off-by: Eric Stoekl <ems5311@gmail.com>
2017-12-16 16:04:20 +00:00
Alex Ellis
3502c67d88 Allow valid UI label values
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 14:29:56 +00:00
Alex Ellis
dc37d131be Don't override X-Call-Id if it already exists in header
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:18:44 -08:00
Alex Ellis
b1e92f6b93 Add call-id via middleware
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:18:44 -08:00
Alex Ellis
e6eec64c0d UI: allow binary download
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:17:51 -08:00
Alex Ellis
5c8bb37bfb Experimental UI download
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:17:51 -08:00
Alex Ellis
ca34fd0ed1 Adds env-vars to store
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-12 06:51:04 -08:00
Alex Ellis
3d210f1ff2 Extract handler_set.go
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00
Alex Ellis
23a7187435 Refactoring: variable names, adding tests and http constants
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00