-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
113 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# You must set | ||
# /usr/local/openresty/nginx/conf/elastic_passwords and | ||
# /usr/local/openresty/nginx/conf/kibana_passwords | ||
|
||
|
||
NAME="netcomposer/elastic-proxy:0" | ||
docker build -t $NAME . && docker push $NAME | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
daemon off; | ||
|
||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
default_type application/octet-stream; | ||
sendfile on; | ||
#tcp_nopush on; | ||
#keepalive_timeout 0; | ||
keepalive_timeout 65; | ||
|
||
upstream elastic { | ||
server elastic:9200; | ||
keepalive 15; | ||
} | ||
|
||
upstream kibana { | ||
server kibana:5601; | ||
keepalive 15; | ||
} | ||
|
||
# Internal proxy for ES | ||
server { | ||
listen 9200; | ||
location / { | ||
proxy_pass http://elastic; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection "Keep-Alive"; | ||
proxy_set_header Proxy-Connection "Keep-Alive"; | ||
} | ||
} | ||
|
||
# External proxy for ES | ||
server { | ||
listen 9201; | ||
location / { | ||
auth_basic "NetComposer Site"; | ||
auth_basic_user_file elastic_passwords; | ||
proxy_pass http://elastic; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection "Keep-Alive"; | ||
proxy_set_header Proxy-Connection "Keep-Alive"; | ||
} | ||
} | ||
|
||
server { | ||
listen 9202; | ||
location / { | ||
auth_basic "NetComposer Site"; | ||
auth_basic_user_file kibana_passwords; | ||
proxy_pass http://kibana; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection "Keep-Alive"; | ||
proxy_set_header Proxy-Connection "Keep-Alive"; | ||
} | ||
} | ||
|
||
|
||
} |
0
openresty/build/profile.sh → proxy/build/profile.sh
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
cp /run/secrets/elastic_passwords /usr/local/openresty/nginx/conf/elastic_passwords | ||
cp /run/secrets/kibana_passwords /usr/local/openresty/nginx/conf/kibana_passwords | ||
exec /usr/local/openresty/bin/openresty |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
IMAGE=netcomposer/elastic-proxy:0 | ||
|
||
docker service create \ | ||
--constraint 'node.hostname==k1.netc.io' \ | ||
--name elastic_proxy \ | ||
--network elastic \ | ||
--secret elastic_passwords \ | ||
--secret kibana_passwords \ | ||
-p 9201:9201 \ | ||
-p 9202:9202 \ | ||
--mount type=bind,src=/etc/letsencrypt,dst=/etc/letsencrypt:ro \ | ||
$IMAGE | ||
|
||
# --restart unless-stopped \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
EP=elastic_passwords | ||
KP=kibana_passwords | ||
|
||
docker secret rm $EP > /dev/null 2>&1 | ||
docker secret rm $KP > /dev/null 2>&1 | ||
PASS=$(openssl passwd $1) | ||
echo "user:$PASS" | docker secret create $EP && \ | ||
echo "user:$PASS" | docker secret create $KP && \ | ||
docker service update --secret-add $EP --secret-add $KP elastic_proxy |