|
| 1 | ++++ |
| 2 | +title = 'Architecture' |
| 3 | +weight = 6 |
| 4 | ++++ |
| 5 | + |
| 6 | +# Architecture |
| 7 | + |
| 8 | +## Two-Phase Deployment |
| 9 | + |
| 10 | +The event stack is deployed in two sequential phases: |
| 11 | + |
| 12 | +**Phase 1 - The Base - Operators and CRDs:** Deploys operator Deployments, RBAC resources, and Custom Resource Definitions. |
| 13 | +The install script waits for each operator to become ready before proceeding. |
| 14 | + |
| 15 | +**Phase 2 - The Stack - Operands:** Deploys the actual workloads as Custom Resources (Kafka, ApicurioRegistry3, Console). |
| 16 | +Operators must be running to process these resources. |
| 17 | + |
| 18 | +This separation exists for three reasons: |
| 19 | + |
| 20 | +1. **CRD registration** — Kubernetes must register CRDs before it can accept custom resources of that type |
| 21 | +2. **Operator readiness** — operators must be running to reconcile their custom resources |
| 22 | +3. **Safe teardown** — during uninstall, operands are deleted first while operators are still alive to process finalizers |
| 23 | + |
| 24 | +The install script uses `kubectl apply --server-side` for Phase 1 to handle large CRDs (such as those from the Prometheus Operator) that exceed the annotation size limit used by client-side apply. |
| 25 | + |
| 26 | +## Kustomize Structure |
| 27 | + |
| 28 | +The repository uses a component-based Kustomize architecture: |
| 29 | + |
| 30 | +``` |
| 31 | +components/ # Reusable Kustomize components |
| 32 | +├── core/ |
| 33 | +│ ├── base/ # Component: operators & CRDs |
| 34 | +│ └── stack/ # Component: operands |
| 35 | +└── metrics/ # Optional metrics component |
| 36 | + ├── base/ |
| 37 | + └── stack/ |
| 38 | +overlays/ # Deployable configurations |
| 39 | +├── core/ # Default (no metrics) |
| 40 | +│ ├── base/ # Phase 1: components/core/base |
| 41 | +│ └── stack/ # Phase 2: components/core/stack |
| 42 | +└── metrics/ # Core + Prometheus |
| 43 | + ├── base/ # Phase 1: core/base + metrics/base |
| 44 | + └── stack/ # Phase 2: core/stack + metrics/stack |
| 45 | +``` |
| 46 | + |
| 47 | +**Components** are reusable building blocks (Kustomize `Component` kind). |
| 48 | +They define operators, operands, and patches but are not directly deployable. |
| 49 | + |
| 50 | +**Overlays** compose components into deployable configurations. |
| 51 | +Each overlay has a `base` (Phase 1) and `stack` (Phase 2) directory. |
| 52 | +The `metrics` overlay includes everything from `core` plus the Prometheus components. |
| 53 | + |
| 54 | +## Resource Labeling |
| 55 | + |
| 56 | +Every resource deployed by the quick-start carries the label: |
| 57 | + |
| 58 | +```yaml |
| 59 | +app.kubernetes.io/part-of: streamshub-developer-quickstart |
| 60 | +``` |
| 61 | +
|
| 62 | +This label is applied by the Kustomize `labels` transformer and serves two purposes: |
| 63 | + |
| 64 | +- Resource discovery — find all quick-start resources with a single label selector |
| 65 | +- Shared-cluster safety — the uninstall script uses label selectors to distinguish quick-start resources from user-created ones, preventing accidental deletion of CRDs that other deployments depend on |
| 66 | + |
| 67 | +## Namespace Isolation |
| 68 | + |
| 69 | +Each component runs in its own namespace: |
| 70 | + |
| 71 | +| Namespace | Contents | |
| 72 | +|----------------------|----------------------------------------------------| |
| 73 | +| `strimzi` | Strimzi Kafka Operator | |
| 74 | +| `kafka` | Kafka cluster (`dev-cluster`) | |
| 75 | +| `apicurio-registry` | Registry Operator and instance | |
| 76 | +| `streamshub-console` | Console Operator and instance | |
| 77 | +| `monitoring` | Prometheus Operator and instance (metrics overlay) | |
| 78 | + |
| 79 | +## Updating Component Versions |
| 80 | + |
| 81 | +Use the `update-version.sh` script to manage operator versions: |
| 82 | + |
| 83 | +```shell |
| 84 | +# List available versions for a component |
| 85 | +./update-version.sh --list strimzi |
| 86 | +
|
| 87 | +# Preview changes without modifying files |
| 88 | +./update-version.sh --dry-run strimzi 0.52.0 |
| 89 | +
|
| 90 | +# Check if a specific release exists |
| 91 | +./update-version.sh --check apicurio-registry 3.2.0 |
| 92 | +
|
| 93 | +# Apply the update |
| 94 | +./update-version.sh strimzi 0.52.0 |
| 95 | +``` |
| 96 | + |
| 97 | +Supported components: `strimzi`, `apicurio-registry`, `streamshub-console`, `prometheus-operator` |
| 98 | + |
| 99 | +The script updates the remote resource URLs in the relevant `kustomization.yaml` files to point to the new version's release artifacts. |
0 commit comments