From eec8baed22275233883067ec16c20d4af1c05eea Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Sun, 15 Oct 2023 19:16:45 +0200 Subject: [PATCH] gitea-runner and registry-ui --- _sys/traefik.hcl | 6 +++- apps/docker-registry/live-ui.hcl | 61 ++++++++++++++++++++++++++++++++ apps/gitea/live-runners.hcl | 3 +- apps/gitea/volume-runner.hcl | 21 +++++++++++ apps/homeassistant/live.hcl | 2 +- apps/nodered/live.hcl | 60 +++++++++++++++++++++++++++++++ apps/nodered/volume.hcl | 20 +++++++++++ 7 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 apps/docker-registry/live-ui.hcl create mode 100644 apps/gitea/volume-runner.hcl create mode 100644 apps/nodered/live.hcl create mode 100644 apps/nodered/volume.hcl diff --git a/_sys/traefik.hcl b/_sys/traefik.hcl index 0320760..9ff8b83 100644 --- a/_sys/traefik.hcl +++ b/_sys/traefik.hcl @@ -52,7 +52,7 @@ job "traefik" { config { image = "docker.io/library/traefik:latest" network_mode = "host" - + volumes = [ "local/traefik.toml:/etc/traefik/traefik.toml", ] @@ -78,6 +78,10 @@ job "traefik" { [providers.consulCatalog.endpoint] address = "127.0.0.1:8500" scheme = "http" +[metrics] + [metrics.prometheus] + buckets = [0.1,0.3,1.2,5.0] + addServicesLabels = true EOF destination = "local/traefik.toml" diff --git a/apps/docker-registry/live-ui.hcl b/apps/docker-registry/live-ui.hcl new file mode 100644 index 0000000..419f4c1 --- /dev/null +++ b/apps/docker-registry/live-ui.hcl @@ -0,0 +1,61 @@ +job "docker-registry-ui" { + datacenters = [ + "nummer5", + ] + type = "service" + + group "apps" { + count = 1 + + network { + mode = "host" + port "http" { + to = 80 + } + } + + service { + name = "cr-ui" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.cr-ui.rule=Host(`cr-ui.service.nr5`)", + ] + } + + restart { + attempts = 5 + delay = "30s" + } + + task "docker-registry-ui" { + driver = "podman" + config { + image = "docker.io/joxit/docker-registry-ui:main" + ports = ["http"] + } + + env { + DELETE_IMAGES = "true" + REGISTRY_TITLE = "Nummer5 Reg" + NGINX_PROXY_PASS_URL_DISABLED = "http://cr.wks" + REGISTRY_URL = "http://cr.wks" + SINGLE_REGISTRY = "true" + SHOW_CONTENT_DIGEST = "true" + SHOW_CATALOG_NB_TAGS = "true" + CATALOG_MIN_BRANCHES = "1" + CATALOG_MAX_BRANCHES = "1" + TAGLIST_PAGE_SIZE = "100" + REGISTRY_SECURED = "false" + CATALOG_ELEMENTS_LIMIT = "1000" + } + + resources { + cpu = 100 + memory = 64 + } + + } + } +} \ No newline at end of file diff --git a/apps/gitea/live-runners.hcl b/apps/gitea/live-runners.hcl index 2bc8092..34696d0 100644 --- a/apps/gitea/live-runners.hcl +++ b/apps/gitea/live-runners.hcl @@ -34,7 +34,8 @@ job "gitea-runner" { config { image = "docker.io/gitea/act_runner:nightly" volumes = [ - "/var/run/podman/podman.sock:/var/run/docker.sock" + "/var/run/podman/podman.sock:/var/run/docker.sock", + "/etc/containers:/etc/containers" ] } diff --git a/apps/gitea/volume-runner.hcl b/apps/gitea/volume-runner.hcl new file mode 100644 index 0000000..5a68faa --- /dev/null +++ b/apps/gitea/volume-runner.hcl @@ -0,0 +1,21 @@ +type = "csi" +id = "gitea-runner-data" +name = "gitea-runner-data" +plugin_id = "nfs" +external_id = "gitea-runner-data" + +capability { + access_mode = "multi-node-multi-writer" + attachment_mode = "file-system" +} + +context { + server = "ebin02.wks" + share = "/data/raid1-ssd/app-data/gitea-runner-data" + mountPermissions = "0" +} + +mount_options { + fs_type = "nfs" + mount_flags = [ "timeo=30", "vers=3", "_netdev" , "nolock" ] +} \ No newline at end of file diff --git a/apps/homeassistant/live.hcl b/apps/homeassistant/live.hcl index e4aa8e1..7f2d61c 100644 --- a/apps/homeassistant/live.hcl +++ b/apps/homeassistant/live.hcl @@ -19,7 +19,7 @@ job "homeassistant" { tags = [ "traefik.enable=true", - "traefik.http.routers.hassio.rule=Host(`hassio.nr5`)", + "traefik.http.routers.hassio.rule=Host(`hassio.service.nr5`)", ] } diff --git a/apps/nodered/live.hcl b/apps/nodered/live.hcl new file mode 100644 index 0000000..1f6b38e --- /dev/null +++ b/apps/nodered/live.hcl @@ -0,0 +1,60 @@ +job "nodered" { + datacenters = [ + "nummer5", + ] + type = "service" + + group "apps" { + count = 1 + + network { + mode = "host" + port "http" { + to = 1880 + } + } + + service { + name = "nodered" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.nodered.rule=Host(`nodered.service.nr5`)", + ] + } + + volume "nodered" { + type = "csi" + source = "nodered" + read_only = false + access_mode = "single-node-writer" + attachment_mode = "file-system" + } + + restart { + attempts = 5 + delay = "60s" + } + + task "nodered" { + driver = "podman" + volume_mount { + volume = "nodered" + destination = "/data" + read_only = false + } + + config { + image = "docker.io/nodered/node-red:latest" + ports = ["http"] + } + + resources { + cpu = 400 + memory = 128 + } + + } + } +} \ No newline at end of file diff --git a/apps/nodered/volume.hcl b/apps/nodered/volume.hcl new file mode 100644 index 0000000..5ca8523 --- /dev/null +++ b/apps/nodered/volume.hcl @@ -0,0 +1,20 @@ +type = "csi" +id = "nodered" +name = "nodered" +plugin_id = "nfs" + +capability { + access_mode = "single-node-writer" + attachment_mode = "file-system" +} + +context { + server = "ebin01.wks" + share = "/data/raid1-ssd/app-data/nodered" + mountPermissions = "0" +} + +mount_options { + fs_type = "nfs" + mount_flags = [ "timeo=30", "vers=3", "_netdev" , "nolock" ] +} \ No newline at end of file