Compare commits

...

61 Commits

Author SHA1 Message Date
2ac4fc31a5 ansible is its own repo now 2025-11-17 13:37:05 +01:00
749a2a7d12 docker registry @ ring86 2025-11-17 13:33:47 +01:00
bf7e62ee1d auto02 podman config 2025-08-21 09:57:05 +02:00
b127b9d685 resources 2025-02-12 11:23:41 +01:00
68bd782c14 shuffeling apps around the cluster 2025-02-10 17:33:25 +01:00
fe8f8748df more hosts @wks 2025-02-10 17:33:14 +01:00
46e743b84a consul 2024-12-11 14:10:12 +01:00
075c7170cd podman and nomad stuff
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-11 13:37:02 +01:00
154db99ee3 fixes #18 2024-12-11 13:35:18 +01:00
8c5b879333 fixes #13
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 18:30:28 +01:00
77892d42eb refs #11 at last
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 18:28:06 +01:00
3d3afa337c fixes #11 no java for all
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 18:25:08 +01:00
849190dc98 podman (not sid)
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 18:24:31 +01:00
9cced3f65b fixes #11 no java for all 2024-12-05 18:24:17 +01:00
11db3c60e3 fixes #11 no java for all 2024-12-05 18:24:03 +01:00
6e6cee989e fixes #20
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 18:12:33 +01:00
478aa7f9c9 fixes #16, blacklist modules
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 17:44:02 +01:00
f65f0ff2df fixes #16, blacklist modules 2024-12-05 17:43:53 +01:00
6b825464a3 fixes #31 podman install and config
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-04 12:23:43 +01:00
b5eb5d495d ansible
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-01 11:11:16 +01:00
05c9a5fc2a fixes #27 loading modules, ansible
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-29 13:17:33 +01:00
7073aaf332 apt-cacher volume on ebin01 2024-11-29 12:37:17 +01:00
e8cd8f6239 starlark to the rescue?
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build is passing
2024-10-29 10:43:12 +01:00
41b023d43e starlark to the rescue?
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-10-29 10:40:39 +01:00
aff828d609 Merge branch 'main' of ssh://gitea.service.nr5:2222/chaos/nomad-nummer5
Some checks reported errors
continuous-integration/drone Build encountered an error
2024-10-29 10:36:36 +01:00
7041a58df9 starlark to the rescue? 2024-10-29 10:36:00 +01:00
25a8da26de again
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-13 19:06:39 +02:00
4cd1e9ebd4 mount resolv.conf helps
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-12 12:23:59 +02:00
23e7e4fef2 trying to get hostname resoultion working
Some checks failed
continuous-integration/drone/push Build is failing
2024-09-12 11:48:05 +02:00
f72da1fce2 running on apps host
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-27 18:19:45 +02:00
d297e0be91 attaching podman network
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-27 17:58:38 +02:00
c767a1d2d9 not mounting resolv.conf
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-26 16:49:21 +02:00
2729eedfbe fuck drone
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-26 16:39:27 +02:00
25357e9c2b how to run docker containers on adm
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-26 13:11:15 +02:00
a3caf713c8 not pulling latest 2024-08-26 12:29:56 +02:00
f169e65b3e always updateing gitea
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-14 12:26:54 +02:00
55e8a7566c using debian image from wks
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
2024-04-08 18:45:17 +02:00
366a0b2e42 docker runner uses /var/lib/docker from nfs
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build encountered an error
2024-04-08 18:19:27 +02:00
94e5fc783e testing git diff
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-04-08 18:13:27 +02:00
752eb2c6d7 README
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-04 18:06:03 +02:00
a9bec563c6 yori: sudo ./upgrade
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-25 21:39:45 +01:00
d6dac9bd5c priorities for jobs
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-25 19:48:27 +01:00
65a3a44ea8 openwrt in apps 2024-03-25 19:37:38 +01:00
76c8aa65a1 node_pools for all? 2024-03-25 19:31:58 +01:00
c9172d1ec8 more node pools 2024-03-24 09:25:08 +01:00
34e1f88f6a nodepools 2024-03-24 09:13:38 +01:00
db1bb94627 pools for all? 2024-03-21 21:55:45 +01:00
a8724b8b4f pools _sys def 2024-03-21 21:19:23 +01:00
10bef26628 node pools 2024-03-21 20:58:52 +01:00
043c86ea6f spread for apt-cacher 2024-03-21 20:58:18 +01:00
45698db517 Merge branch 'main' of ssh://gitea.service.nr5:2222/chaos/nomad-nummer5 2024-03-19 12:02:23 +01:00
76ff9b5e2d some ebin docs 2024-03-19 11:41:22 +01:00
a1bbbddfac Update README.md
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-18 10:08:07 +01:00
bb6b978133 createcommand docs
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-18 10:01:22 +01:00
7ffc0fc4e4 gitea not force_pulled
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-05 19:13:57 +01:00
47d878b8d9 nummer5 scripts 2024-03-03 10:11:20 +01:00
6474c60560 Merge branch 'main' of ssh://gitea.service.nr5:2222/chaos/nomad-nummer5
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-28 10:59:12 +01:00
cde92a8c27 openwrt http-server 2024-02-28 10:57:22 +01:00
398c27579b Merge branch 'main' of ssh://gitea.service.nr5:2222/chaos/nomad-nummer5
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-22 14:56:55 +01:00
a859bf3cfa Merge branch 'main' of ssh://gitea.service.nr5:2222/chaos/nomad-nummer5 2023-10-24 18:42:57 +02:00
76812681cb drone CI 2023-10-24 18:42:52 +02:00
31 changed files with 292 additions and 40 deletions

