Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfaas-faas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
openfaas-faas
Commits
ab1e9134
Commit
ab1e9134
authored
7 years ago
by
Jono
Committed by
Alex Ellis
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updating Kong to use the same network as FaaS
Signed-off-by:
Jono
<
jono@foodnotblogs.com
>
parent
13852a93
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
guide/kong_integration.md
+17
-18
17 additions, 18 deletions
guide/kong_integration.md
with
17 additions
and
18 deletions
guide/kong_integration.md
+
17
−
18
View file @
ab1e9134
...
...
@@ -18,20 +18,20 @@ Below is a demo of how you could use Kong as an authentication layer for OpenFaa
## Setup Kong
docker run -d --name kong-database \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
postgres:9.4
docker run --rm \
--link kong-database:kong-database \
docker service create --network func_functions --detach=false \
--name kong-database \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
postgres:9.4
docker service create --network func_functions --detach=false \
--restart-condition=none --name=kong-migrations \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
kong:latest kong migrations up
docker run -d --name kong \
--link kong-database:kong-database \
docker service create --network func_functions --name kong \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
...
...
@@ -45,20 +45,19 @@ Below is a demo of how you could use Kong as an authentication layer for OpenFaa
kong:latest
## Get a route to the OpenFaaS server
FAASTHOST=`hostname -i`
## Put Kong in front of a single function
sleep 5 # wait for Kong to be ready
echo Waiting for Kong to be ready
until $(curl --output /dev/null --silent --head --fail http://localhost:8001); do
printf '.'
sleep 2
done
curl -i -X POST \
--url http://localhost:8001/apis/ \
--data 'name=echoit' \
--data 'uris=/echo' \
--data 'upstream_url=http://
'$FAASTHOST'
:8080/function/func_echoit'
--data 'upstream_url=http://
gateway
:8080/function/func_echoit'
curl localhost:8000/echo -d 'hello there'
...
...
@@ -68,7 +67,7 @@ Below is a demo of how you could use Kong as an authentication layer for OpenFaa
--url http://localhost:8001/apis/ \
--data 'name=functions' \
--data 'uris=/functs' \
--data 'upstream_url=http://
'$FAASTHOST'
:8080/function'
--data 'upstream_url=http://
gateway
:8080/function'
curl localhost:8000/functs/func_echoit -d 'hello there'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment