added support for load balanced network on external node

This commit is contained in:
dcore94 2021-05-20 17:17:16 +02:00
parent 676cac24ec
commit d9467bf520
6 changed files with 52 additions and 4 deletions

View File

@ -1,5 +1,5 @@
[dev_infra:children]
dev_cluster
[prod_infra:children]
prod_cluster
[dev_cluster]
conductor.dev.d4science.org
[prod_cluster]
docker-swarm1.int.d4science.net docker_swarm_manager_main_node=True

View File

@ -32,3 +32,10 @@
template:
src: templates/pep-swarm.yaml.j2
dest: "{{ target_path }}/pep-swarm.yaml"
- name: Generate pep-docker-swarm when behind HA proxy
when: ha_network is defined and ha_network == True
template:
src: templates/pep-swarm-ha_network.yaml.j2
dest: "{{ target_path }}/pep-swarm.yaml"

View File

@ -0,0 +1,38 @@
version: '3.6'
services:
pep:
image: nginx:stable-alpine
networks:
- conductor-network
- haproxy-public
{% if pep is defined and pep == True %}
volumes:
- "./pep.js:/etc/nginx/pep.js"
- "./config.js:/etc/nginx/config.js"
{% endif %}
deploy:
replicas: 1
placement:
constraints: [node.role != worker]
endpoint_mode: dnsrr
restart_policy:
condition: on-failure
delay: 10s
window: 120s
configs:
- source: nginxconf
target: /etc/nginx/templates/default.conf.template
- source: nginxbaseconf
target: /etc/nginx/nginx.conf
networks:
conductor-network:
haproxy-public:
external: true
configs:
nginxconf:
file: ./nginx.default.conf
nginxbaseconf:
file: ./nginx.conf

View File

@ -10,6 +10,7 @@
iam_host: https://accounts.dev.d4science.org
pep: True
pep_credentials: "{{ dev_pep_credentials }}"
ha_network: True
conductor_ui_secret: "{{ dev_conductor_ui_secret }}"
conductor_auth: oauth2
conductor_server_name: conductor.dev.d4science.org

View File

@ -10,6 +10,7 @@
iam_host: https://accounts.pre.d4science.org
pep: True
pep_credentials: "{{ pre_pep_credentials }}"
ha_network: True
conductor_ui_secret: "{{ pre_conductor_ui_secret }}"
conductor_auth: oauth2
conductor_server_name: conductor.pre.d4science.org

View File

@ -10,6 +10,7 @@
iam_host: https://accounts.d4science.org
pep: True
pep_credentials: "{{ prod_pep_credentials }}"
ha_network: True
conductor_ui_secret: "{{ prod_conductor_ui_secret }}"
conductor_auth: oauth2
conductor_server_name: conductor.d4science.org