Thiết kế IDP Blueprint — Kiến trúc & ADR
🎯 Mục tiêu: Thiết kế blueprint IDP cho một tổ chức 10 team/50 developer: xác định capabilities, toolchain, và viết Architecture Decision Record (ADR) cho 2 quyết định quan trọng.
🧰 Công cụ / nền tảng: VS Code, Git, Mermaid (VS Code extension).
📦 Chuẩn bị: Git repo mới; VS Code với extension Markdown Preview Mermaid Support.
▶️ Bước 1 — Tạo cấu trúc IDP blueprint repo:
mkdir idp-blueprint && cd idp-blueprint
git init
# Cấu trúc thư mục IDP
mkdir -p docs/adr platform/templates platform/modules portal
cat > README.md <<'EOF'
# Internal Developer Platform Blueprint
## Scope
- 10 product teams, 50 developers
- Kubernetes-based on AWS EKS
- GitOps workflow (Argo CD)
## Capabilities
| Capability | Tool | Status |
|--------------------|-------------------|----------|
| Self-service infra | Crossplane | Planned |
| CI/CD pipelines | GitHub Actions | Active |
| Service catalog | Backstage | Planned |
| Observability | Prometheus/Grafana| Active |
| Secret management | Vault | Active |
| Golden path | Cookiecutter | Planned |
EOF
git add README.md && git commit -m "feat: init IDP blueprint repo"
▶️ Bước 2 — Vẽ kiến trúc IDP bằng Mermaid:
cat > docs/architecture.md <<'EOF'
# IDP Architecture
```mermaid
graph TB
subgraph Developer["Developer (Self-Service)"]
DEV[Developer CLI / Portal]
end
subgraph IDP["Internal Developer Platform"]
PORTAL[Backstage Portal]
CATALOG[Service Catalog]
SCAFFOLD[Golden Path Templates]
PORTAL --> CATALOG
PORTAL --> SCAFFOLD
end
subgraph Platform["Platform Layer"]
CP[Crossplane - Infra API]
GITOPS[Argo CD - GitOps]
CI[GitHub Actions - CI/CD]
OBS[Prometheus + Grafana]
VAULT[HashiCorp Vault]
end
subgraph Cloud["Cloud (AWS)"]
EKS[EKS Cluster]
RDS[(RDS)]
S3[(S3)]
end
DEV --> PORTAL
DEV --> CI
SCAFFOLD --> GITOPS
CP --> EKS
CP --> RDS
CP --> S3
GITOPS --> EKS
OBS --> EKS
```
EOF
git add docs/architecture.md && git commit -m "docs: add IDP architecture diagram"
▶️ Bước 3 — Viết ADR (Architecture Decision Record):
cat > docs/adr/ADR-001-crossplane-vs-terraform.md <<'EOF'
# ADR-001: Crossplane vs Terraform cho Self-Service Infra
## Status: Accepted
## Date: 2026-05-23
## Context
Platform Team cần cơ chế self-service để developer tạo DB, bucket
mà không cần ticket. Hai ứng viên: Crossplane (Kubernetes-native) và
Terraform Cloud với module catalog.
## Decision
Chọn Crossplane XRD làm self-service API vì:
- Native Kubernetes — developer dùng kubectl/YAML quen thuộc
- GitOps-friendly: Argo CD detect và reconcile resource tự động
- Composite Resource che đi AWS API complexity khỏi developer
## Consequences
- Platform Team cần học Crossplane XRD (1–2 sprint ramp-up)
- Terraform vẫn dùng cho bootstrapping cluster ban đầu
- Developer không cần biết AWS API trực tiếp — giảm cognitive load
EOF
git add docs/adr/ && git commit -m "docs: add ADR-001 crossplane vs terraform decision"
✅ Kết quả mong đợi: Repo có cấu trúc blueprint rõ ràng. git log --oneline hiển thị 3 commits. Mermaid diagram render đúng trong VS Code Preview. ADR-001 ghi rõ context/decision/consequences.
🧹 Cleanup: git add . && git commit -m "lab-146: complete IDP blueprint" rồi push lên GitHub làm portfolio.