diff --git a/deploy/README.md b/deploy/README.md index 423a87b..715a23a 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -17,17 +17,19 @@ browser ─► hub pe-gatewayapi (demo-vivek-11.apps.lab…) ─► Private Link ## Apply ```bash -khub apply -f deploy/argocd/appproject.yaml khub apply -f deploy/argocd/application.yaml khub apply -f deploy/hub/remote-route.yaml ``` ## Rules the Application must keep -- It lives in namespace **`apps-lab`** on the hub: the agent's namespace. -- `destination.name: apps-lab`, **never** `destination.server`, which resolves to the hub itself. -- `project: apps-lab`. The `default` project has no `sourceNamespaces`, so it refuses an - Application in `apps-lab`. +The lab uses argocd-agent's **destination-based mapping**, and this app belongs to team **demo**. + +- It lives in namespace **`team-demo`** on the hub: team demo's namespace. The platform creates it. +- `project: team-demo`: the platform's AppProject for the team. It accepts Applications only from + `team-demo`, and deploys only to spoke namespaces named **`demo-*`** (this app's is `demo-vivek-11`). +- `destination.name: apps-lab`: the agent to deploy to, and the routing key. **Never** + `destination.server`, which resolves to the hub itself. ## Image diff --git a/deploy/argocd/application.yaml b/deploy/argocd/application.yaml index d36f43e..d0d0c0a 100644 --- a/deploy/argocd/application.yaml +++ b/deploy/argocd/application.yaml @@ -1,17 +1,20 @@ -# Lives on the HUB, in the agent's namespace. The argocd-agent pushes it to the spoke. +# Lives on the HUB, in team demo's namespace. Destination-based mapping routes it to the spoke named +# by destination.name, where it keeps this namespace (team-demo) rather than moving to argocd. apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: demo-vivek-11 - namespace: apps-lab + namespace: team-demo spec: - project: apps-lab + # Created by the platform (argocd-principal teams). Allows deploying only to demo-* on the spoke. + project: team-demo source: repoURL: https://gitea.kyndemo.live/validate/demo-vivek-11.git targetRevision: main path: deploy/manifests destination: - # name, never server: server https://kubernetes.default.svc resolves to the hub itself. + # The agent to deploy to -- under destination-based mapping this IS the routing key. Never + # server: https://kubernetes.default.svc resolves to the hub itself. name: apps-lab namespace: demo-vivek-11 syncPolicy: