Remove the hand-written Application and hub route; the orchestrator creates both
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,40 +1,32 @@
|
||||
# deploy/
|
||||
|
||||
Argo CD delivery of demo-vivek-11 to the lab: the hub's Argo CD pushes it to the `apps-lab` spoke
|
||||
through the argocd-agent, and the hub's public kgateway Gateway forwards to it over Private Link.
|
||||
How demo-vivek-11 reaches the lab. Everything starts from `score-lab.yaml`; nothing here is written
|
||||
by hand.
|
||||
|
||||
```
|
||||
browser ─► hub pe-gatewayapi (demo-vivek-11.apps.lab…) ─► Private Link ─► spoke pe-gatewayapi-int
|
||||
(demo-vivek-11.int.apps.lab…, port 80) ─► Service demo-vivek-11 ─► pod :8080
|
||||
```
|
||||
|
||||
| Folder | Applied to | By |
|
||||
| What | Where | Produced by |
|
||||
|---|---|---|
|
||||
| `argocd/` | lab **hub** | `kubectl apply` once |
|
||||
| `hub/` | lab **hub** | `kubectl apply` once |
|
||||
| `lab/` | lab **spoke** | Argo CD, from this repo. **Generated**: never edit by hand |
|
||||
| Deployment, Service, HTTPRoute, NetworkPolicy (`lab/`) | lab **spoke** | score-k8s with the platform's provisioners, delivered by Argo CD |
|
||||
| Argo CD Application `team-demo/demo-vivek-11` | lab **hub** | the orchestrator, from the workload in `score-lab.yaml` |
|
||||
| Public route (Backend + HTTPRoute) | lab **hub** | the orchestrator, from the `workload-ingress` resource |
|
||||
|
||||
## Apply
|
||||
## Workflows
|
||||
|
||||
```bash
|
||||
khub apply -f deploy/argocd/application.yaml
|
||||
khub apply -f deploy/hub/remote-route.yaml
|
||||
```
|
||||
1. **Build and Push to ACR (lab)** builds the image, renders `score-lab.yaml` into `lab/` and commits
|
||||
it. The image tag is the commit that was built. Argo CD then rolls it out.
|
||||
2. **Deploy to Orchestrator (lab)** creates or updates the Application and the public route. It is
|
||||
needed the first time and whenever the hostname, team or repository in `score-lab.yaml` changes.
|
||||
|
||||
## Rules the Application must keep
|
||||
`lab/` is **generated**: never edit it. To change what is deployed, change `score-lab.yaml` and run
|
||||
the build workflow. The provisioners version is pinned in that workflow.
|
||||
|
||||
The lab uses argocd-agent's **destination-based mapping**, and this app belongs to team **demo**.
|
||||
## What `score-lab.yaml` must carry
|
||||
|
||||
- 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.
|
||||
|
||||
## How `lab/` is produced
|
||||
|
||||
`lab/` is rendered from `score-lab.yaml` by the **Build and Push to ACR (lab)** workflow: it builds
|
||||
the image, renders with the platform's provisioners
|
||||
(`cruciblecoredevacr.azurecr.io/score-provisioners`, version pinned in the workflow), and commits the
|
||||
result. The image tag is the commit that was built. To change what is deployed, change
|
||||
`score-lab.yaml` and run the workflow.
|
||||
- `metadata.annotations["crucible.kyndryl.com/team"]`: the owning team (`demo`). The Application is
|
||||
created in `team-demo`, and may deploy only to spoke namespaces named `demo-*`.
|
||||
- `metadata.annotations["crucible.kyndryl.com/repo-url"]`: this repository.
|
||||
- Readiness and liveness probes, required by the platform's policy check.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# 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: team-demo
|
||||
spec:
|
||||
# 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/lab
|
||||
destination:
|
||||
# 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:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
@@ -1,43 +0,0 @@
|
||||
# On the HUB's public Gateway: the public name, forwarded over Private Link to the spoke's internal
|
||||
# Gateway. The same shape the catalog's kgateway-remote-route module creates.
|
||||
#
|
||||
# 10.20.255.100 is the hub's private endpoint to the spoke Gateway (crucible-hub-to-apps-lab-pe).
|
||||
apiVersion: gateway.kgateway.dev/v1alpha1
|
||||
kind: Backend
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
namespace: gatewayapi
|
||||
spec:
|
||||
type: Static
|
||||
static:
|
||||
hosts:
|
||||
- host: 10.20.255.100
|
||||
port: 80
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
namespace: gatewayapi
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: pe-gatewayapi
|
||||
namespace: gatewayapi
|
||||
sectionName: https
|
||||
hostnames:
|
||||
- demo-vivek-11.apps.lab.crucible.kyndemo.live
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
# The spoke only serves *.int.apps.lab; without the rewrite it answers 404.
|
||||
filters:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
hostname: demo-vivek-11.int.apps.lab.crucible.kyndemo.live
|
||||
# No port: kgateway rejects one on a Backend ref (BackendNotFound); the Backend carries it.
|
||||
backendRefs:
|
||||
- name: demo-vivek-11
|
||||
kind: Backend
|
||||
group: gateway.kgateway.dev
|
||||
Reference in New Issue
Block a user