22
.drone.star Normal file
View File

@@ -0,0 +1,22 @@
def main(ctx):
return {
"kind": "pipeline",
"type": "docker",
"name": "nomad-nummer5",
"platform":
{
"os": "linux",
"arch": "arm64"
}
,
"steps": [
{
"name": "git log",
"image": "cr.wks/debian-stable",
"commands": [
"git diff-tree --no-commit-id --name-only HEAD -r"
]
}
]
}

View File

@@ -5,7 +5,13 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>

5
.pydevproject Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
</pydev_project>

View File

@@ -1,20 +1,30 @@
# Datacenter: nummer5
* Packages: podman, kubernetes-cni (from the kubernetes-source)
* Packages: podman, containernetworking-plugins
# Plugins
NFS - https://github.com/thatsk/nfs-csi-nomad/tree/main
Podman - https://github.com/hashicorp/nomad-driver-podman
* NFS - https://github.com/thatsk/nfs-csi-nomad/tree/main
* Podman - https://github.com/hashicorp/nomad-driver-podman
# Hosts:
## Ebin*
* https://docs.oracle.com/en/learn/ol-linux-bonding/#for-additional-information - Bonding with Networkmanager
* u-boot-env: https://forum.armbian.com/topic/35780-with-new-uboot-env-esspressobin-v5-does-not-boot/
## adm01
* ``podman run -d --replace --pull=always --expose=5001 -p 127.0.0.1:5001:5001 --mount=type=bind,source=/etc/docker/registry-cache/config.yml,destination=/etc/docker/registry/config.yml --mount=type=bind,source=/data/container-dr-mirror,destination=/var/lib/registry --tz=Europe/Berlin --name=container-docker-mirror docker.io/library/registry:2``
* ``podman run --restart=always -d --replace --pull=always --expose=5000 -p 5000:5000 --mount=type=bind,source=/etc/docker/registry/config.yml,destination=/etc/docker/registry/config.yml --mount=type=bind,source=/data/container-registry,destination=/var/lib/registry --tz=Europe/Berlin --name=container-registry docker.io/library/registry:2``
# Datacenter: ring86
## Podman tricks
# auto.chaos
* Get CreateCommand: ``podman inspect <containername> --format "{{.Config.CreateCommand}}"``
### auto.chaos
podman run -d --replace -e 1883 -p 1883:1883 --mount=type=bind,source=/etc/mosquitto,destination=/mosquitto --tz=Europe/Berlin --name=mosquitto-mqtt cr.wks/mosquitto:latest
podman run -d --replace -e 9234 -p 0.0.0.0:9234:9234 --tz=Europe/Berlin --name=mosquitto-exporter cr.wks/mosquitto-prometheus-exporter --endpoint "tcp://mqtt:1883"

View File

@@ -7,6 +7,8 @@ variable "datacenters" {
job "plugin-nfs-controller" {
datacenters = var.datacenters
node_pool = "sys"
priority = 100
group "controller" {
task "plugin" {
@@ -35,4 +37,4 @@ job "plugin-nfs-controller" {
}
}
}
}
}

View File

@@ -7,7 +7,8 @@ variable "datacenters" {
job "plugin-nfs-nodes" {
datacenters = var.datacenters
node_pool = "all"
priority = 100
type = "system"
group "nodes" {
@@ -39,4 +40,4 @@ job "plugin-nfs-nodes" {
}
}
}
}
}

7
_sys/pool-apps.hcl Normal file
View File

@@ -0,0 +1,7 @@
node_pool "apps" {
description = "Application Nodes"
meta {
environment = "apps"
}
}

7
_sys/pool-sys.hcl Normal file
View File

@@ -0,0 +1,7 @@
node_pool "sys" {
description = "essential services"
meta {
environment = "sys"
}
}

View File

@@ -2,6 +2,8 @@ job "traefik" {
region = "global"
datacenters = ["nummer5"]
type = "system"
node_pool = "all"
priority = 100
group "traefik" {
#count = 5

View File

@@ -1,6 +1,9 @@
job "apt-cacher-ng" {
datacenters = ["nummer5"]
node_pool = "sys"
priority = 90
group "system" {
count = 1
@@ -9,7 +12,10 @@ job "apt-cacher-ng" {
to = 3142
}
}
spread {
attribute = "${node.unique.id}"
weight = 100
}
service {
name = "apt-cache"
port = "http"

View File

@@ -10,7 +10,7 @@ capability {
}
context {
server = "ebin02.wks"
server = "ebin01.wks"
share = "/data/raid1-ssd/app-data/apt-cacher-ng"
mountPermissions = "0"
}

View File

@@ -3,7 +3,8 @@ job "dmarc" {
"nummer5",
]
type = "service"
node_pool = "apps"
priority = 20
group "apps" {
count = 1
@@ -42,7 +43,7 @@ job "dmarc" {
REPORT_DB_TYPE = "pgsql"
REPORT_DB_HOST = "postgres.service.nr5"
REPORT_DB_PORT = "5432"
REPORT_DB_NAME = "dmarc-srg"
REPORT_DB_NAME = "dmarc"
REPORT_DB_USER = "dmarc"
REPORT_DB_PASS = "4XSS4gKpheSBoMsIs"
PARSER_IMAP_PORT = "143"
@@ -61,4 +62,4 @@ job "dmarc" {
}
}
}
}

View File

@@ -3,6 +3,7 @@ job "docker-registry-ui" {
"nummer5",
]
type = "service"
node_pool = "sys"
group "apps" {
count = 1

View File

@@ -3,6 +3,7 @@ job "drone-runner" {
"nummer5",
]
type = "service"
node_pool = "sys"
group "apps" {
count = 1
@@ -12,12 +13,23 @@ job "drone-runner" {
port "http" {
to = 3000
}
}
volume "drone-runner" {
type = "csi"
source = "drone-runner"
read_only = false
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
service {
name = "drone-runner"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.drone-runner.rule=Host(`drone-runner.service.nr5`)",
]
}
restart {
@@ -30,14 +42,20 @@ job "drone-runner" {
config {
image = "docker.io/drone/drone-runner-docker:latest"
force_pull = true
force_pull = true
ports = ["http"]
privileged = true
volumes = [
"/var/run/podman/podman.sock:/var/run/docker.sock",
"/etc/containers:/etc/containers"
]
}
volume_mount {
volume = "drone-runner"
destination = "/drone"
read_only = false
}
env {
TZ = "Europe/Berlin"
@@ -46,14 +64,21 @@ job "drone-runner" {
DRONE_RPC_HOST = "drone.service.nr5"
DRONE_RPC_PROTO = "http"
DRONE_RUNNER_CAPACITY = 1
DRONE_LOGS_DEBUG = true
DRONE_LOGS_DEBUG = true
DRONE_LOGS_TRACE = true
DRONE_TRACE = true
DOCKER_BUILDKIT = 1
DRONE_GIT_ALWAYS_AUTH = true
DRONE_UI_DISABLE = false
DRONE_UI_USERNAME = "root"
DRONE_UI_PASSWORD = "root"
DRONE_RUNNER_CLONE_IMAGE = "drone/git"
DRONE_RUNNER_VOLUMES = "/etc/resolv.conf:/etc/resolv.conf"
}
resources {
cpu = 300
memory = 1500
cpu = 2000
memory = 1024
}
}

View File

@@ -3,6 +3,8 @@ job "drone" {
"nummer5",
]
type = "service"
node_pool = "apps"
priority = 30
group "apps" {
count = 1
@@ -12,7 +14,6 @@ job "drone" {
port "http" {
to = 80
}
}
service {
@@ -55,6 +56,7 @@ job "drone" {
config {
image = "docker.io/drone/drone:latest"
force_pull = true
ports = ["http"]
}
@@ -63,11 +65,12 @@ job "drone" {
DRONE_GIT_ALWAYS_AUTH = true
DRONE_GITEA_SERVER = "http://gitea.service.nr5"
DRONE_GITEA_CLIENT_ID = "6c48da2c-2748-438e-b776-51f41d3fe607"
DRONE_GITEA_CLIENT_SECRET = "gto_ewohqwympejkb52veheox6doc4juodojyyvph4yf4gekhgtx7zna"
DRONE_GITEA_CLIENT_SECRET = "gto_shthxcqiqutd4f3quejnpefgbedaewfqnnkdi3cfmsdoxjq7qfsq"
DRONE_RPC_SECRET = "7eb685ed81d0c34bafc5efa7783c20b2"
DRONE_SERVER_HOST = "drone.service.nr5"
DRONE_SERVER_PROTO = "http"
DRONE_JSONNET_ENABLED = true
DRONE_STARLARK_ENABLED = true
DRONE_LOGS_DEBUG = true
DRONE_LOGS_TRACE = true
DRONE_USER_CREATE = "username:do,admin:true"

View File

@@ -10,7 +10,7 @@ capability {
}
context {
server = "ebin02.wks"
server = "ebin01.wks"
share = "/data/raid1-ssd/app-data/drone-data"
mountPermissions = "0"
}

View File

@@ -3,6 +3,8 @@ job "gitea" {
"nummer5",
]
type = "service"
node_pool = "apps"
priority = 79
group "apps" {
count = 1
@@ -45,6 +47,7 @@ job "gitea" {
}
restart {
interval = "10m"
attempts = 5
delay = "30s"
}
@@ -59,9 +62,9 @@ job "gitea" {
}
config {
image = "docker.io/gitea/gitea:latest"
image = "docker.io/gitea/gitea"
ports = ["ssh", "http"]
force_pull = true
force_pull = true
}
env {
@@ -87,10 +90,10 @@ job "gitea" {
}
resources {
cpu = 200
cpu = 500
memory = 512
}
}
}
}
}

View File

@@ -10,7 +10,7 @@ capability {
}
context {
server = "ebin02.wks"
server = "ebin01.wks"
share = "/data/raid1-ssd/app-data/gitea-data"
mountPermissions = "0"
}

View File

@@ -3,7 +3,7 @@ job "homeassistant" {
"nummer5",
]
type = "service"
node_pool = "apps"
group "apps" {
count = 1

View File

@@ -1,6 +1,8 @@
job "homer" {
datacenters = ["nummer5"]
node_pool = "apps"
priority = 80
group "apps" {
count = 1
@@ -33,7 +35,7 @@ job "homer" {
driver = "podman"
config {
image = "b4bz/homer:latest"
image = "docker.io/b4bz/homer:latest"
ports = ["http"]
}

View File

@@ -1,6 +1,6 @@
job "mosquitto-prometheus-exporter" {
datacenters = ["nummer5"]
node_pool = "sys"
group "apps" {
count = 1

View File

@@ -3,6 +3,7 @@ job "nodered" {
"nummer5",
]
type = "service"
node_pool = "apps"
group "apps" {
count = 1

58
apps/openwrt/live.hcl Normal file
View File

@@ -0,0 +1,58 @@
job "openwrt" {
datacenters = ["nummer5"]
node_pool = "sys"
priority = 10
group "apps" {
count = 1
network {
port "http"{
to = 9091
}
}
service {
name = "openwrt"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.openwrt.rule=Host(`openwrt.service.nr5`)",
]
}
volume "openwrt" {
type = "csi"
read_only = false
source = "openwrt"
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
task "openwrt" {
driver = "podman"
config {
image = "docker.io/jitesoft/lighttpd"
ports = ["http"]
}
env {
PORT = 9091
SERVER_ROOT = "/www"
SERVER_NAME = "openwrt.service.nr5"
}
volume_mount {
volume = "openwrt"
destination = "/www"
}
resources {
cpu = 10
memory = 32
}
}
}
}

20
apps/openwrt/volume.hcl Normal file
View File

@@ -0,0 +1,20 @@
type = "csi"
id = "openwrt"
name = "openwrt"
plugin_id = "nfs"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
context {
server = "ebin01.wks"
share = "/data/raid1-ssd/app-data/openwrt"
mountPermissions = "0"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "timeo=30", "vers=3", "_netdev" , "nolock" ]
}

View File

@@ -1,7 +1,14 @@
job "postgres" {
datacenters = ["nummer5"]
type = "service"
node_pool = "sys"
priority = 80
#constraint {
# attribute = "${attr.unique.hostname}"
# value = "pine01"
#}
group "service" {
count = 1
volume "postgres-data" {
@@ -13,7 +20,7 @@ job "postgres" {
}
network {
mode = "host"
#mode = "host"
port "postgres"{
static = 5432
}
@@ -21,10 +28,10 @@ job "postgres" {
service {
name = "postgres"
port = "postgres"
#tags = [
# "traefik.enable=true",
# "traefik.tcp.routers.postgres.rule=Host(`postgres.service.nr5`)",
#]
tags = [
"traefik.enable=true",
"traefik.tcp.routers.postgres.rule=Host(`postgres.service.nr5`)",
]
}
task "postgres" {
driver = "podman"
@@ -47,8 +54,8 @@ job "postgres" {
}
resources {
cpu = 1000
memory = 512
cpu = 3500
memory = 1500
}
@@ -69,4 +76,4 @@ job "postgres" {
auto_revert = false
canary = 0
}
}
}

View File

@@ -1,6 +1,7 @@
job "redis" {
datacenters = ["nummer5"]
node_pool = "apps"
group "cache" {

2
bin/hosts.conf Normal file
View File

@@ -0,0 +1,2 @@
hosts="adm01.wks pine01.wks pine02.wks pine03.wks pine04.wks pine05.wks ebin01.wks ebin02.wks drucki.wks switch_cloud.wks drucki_switch.wks"
domain="wks"

12
bin/nummer5-host-powercycle.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
. hosts.conf
host=$1
hostname=$(echo ${host} | sed s/\.${domain}//)
MOSQ="mosquitto_pub -h mqtt.wks -t switch_cloud/switch/${hostname}/command -m"
echo "${host} turning it off"
${MOSQ} OFF
sleep 2
echo "${host} turning it on"
${MOSQ} ON
ping -W 1 ${host}

13
bin/nummer5-hosts-alive.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
. hosts.conf
for host in $hosts; do
if ping -c 1 -W 1 "$host" >/dev/null; then
echo "$host is alive"
else
echo "$host is pining for the fjords"
fi
done
echo ''
nomad server members
echo ''
nomad node status

31
bin/yori-upgrade.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
#
SNAPS=/.snapshots
DATE=$(date +%F)
SNAP="${SNAPS}/${DATE}"
REL=$(lsb_release -c |awk -F ' ' '{print $2}')
echo "Cleaning apt..."
apt clean
apt autoremove --purge
echo ""
echo ""
echo ""
echo ""
echo ""
echo "Remove all local apt lists:"
rm -rvf /var/lib/apt/lists/*
echo "Prune journalctl.."
journalctl --vacuum-time 2h
echo ""
echo ""
echo ""
echo ""
echo "Creating Snap: ${SNAP}"
echo "btrfs subvolume snapshot / ${SNAP}"
echo "Snaps: "
ls -la ${SNAPS}/
apt update
apt dist-upgrade -t ${REL}
echo "APT: autoremove --purge"
apt autoremove --purge

View File

@@ -11,6 +11,10 @@ environment:
TARGET_HOST: "test.chaos"
steps:
- name: git log
image: cr.wks/debian-stable
commands:
- git diff-tree --no-commit-id --name-only HEAD -r
- name: test
image: alpine
commands: