Skip to content

Commit

Permalink
Deploy basic auth plugin
Browse files Browse the repository at this point in the history
As part of #1209, this change deploys, but does not enable the
new basic-auth plugin service.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Jun 6, 2019
1 parent 03ebf16 commit 6d8ebc6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deploy_stack.sh
Expand Up @@ -6,6 +6,7 @@ if ! [ -x "$(command -v docker)" ]; then
fi fi


export BASIC_AUTH="true" export BASIC_AUTH="true"
export AUTH_URL="http://basic-auth-plugin:8080/validate"


sha_cmd="shasum -a 256" sha_cmd="shasum -a 256"
if ! command -v shasum >/dev/null; then if ! command -v shasum >/dev/null; then
Expand All @@ -17,6 +18,7 @@ do
case "$1" in case "$1" in
--no-auth | -n) --no-auth | -n)
export BASIC_AUTH="false" export BASIC_AUTH="false"
export AUTH_URL=""
;; ;;
--help | -h) --help | -h)
echo "Usage: \n [default]\tdeploy the OpenFaaS core services\n --no-auth [-n]\tdisable basic authentication.\n --help\tdisplays this screen" echo "Usage: \n [default]\tdeploy the OpenFaaS core services\n --no-auth [-n]\tdisable basic authentication.\n --help\tdisplays this screen"
Expand Down
30 changes: 29 additions & 1 deletion docker-compose.yml
Expand Up @@ -3,7 +3,7 @@ services:
gateway: gateway:
ports: ports:
- 8080:8080 - 8080:8080
image: openfaas/gateway:0.12.0 image: openfaas/gateway:0.13.6
networks: networks:
- functions - functions
environment: environment:
Expand All @@ -21,6 +21,8 @@ services:
scale_from_zero: "true" # Enable if you want functions to scale from 0/0 to min replica count upon invoke scale_from_zero: "true" # Enable if you want functions to scale from 0/0 to min replica count upon invoke
max_idle_conns: 1024 max_idle_conns: 1024
max_idle_conns_per_host: 1024 max_idle_conns_per_host: 1024
auth_proxy_url: "${AUTH_URL:-}"
auth_proxy_pass_body: "false"
deploy: deploy:
resources: resources:
# limits: # Enable if you want to limit memory usage # limits: # Enable if you want to limit memory usage
Expand All @@ -39,6 +41,32 @@ services:
- basic-auth-user - basic-auth-user
- basic-auth-password - basic-auth-password


# auth service provide basic-auth plugin for system APIs
basic-auth-plugin:
image: openfaas/basic-auth-plugin:0.1.0
networks:
- functions
environment:
secret_mount_path: "/run/secrets/"
deploy:
placement:
constraints:
- "node.role == manager"
- "node.platform.os == linux"
resources:
# limits: # Enable if you want to limit memory usage
# memory: 100M
reservations:
memory: 50M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 20
window: 380s
secrets:
- basic-auth-user
- basic-auth-password

# Docker Swarm provider # Docker Swarm provider
faas-swarm: faas-swarm:
volumes: volumes:
Expand Down

0 comments on commit 6d8ebc6

Please sign in to comment.