diff --git a/kubernetes/platform/templates/httproutes.yaml b/kubernetes/platform/templates/httproutes.yaml index 1fa9aa8..30b1ef9 100644 --- a/kubernetes/platform/templates/httproutes.yaml +++ b/kubernetes/platform/templates/httproutes.yaml @@ -3,13 +3,13 @@ {{- $name := .name }} {{- $isApps := eq (.route.gateway | default "internal") "apps" }} {{- /* Compute whether this route should appear on the gethomepage dashboard. - - dashboard omitted (nil) → default-SHOW on every gateway (apps + infra) + - dashboard omitted (nil) → default-SHOW only on apps gateway - dashboard: false → always hide - dashboard: true → always show with auto-derived name/icon - dashboard: { ... } → show unless `enabled: false`; map fields override defaults - Each gateway's homepage filters via `gethomepage.dev/instance` so apps - homepage shows apps-gateway routes, infra homepage shows infra-gateway - routes — auto-discovery, no per-app opt-in. */ -}} + Each gateway's homepage filters via gethomepage instance annotations: + routes are tagged for their gateway instance and for the admin instance, + so apps/infra stay scoped while admin sees every visible route. */ -}} {{- $dash := .route.dashboard }} {{- $dashKind := kindOf $dash }} {{- $show := false }} @@ -50,10 +50,11 @@ metadata: gethomepage.dev/enabled: "true" gethomepage.dev/name: {{ ternary ($name | title) $dashName (eq $dashName "") | quote }} gethomepage.dev/icon: {{ ternary (printf "%s.svg" $name) $dashIcon (eq $dashIcon "") | quote }} - # instance: derived from gateway. Apps homepage (instanceName: apps) shows only - # routes with this matching its instanceName; same for infra. Routes without an - # instance annotation are visible on every homepage. - gethomepage.dev/instance: {{ .route.gateway | default "internal" | quote }} + # Instances: derived from gateway plus admin. Homepage supports multiple + # `gethomepage.dev/instance.` annotations so a route can be visible on + # exactly these dashboards without leaking to every Homepage instance. + gethomepage.dev/instance.{{ .route.gateway | default "internal" }}: "" + gethomepage.dev/instance.admin: "" {{- if ne (printf "%v" $siteMonitorVal) "false" }} # siteMonitor: HTTP-ping URL for the status dot. Defaults to https://; # override with `dashboard.siteMonitor: `; opt out with `dashboard.siteMonitor: false`. diff --git a/kubernetes/values/apps/homepage.yaml b/kubernetes/values/apps/homepage.yaml index b03e000..d25a2f5 100644 --- a/kubernetes/values/apps/homepage.yaml +++ b/kubernetes/values/apps/homepage.yaml @@ -50,7 +50,7 @@ config: settings: title: Apps - instanceName: apps # scopes auto-discovery to routes annotated `gethomepage.dev/instance: apps` + instanceName: apps # scopes auto-discovery to `gethomepage.dev/instance.apps` theme: dark color: slate headerStyle: clean diff --git a/kubernetes/values/infra/homepage-admin.yaml b/kubernetes/values/infra/homepage-admin.yaml index f6e8062..851c9d5 100644 --- a/kubernetes/values/infra/homepage-admin.yaml +++ b/kubernetes/values/infra/homepage-admin.yaml @@ -5,7 +5,7 @@ # Differentiators vs. homepage / homepage-infra: # - widgets: kubernetes cluster overview, resources, prometheus targets # - bookmarks: deep links into argocd / grafana / prometheus / loki UIs -# - shows ALL services across both gateways (no instanceName filter) +# - shows ALL services across both gateways via gethomepage.dev/instance.admin # Lives at admin.infra.home; LAN-gated only (no OIDC v1 — follow-up). image: @@ -46,10 +46,10 @@ config: gateway: true services: true - # No instance filter — admin homepage shows ALL annotated routes regardless - # of which gateway they live on (apps + infra both visible). - # NOTE: in homepage v1.12.3 the `instance` filter is broken upstream anyway - # (silently drops annotated routes). See homepage-infra.yaml comment block. + # Admin uses its own instance filter. The platform chart annotates every + # dashboard-visible HTTPRoute with both its gateway instance and + # `gethomepage.dev/instance.admin`, so admin sees apps + infra while the + # gateway dashboards remain scoped. # # Live service-card widgets for Grafana + ArgoCD. Credentials come from # the homepage-admin-credentials SopsSecret via envFrom (above). @@ -236,7 +236,7 @@ config: settings: title: Admin - # No instanceName key — show everything across both gateways. + instanceName: admin theme: dark color: zinc headerStyle: clean diff --git a/kubernetes/values/infra/homepage-infra.yaml b/kubernetes/values/infra/homepage-infra.yaml index 59c6a57..4a4da8a 100644 --- a/kubernetes/values/infra/homepage-infra.yaml +++ b/kubernetes/values/infra/homepage-infra.yaml @@ -1,8 +1,8 @@ # homepage-infra — chart: jameswynn/homepage v2.1.0 (gethomepage) # https://artifacthub.io/packages/helm/jameswynn/homepage # -# Second homepage instance dedicated to infrastructure/admin services. -# Filters to routes annotated with `gethomepage.dev/instance: infra`. +# Second homepage instance dedicated to infrastructure services. +# Filters to routes annotated with `gethomepage.dev/instance.infra`. # Bump app to current upstream. Chart default v1.2.0 doesn't support `instanceName` # filtering (added in later versions); needed to scope each homepage to its gateway. @@ -35,9 +35,6 @@ config: ingress: false # we don't use classic Ingress — only HTTPRoute gateway: true services: true # also discover Service-level annotations as a fallback - # NOTE: `instance:` filter dropped — homepage v1.2.0 silently drops routes - # carrying the `gethomepage.dev/instance` annotation. Both dashboards now - # show ALL routes; cosmetic differentiation only via title + bg + cross-link. # Layout: groups are auto-built from gethomepage.dev/group annotations on routes. # Static entries below are merged with annotation-discovered services. @@ -61,7 +58,7 @@ config: settings: title: Infrastructure - instanceName: infra # scopes auto-discovery to routes annotated `gethomepage.dev/instance: infra` + instanceName: infra # scopes auto-discovery to `gethomepage.dev/instance.infra` theme: dark color: slate headerStyle: clean