initial scaffold
This commit is contained in:
commit
5c2080a73b
31 changed files with 1244 additions and 0 deletions
56
apps/hello-app/deployment.yaml
Normal file
56
apps/hello-app/deployment.yaml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: hello-app
|
||||
namespace: hello-app
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: hello-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: hello-app
|
||||
spec:
|
||||
# Uncomment if the hello-app package is set to private in Forgejo
|
||||
# (see docs/SETUP.md step 9).
|
||||
# imagePullSecrets:
|
||||
# - name: forgejo-registry
|
||||
containers:
|
||||
- name: hello-app
|
||||
# {"$imagepolicy": "hello-app:hello-app"}
|
||||
image: git.boglabob.com/codegit/hello-app:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hello-app
|
||||
namespace: hello-app
|
||||
spec:
|
||||
selector:
|
||||
app: hello-app
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: hello-app
|
||||
namespace: hello-app
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: hello.boglabob.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: hello-app
|
||||
port:
|
||||
number: 80
|
||||
57
apps/hello-app/image-automation.yaml
Normal file
57
apps/hello-app/image-automation.yaml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# Flux image automation: watches the Forgejo registry for new hello-app
|
||||
# tags, and rewrites deployment.yaml's image tag + commits back to this repo
|
||||
# when one shows up. Requires clusters/homelab/flux-system to have write
|
||||
# access to the Forgejo repo (flux bootstrap sets this up).
|
||||
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||
kind: ImageRepository
|
||||
metadata:
|
||||
name: hello-app
|
||||
namespace: hello-app
|
||||
spec:
|
||||
image: git.boglabob.com/codegit/hello-app
|
||||
interval: 1m
|
||||
# Uncomment + create the secret if the package is private.
|
||||
# secretRef:
|
||||
# name: forgejo-registry
|
||||
---
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||
kind: ImagePolicy
|
||||
metadata:
|
||||
name: hello-app
|
||||
namespace: hello-app
|
||||
spec:
|
||||
imageRepositoryRef:
|
||||
name: hello-app
|
||||
policy:
|
||||
numerical:
|
||||
order: asc
|
||||
filterTags:
|
||||
pattern: '^main-[a-f0-9]+-(?P<ts>\d+)$'
|
||||
extract: '$ts'
|
||||
---
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta1
|
||||
kind: ImageUpdateAutomation
|
||||
metadata:
|
||||
name: hello-app
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: flux-system
|
||||
git:
|
||||
checkout:
|
||||
ref:
|
||||
branch: main
|
||||
commit:
|
||||
author:
|
||||
email: flux@boglabob.com
|
||||
name: fluxcdbot
|
||||
messageTemplate: |
|
||||
chore(hello-app): auto-update image to {{range .Updated.Images}}{{println .}}{{end}}
|
||||
push:
|
||||
branch: main
|
||||
update:
|
||||
path: ./apps/hello-app
|
||||
strategy: Setters
|
||||
6
apps/hello-app/kustomization.yaml
Normal file
6
apps/hello-app/kustomization.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- deployment.yaml
|
||||
- image-automation.yaml
|
||||
4
apps/hello-app/namespace.yaml
Normal file
4
apps/hello-app/namespace.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: hello-app
|
||||
2
apps/hello-app/src/Dockerfile
Normal file
2
apps/hello-app/src/Dockerfile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
FROM nginx:1.27-alpine
|
||||
COPY index.html /usr/share/nginx/html/index.html
|
||||
155
apps/hello-app/src/index.html
Normal file
155
apps/hello-app/src/index.html
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Homelab GitOps Platform</title>
|
||||
<style>
|
||||
:root {
|
||||
--bg: #0b0e14;
|
||||
--panel: #131722;
|
||||
--border: #232838;
|
||||
--text: #e6e9ef;
|
||||
--muted: #8b93a7;
|
||||
--accent: #5eead4;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
line-height: 1.5;
|
||||
}
|
||||
main {
|
||||
max-width: 780px;
|
||||
margin: 0 auto;
|
||||
padding: 4rem 1.5rem 3rem;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.9rem;
|
||||
margin: 0 0 0.4rem;
|
||||
}
|
||||
.tagline {
|
||||
color: var(--muted);
|
||||
margin: 0 0 2rem;
|
||||
}
|
||||
.badge-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 2.5rem;
|
||||
}
|
||||
.badge {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
font-size: 0.8rem;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
padding: 0.3rem 0.8rem;
|
||||
color: var(--muted);
|
||||
}
|
||||
.badge strong { color: var(--accent); font-weight: 600; }
|
||||
section {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem 1.75rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
section h2 {
|
||||
font-size: 0.85rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--muted);
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
.flow {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.flow .step {
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 0.4rem 0.7rem;
|
||||
}
|
||||
.flow .arrow { color: var(--muted); }
|
||||
.stack {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.stack span {
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 0.35rem 0.7rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
footer {
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
footer a { color: var(--accent); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Homelab GitOps Platform</h1>
|
||||
<p class="tagline">Terraform-provisioned k3s cluster on a Dell T630, deployed and kept in sync entirely through GitOps. This page is served from it.</p>
|
||||
|
||||
<div class="badge-row">
|
||||
<span class="badge">commit <strong>__GIT_SHA__</strong></span>
|
||||
<span class="badge">deployed <strong>__BUILD_TIME__</strong> UTC</span>
|
||||
<span class="badge">served by <strong>k3s</strong></span>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h2>How this page got here</h2>
|
||||
<div class="flow">
|
||||
<span class="step">git push</span><span class="arrow">→</span>
|
||||
<span class="step">Forgejo Actions</span><span class="arrow">→</span>
|
||||
<span class="step">kaniko build</span><span class="arrow">→</span>
|
||||
<span class="step">Forgejo registry</span><span class="arrow">→</span>
|
||||
<span class="step">Flux image automation</span><span class="arrow">→</span>
|
||||
<span class="step">Git commit</span><span class="arrow">→</span>
|
||||
<span class="step">Flux reconcile</span><span class="arrow">→</span>
|
||||
<span class="step">k3s rollout</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Stack</h2>
|
||||
<div class="stack">
|
||||
<span>OpenTofu / Terraform</span>
|
||||
<span>KVM / libvirt</span>
|
||||
<span>k3s</span>
|
||||
<span>Flux CD</span>
|
||||
<span>Forgejo + Forgejo Actions</span>
|
||||
<span>kaniko (rootless builds)</span>
|
||||
<span>Podman</span>
|
||||
<span>Caddy</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>What's not shown here</h2>
|
||||
<p style="margin:0; color: var(--muted);">
|
||||
The Kubernetes Dashboard and the cluster's API server are deliberately
|
||||
not public — both are cluster-admin-capable and stay LAN/VPN-only.
|
||||
This page and its GitOps pipeline are the intentionally public part.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
Source: <a href="https://git.boglabob.com">git.boglabob.com</a>
|
||||
</footer>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue