Support swarm without haproxy.
This commit is contained in:
parent
1c4826b3e8
commit
65b1c019c5
|
@ -28,9 +28,11 @@ shinyproxy_log_retention: 10
|
||||||
shinyproxy_default_apps: True
|
shinyproxy_default_apps: True
|
||||||
# Shinyproxy as docker service
|
# Shinyproxy as docker service
|
||||||
shinyproxy_docker_image: 'openanalytics/shinyproxy:latest'
|
shinyproxy_docker_image: 'openanalytics/shinyproxy:latest'
|
||||||
|
shinyproxy_as_docker_stack_name: 'shinyproxy'
|
||||||
shinyproxy_as_docker_service_name: 'shinyproxy'
|
shinyproxy_as_docker_service_name: 'shinyproxy'
|
||||||
shinyproxy_as_docker_src_dir: /srv/{{ shinyproxy_as_docker_service_name }}_service
|
shinyproxy_as_docker_src_dir: /srv/{{ shinyproxy_as_docker_stack_name }}_service
|
||||||
shinyproxy_docker_network: 'shinyproxy'
|
shinyproxy_docker_network: 'shinyproxy'
|
||||||
|
shinyproxy_docker_swarm_behind_haproxy: True
|
||||||
shinyproxy_docker_swarm_replicas: 1
|
shinyproxy_docker_swarm_replicas: 1
|
||||||
shinyproxy_docker_mount_conf_file: True
|
shinyproxy_docker_mount_conf_file: True
|
||||||
shinyproxy_docker_log_to_journal: True
|
shinyproxy_docker_log_to_journal: True
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
- name: Start the shinyproxy stack
|
- name: Start the shinyproxy stack
|
||||||
docker_stack:
|
docker_stack:
|
||||||
name: shinyproxy
|
name: '{{ shinyproxy_as_docker_stack_name }}'
|
||||||
state: present
|
state: present
|
||||||
compose:
|
compose:
|
||||||
- '{{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml'
|
- '{{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml'
|
||||||
|
|
|
@ -85,7 +85,7 @@ proxy:
|
||||||
{% if shinyproxy_as_docker_service %}
|
{% if shinyproxy_as_docker_service %}
|
||||||
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
||||||
|
|
||||||
container-network: {{ shinyproxy_as_docker_service_name }}_{{ shinyproxy_docker_network }}
|
container-network: {{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_docker_network }}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
{% if shinyproxy_container_backend == 'docker-swarm' and shinyproxy_docker_swarm_behind_haproxy %}
|
||||||
haproxy-public:
|
haproxy-public:
|
||||||
external: true
|
external: true
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -23,6 +23,13 @@ services:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
image: {{ shinyproxy_docker_image }}
|
image: {{ shinyproxy_docker_image }}
|
||||||
|
{% if not shinyproxy_docker_swarm_behind_haproxy %}
|
||||||
|
ports:
|
||||||
|
- {{ shinyproxy_http_port }}:{{ shinyproxy_http_port }}
|
||||||
|
{% if shinyproxy_expose_prometheus and shinyproxy_version is version_compare('2.5.0', '>=') %}
|
||||||
|
- {{ shinyproxy_prometheus_port }}:{{ shinyproxy_prometheus_port }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
@ -37,14 +44,16 @@ services:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
networks:
|
networks:
|
||||||
- {{ shinyproxy_docker_network }}
|
- {{ shinyproxy_docker_network }}
|
||||||
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
{% if shinyproxy_container_backend == 'docker-swarm' and shinyproxy_docker_swarm_behind_haproxy %}
|
||||||
- haproxy-public
|
- haproxy-public
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: {{ shinyproxy_docker_swarm_replicas }}
|
replicas: {{ shinyproxy_docker_swarm_replicas }}
|
||||||
|
{% if shinyproxy_docker_swarm_behind_haproxy %}
|
||||||
endpoint_mode: dnsrr
|
endpoint_mode: dnsrr
|
||||||
|
{% endif %}
|
||||||
placement:
|
placement:
|
||||||
constraints: [node.role == manager]
|
constraints: [node.role == manager]
|
||||||
restart_policy:
|
restart_policy:
|
||||||
|
|
Loading…
Reference in New Issue