[add swarmpit]
This commit is contained in:
99
swarm.yml
99
swarm.yml
@@ -87,10 +87,15 @@
|
|||||||
|
|
||||||
- name: Create volume
|
- name: Create volume
|
||||||
community.docker.docker_volume:
|
community.docker.docker_volume:
|
||||||
name: portainer_data
|
name: "{{ item }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
loop:
|
||||||
|
# - portainer_data
|
||||||
|
- db-data
|
||||||
|
- influx-data
|
||||||
when: inventory_hostname in groups['docker_swarm_manager']
|
when: inventory_hostname in groups['docker_swarm_manager']
|
||||||
|
|
||||||
|
|
||||||
- name: Create secret (from a file on the control machine)
|
- name: Create secret (from a file on the control machine)
|
||||||
community.docker.docker_secret:
|
community.docker.docker_secret:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
@@ -302,6 +307,92 @@
|
|||||||
networks:
|
networks:
|
||||||
- public
|
- public
|
||||||
|
|
||||||
|
monitor:
|
||||||
|
image: swarmpit/swarmpit:latest
|
||||||
|
environment:
|
||||||
|
- SWARMPIT_DB=http://db:5984
|
||||||
|
- SWARMPIT_INFLUXDB=http://influxdb:8086
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
networks:
|
||||||
|
- agent_network
|
||||||
|
- public
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.50'
|
||||||
|
memory: 1024M
|
||||||
|
reservations:
|
||||||
|
cpus: '0.25'
|
||||||
|
memory: 512M
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.docker.network=public
|
||||||
|
- traefik.constraint-label=public
|
||||||
|
- traefik.http.routers.swarmpit-http.rule=Host(`swarm01.jingoh.private`)
|
||||||
|
- traefik.http.routers.swarmpit-http.entrypoints=http
|
||||||
|
- traefik.http.routers.swarmpit-http.middlewares=https-redirect
|
||||||
|
- traefik.http.routers.swarmpit-https.rule=Host(`swarw01.jingoh.private`)
|
||||||
|
- traefik.http.routers.swarmpit-https.entrypoints=https
|
||||||
|
- traefik.http.routers.swarmpit-https.tls=true
|
||||||
|
- traefik.http.services.swarmpit.loadbalancer.server.port=8080
|
||||||
|
- "traefik.http.routers.swarmpit-https.middlewares=privatevpn"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: couchdb:2.3.1
|
||||||
|
volumes:
|
||||||
|
- db-data:/opt/couchdb/data
|
||||||
|
networks:
|
||||||
|
- agent_network
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.30'
|
||||||
|
memory: 512M
|
||||||
|
reservations:
|
||||||
|
cpus: '0.15'
|
||||||
|
memory: 256M
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
influxdb:
|
||||||
|
image: influxdb:1.7
|
||||||
|
volumes:
|
||||||
|
- influx-data:/var/lib/influxdb
|
||||||
|
networks:
|
||||||
|
- agent_network
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
cpus: '0.3'
|
||||||
|
memory: 128M
|
||||||
|
limits:
|
||||||
|
cpus: '0.6'
|
||||||
|
memory: 512M
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
agent:
|
||||||
|
image: swarmpit/agent:latest
|
||||||
|
environment:
|
||||||
|
- DOCKER_API_VERSION=1.35
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
networks:
|
||||||
|
- agent_network
|
||||||
|
deploy:
|
||||||
|
mode: global
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.10'
|
||||||
|
memory: 64M
|
||||||
|
reservations:
|
||||||
|
cpus: '0.05'
|
||||||
|
memory: 32M
|
||||||
|
|
||||||
# forward-auth:
|
# forward-auth:
|
||||||
# image: thomseddon/traefik-forward-auth:2.2.0
|
# image: thomseddon/traefik-forward-auth:2.2.0
|
||||||
# environment:
|
# environment:
|
||||||
@@ -337,8 +428,10 @@
|
|||||||
external: true
|
external: true
|
||||||
attachable: true
|
attachable: true
|
||||||
volumes:
|
volumes:
|
||||||
portainer_data:
|
db-data:
|
||||||
|
driver: local
|
||||||
|
influx-data:
|
||||||
|
driver: local
|
||||||
|
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
|
|||||||
Reference in New Issue
Block a user