From 4230fabf2086eaf43e2e360c2a528feb13e9037e Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sun, 4 Dec 2022 13:29:14 -0500 Subject: [PATCH] Chore/remove kong (#14) * chore: remove kong * docs: traefik readme fix: leftover task --- README.md | 2 +- deluge/docker-compose.yml | 2 +- kong/README.md | 5 ----- kong/docker-compose.yml | 25 ------------------------- kong/kong.yml | 21 --------------------- kong/tasks.py | 29 ----------------------------- tasks.py | 5 +++-- traefik/README.md | 15 +++++++++++++++ traefik/docker-compose.yml | 3 +-- 9 files changed, 21 insertions(+), 86 deletions(-) delete mode 100644 kong/README.md delete mode 100644 kong/docker-compose.yml delete mode 100644 kong/kong.yml delete mode 100644 kong/tasks.py create mode 100644 traefik/README.md diff --git a/README.md b/README.md index df6da9f..3086182 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ |---|---| |[Plex](./plex)|Plex media server| |[Deluge](./deluge)|Deluge Web service| -|[Kong](./kong)|Kong API Gateway| +|[Traefik](./traefik)|Traefik API Gateway| ## Getting started diff --git a/deluge/docker-compose.yml b/deluge/docker-compose.yml index c4b540f..c0bc2c2 100644 --- a/deluge/docker-compose.yml +++ b/deluge/docker-compose.yml @@ -25,5 +25,5 @@ services: - traefik.enable=true networks: default: - name: kong-net + name: web external: true diff --git a/kong/README.md b/kong/README.md deleted file mode 100644 index 20bd37a..0000000 --- a/kong/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Kong Service - -API Gateway to Spadinaistan. - -Hit `:8000/` to access services hosted on Spadinaistan! diff --git a/kong/docker-compose.yml b/kong/docker-compose.yml deleted file mode 100644 index 4911d3e..0000000 --- a/kong/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: '3.7' -services: - plex: - image: kong:3.0.0 - restart: always - container_name: kong-service - environment: - - KONG_DATABASE=off - - KONG_DECLARATIVE_CONFIG=/kong/declarative/kong.yml - - KONG_PROXY_ACCESS_LOG=/dev/stdout - - KONG_ADMIN_ACCESS_LOG=/dev/stdout - - KONG_PROXY_ERROR_LOG=/dev/stdout - - KONG_ADMIN_ERROR_LOG=/dev/stdout - - KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl - volumes: - - $PWD:/kong/declarative - ports: - - 8000:8000 - - 8443:8443 - - 8001:8001 - - 8444:8444 - -networks: - default: - name: kong-net diff --git a/kong/kong.yml b/kong/kong.yml deleted file mode 100644 index 6f38951..0000000 --- a/kong/kong.yml +++ /dev/null @@ -1,21 +0,0 @@ - _format_version: "3.0" - _transform: true - - services: - - host: 172.17.0.1 - name: deluge - port: 8112 - protocol: http - routes: - - name: deluge - paths: - - /deluge/ - strip_path: true - - plugins: - - name: request-transformer - route: deluge - config: - add: - headers: - - X-Deluge-Base:/deluge/ diff --git a/kong/tasks.py b/kong/tasks.py deleted file mode 100644 index fe2b463..0000000 --- a/kong/tasks.py +++ /dev/null @@ -1,29 +0,0 @@ -import invoke -import pathlib - -PATH = pathlib.Path(__file__).parent - - -@invoke.task() -def start(ctx): - with ctx.cd(PATH): - ctx.run("docker-compose up -d") - - -@invoke.task() -def stop(ctx): - with ctx.cd(PATH): - ctx.run("docker-compose down") - - -@invoke.task() -def restart(ctx): - with ctx.cd(PATH): - ctx.run("docker-compose restart") - - -ns = invoke.Collection("kong") - -ns.add_task(start) -ns.add_task(restart) -ns.add_task(stop) diff --git a/tasks.py b/tasks.py index 389ad08..c62993d 100644 --- a/tasks.py +++ b/tasks.py @@ -2,7 +2,7 @@ import invoke import plex.tasks import deluge.tasks -import kong.tasks +import traefik.tasks ns = invoke.Collection() @@ -25,6 +25,7 @@ server.add_task(system_updates, name="update") server.add_task(system_reboot, name="reboot") ns.add_collection(plex.tasks.ns) + +ns.add_collection(traefik.tasks.ns) ns.add_collection(deluge.tasks.ns) -ns.add_collection(kong.tasks.ns) ns.add_collection(server) diff --git a/traefik/README.md b/traefik/README.md new file mode 100644 index 0000000..45b4b6b --- /dev/null +++ b/traefik/README.md @@ -0,0 +1,15 @@ +# Traefik + +[Traefik](https://traefik.io/) is a proxy / API Gateway. + +## Setup + +`inv traefik.start` will start the service. + +When initializing for the first time, you should first `touch acme.json` and `chmod 600 acme.json` to ensure that the +certificate can be created and accessed by Traefik properly. + +## Adding services + +Adding services is done via Docker Compose labels. Any service with the `traefik.enable` label will be picked up by the +gateway. diff --git a/traefik/docker-compose.yml b/traefik/docker-compose.yml index 2a32014..2f1217e 100644 --- a/traefik/docker-compose.yml +++ b/traefik/docker-compose.yml @@ -15,5 +15,4 @@ services: networks: default: - name: kong-net - external: true + name: web