feat: scaffold agentmon services and k8s deploy
Adds Go microservices (ingest-gateway, event-processor, query-api, web-ui), NATS+Postgres wiring, initial schema/init job, ingress manifests for LAN+tailnet, and a multi-arch image build script.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
Build/push images
|
||||
|
||||
- Default builds linux/amd64 + linux/arm64 and pushes.
|
||||
- Default REGISTRY is `gitea-http.taildb3494.ts.net/will/agentmon` (your Gitea registry).
|
||||
|
||||
Examples:
|
||||
|
||||
- Push to default image names:
|
||||
TAG=dev ./build/build-images.sh
|
||||
|
||||
- Push to your registry:
|
||||
REGISTRY=registry.docker-registry.svc.cluster.local:5000 TAG=dev ./build/build-images.sh
|
||||
|
||||
- Build locally without pushing (single-arch only; Docker can’t `--load` multi-arch):
|
||||
PLATFORM=linux/amd64 PUSH_ARGS=--load TAG=dev ./build/build-images.sh
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Builds multi-arch images by default.
|
||||
#
|
||||
# Defaults:
|
||||
# - PLATFORM="linux/amd64,linux/arm64"
|
||||
# - PUSH_ARGS="--push" (set to --load for a single-arch local build)
|
||||
|
||||
REGISTRY=${REGISTRY:-"gitea-http.taildb3494.ts.net/will/agentmon"}
|
||||
TAG=${TAG:-"dev-20260117-0832"}
|
||||
PLATFORM=${PLATFORM:-"linux/amd64,linux/arm64"}
|
||||
|
||||
services=(
|
||||
ingest-gateway
|
||||
event-processor
|
||||
query-api
|
||||
web-ui
|
||||
)
|
||||
|
||||
for svc in "${services[@]}"; do
|
||||
image="${REGISTRY}/${svc}:${TAG}"
|
||||
|
||||
echo "==> Building ${image} (${PLATFORM})"
|
||||
docker buildx build \
|
||||
--platform "${PLATFORM}" \
|
||||
--build-arg CMD="${svc}" \
|
||||
-f build/dockerfiles/Dockerfile \
|
||||
-t "${image}" \
|
||||
${PUSH_ARGS:-"--push"} \
|
||||
.
|
||||
done
|
||||
@@ -0,0 +1,21 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG GO_VERSION=1.25
|
||||
|
||||
FROM golang:${GO_VERSION} AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
ARG CMD
|
||||
RUN test -n "$CMD"
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o /out/app ./cmd/$CMD
|
||||
|
||||
FROM gcr.io/distroless/static:nonroot
|
||||
WORKDIR /
|
||||
COPY --from=build /out/app /app
|
||||
USER nonroot:nonroot
|
||||
ENTRYPOINT ["/app"]
|
||||
Reference in New Issue
Block a user