app #0: cube.famzheng.me 入口门户 + 平台脚手架
deploy cube / build-and-deploy (push) Has been cancelled
deploy cube / build-and-deploy (push) Has been cancelled
monorepo 第一刀: - workspace + crates/cube-core(base router / healthz / ServeDir SPA fallback / JSON tracing / SIGTERM shutdown) - apps/cube:axum 主程序 + Vite + Vue 3 + TS 门户(暗色调 + 渐变 logo + app 卡片网格) - Dockerfile:scratch + musl 静态二进制,镜像 2.6MB - k8s/:cube-cube ns + Deployment + Service + Ingress(cube.famzheng.me,traefik LE 自动签) - registry:新增 registry.famzheng.me ingress 反代到 gitea 内置 container registry, 自动化身份用 mochi(registry.famzheng.me/mochi/cube) - CI:.gitea/workflows/deploy-cube.yml,host shell runner(gnoc), build → push → kubectl rollout 五步流水 - README:把宪法段改成 monorepo 模式 + monorepo 目录结构 - 新增宪法条款:前端视图状态走 URL(path + query)保证可 bookmark
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# registry.famzheng.me — 反代到 gitea container registry
|
||||
# Docker daemon 期望 https://<host>/v2/...,gitea 内置 registry 在 gitea pod 的 /v2/ 下,
|
||||
# 所以这条 ingress 不 strip 任何路径,全部 pass-through 到 gitea-svc:3000。
|
||||
# 不属于 cube app #0 本身,但平台基础设施先放在 app #0 目录里,未来可以挪到独立的 platform/ ns。
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: registry
|
||||
namespace: gnoc-gitea
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: registry.famzheng.me
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: gitea
|
||||
port:
|
||||
number: 3000
|
||||
@@ -0,0 +1,46 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: cube
|
||||
namespace: cube-cube
|
||||
labels:
|
||||
app: cube
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: cube
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: cube
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: registry-creds
|
||||
containers:
|
||||
- name: cube
|
||||
# tag 由 CI 通过 `kubectl set image` 替换;初次 apply 由 README 部署 runbook 指定
|
||||
image: registry.famzheng.me/mochi/cube:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: http
|
||||
initialDelaySeconds: 1
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 15
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 16Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 64Mi
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: cube
|
||||
namespace: cube-cube
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: cube.famzheng.me
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: cube
|
||||
port:
|
||||
number: 80
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: cube-cube
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: cube
|
||||
namespace: cube-cube
|
||||
spec:
|
||||
selector:
|
||||
app: cube
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
Reference in New Issue
Block a user