Add TLS enabled comms to the swarm

This commit is contained in:
Luke Murphy 2020-04-28 14:46:09 +02:00
parent 166cf8cd4c
commit 8bd55ac322
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,8 @@
STACK := traefik
COMPOSE_FILE := docker-compose.yml
CONFIG := $$HOME/.docker
NETWORK := proxy
STACK := traefik
SWARM_URL := tcp://swarm.autonomic.zone:2376
default: deploy
@ -16,4 +18,14 @@ network:
logs:
@docker service logs -f $(STACK)_$(STACK)
.PHONY: deploy
config:
mkdir -vp $(CONFIG) && \
pass show docker/swarm.autonomic.zone/ca.pem > $(CONFIG)/ca.pem && \
pass show docker/swarm.autonomic.zone/cert.pem > $(CONFIG)/cert.pem && \
pass show docker/swarm.autonomic.zone/key.pem > $(CONFIG)/key.pem
context:
@docker context create swarm.autonomic.zone --docker \
"host=$(SWARM_URL),ca=$(CONFIG)/ca.pem,cert=$(CONFIG)/cert.pem,key=$(CONFIG)/key.pem"
.PHONY: deploy down network logs context