gitea registry ingress
This commit is contained in:
42
gitea/registry-ingress.yaml
Normal file
42
gitea/registry-ingress.yaml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Dedicated DNS-only hostname for the Gitea container registry.
|
||||||
|
#
|
||||||
|
# WHY: Docker registry pushes can't go through the Cloudflare proxy, which caps
|
||||||
|
# request bodies at 100 MB (413 Payload Too Large). `registry.rogi.casa` is a
|
||||||
|
# DNS-only (grey-cloud) record in Cloudflare pointing straight at the cluster,
|
||||||
|
# so Traefik serves it directly with a Let's Encrypt cert (HTTP-01). Git traffic
|
||||||
|
# on `git.rogi.casa` stays behind the Cloudflare proxy untouched.
|
||||||
|
#
|
||||||
|
# Cloudflare setup:
|
||||||
|
# A registry.rogi.casa <cluster-public-IP> DNS-only (grey cloud)
|
||||||
|
#
|
||||||
|
# Push with:
|
||||||
|
# docker login registry.rogi.casa -u <gitea-user>
|
||||||
|
# docker tag git.rogi.casa/roger/hermes-agent:v1.35-1 registry.rogi.casa/roger/hermes-agent:v1.35-1
|
||||||
|
# docker push registry.rogi.casa/roger/hermes-agent:v1.35-1
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: gitea-registry
|
||||||
|
namespace: gitea
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
|
# Allow large docker layer uploads (no upstream body-size cap from Traefik).
|
||||||
|
traefik.ingress.kubernetes.io/buffering: |
|
||||||
|
maxRequestBodyBytes: 0
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- registry.rogi.casa
|
||||||
|
secretName: gitea-registry-tls
|
||||||
|
rules:
|
||||||
|
- host: registry.rogi.casa
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: gitea
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
35
platform-engineer/build-and-push.sh
Normal file → Executable file
35
platform-engineer/build-and-push.sh
Normal file → Executable file
@@ -1,24 +1,43 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Build & push the derived Hermes image (kubectl + helm) to the Gitea registry.
|
# Build & push the derived Hermes image (kubectl + helm).
|
||||||
#
|
#
|
||||||
# Run this on a machine with docker + access to git.rogi.casa:
|
# Two modes:
|
||||||
# ./platform-engineer/build-and-push.sh
|
# ./build-and-push.sh push # build + push to the Gitea registry
|
||||||
|
# ./build-and-push.sh local # build + import directly into the NUC's k3s containerd
|
||||||
|
# # (no registry needed; pod is pinned to this node)
|
||||||
#
|
#
|
||||||
# Prereqs:
|
# Default (no arg): push.
|
||||||
# - docker login git.rogi.casa (use your Gitea username + access token)
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
REGISTRY="git.rogi.casa"
|
# Docker registry pushes can't go through the Cloudflare proxy (100 MB cap),
|
||||||
|
# so push to the DNS-only registry hostname instead of git.rogi.casa.
|
||||||
|
# Override with: REGISTRY=git.rogi.casa ./build-and-push.sh push (if grey-clouded)
|
||||||
|
REGISTRY="${REGISTRY:-registry.rogi.casa}"
|
||||||
REPO="roger/hermes-agent"
|
REPO="roger/hermes-agent"
|
||||||
TAG="${TAG:-v1.35-1}"
|
TAG="${TAG:-v1.35-1}"
|
||||||
IMAGE="${REGISTRY}/${REPO}:${TAG}"
|
IMAGE="${REGISTRY}/${REPO}:${TAG}"
|
||||||
|
MODE="${1:-push}"
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
echo "==> Building ${IMAGE}"
|
echo "==> Building ${IMAGE}"
|
||||||
docker build --platform linux/amd64 -t "${IMAGE}" -f dockerfile .
|
docker build --platform linux/amd64 -t "${IMAGE}" -f dockerfile .
|
||||||
|
|
||||||
|
case "$MODE" in
|
||||||
|
push)
|
||||||
echo "==> Pushing ${IMAGE}"
|
echo "==> Pushing ${IMAGE}"
|
||||||
docker push "${IMAGE}"
|
docker push "${IMAGE}"
|
||||||
|
echo "==> Done. If the pod can't pull, create the gitea-registry secret in the namespace."
|
||||||
echo "==> Done. Update platform-engineer/deployment.yaml image: if you changed TAG."
|
;;
|
||||||
|
local)
|
||||||
|
# Requires k3s + being run on the node the pod schedules to (roger-nucbox-evo-x2).
|
||||||
|
echo "==> Importing into k3s containerd (requires sudo)"
|
||||||
|
docker save "${IMAGE}" | sudo k3s ctr images import -
|
||||||
|
echo "==> Done. Verify: sudo k3s ctr images ls | grep hermes-agent"
|
||||||
|
echo " deployment.yaml is set to imagePullPolicy: IfNotPresent"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {push|local}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ spec:
|
|||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: hermes
|
- name: hermes
|
||||||
image: git.rogi.casa/roger/hermes-agent:v1.35-1
|
image: registry.rogi.casa/roger/hermes-agent:v1.35-1
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: IfNotPresent # falls back to local image if present
|
||||||
command: ["gateway", "run"]
|
command: ["gateway", "run"]
|
||||||
ports:
|
ports:
|
||||||
- name: gateway
|
- name: gateway
|
||||||
|
|||||||
Reference in New Issue
Block a user