From 8bd55ac3220e7864020534c0b5dda6b32efbd4bb Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 28 Apr 2020 14:46:09 +0200 Subject: [PATCH] Add TLS enabled comms to the swarm --- Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dc5f9ee..8d38f23 100644 --- a/Makefile +++ b/Makefile @@ -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