61 lines
2.9 KiB
Markdown
61 lines
2.9 KiB
Markdown
# Platform components
|
|
|
|
The platform stack keeps one OpenTofu state file, but Jeannie exposes isolated
|
|
component applies. A component apply passes only that component's resource
|
|
addresses as `-target` arguments; OpenTofu includes required dependencies and
|
|
does not apply unrelated platform resources.
|
|
|
|
Run these on the Debian homelab host with the active cluster profile:
|
|
|
|
```bash
|
|
LAB_CLUSTER_PROFILE=pimox ./jeannie platform monitoring
|
|
LAB_CLUSTER_PROFILE=pimox ./jeannie platform logging
|
|
LAB_CLUSTER_PROFILE=pimox ./jeannie platform argocd
|
|
LAB_CLUSTER_PROFILE=pimox ./jeannie platform all
|
|
```
|
|
|
|
Available components are `calico`, `metrics`, `dns`, `metallb`, `ingress`,
|
|
`storage`, `argocd`, `security`, `logging`, `monitoring`, and `tools`.
|
|
|
|
Targeted applies skip the legacy platform-wide adoption pass. The monitoring
|
|
target performs its own scoped adoption after OpenTofu initialization: existing
|
|
Helm releases (`prometheus-stack` and Mimir when enabled), the monitoring
|
|
namespace, scheduling priority, and repo-managed dashboard ConfigMaps are
|
|
imported only when missing from state. It checks the selected control-plane
|
|
node before adoption, preserves existing state entries, and stops on discovery
|
|
errors rather than treating them as absent resources. No release uninstall or
|
|
PVC deletion is involved. Use `platform all` for platform-wide adoption.
|
|
|
|
## Monitoring during reduced CPU capacity
|
|
|
|
`platform monitoring` creates the `homelab-monitoring` PriorityClass before
|
|
updating Prometheus, Grafana, and their Operator. These workloads have priority
|
|
100000, above ordinary workloads and below Kubernetes system-critical pods.
|
|
If their local-volume node has no unreserved CPU, the scheduler can preempt
|
|
lower-priority pods to admit monitoring. Those workloads may remain Pending
|
|
until capacity is restored; priority does not add CPU capacity.
|
|
|
|
Prometheus requests 25m CPU plus 25m for its config reloader. It can run on a
|
|
one-core VM when that scheduling budget is available. Existing node selectors,
|
|
PVCs, and PV node affinity are retained: the pipeline does not move hostpath
|
|
data, delete claims, or schedule monitoring on the control plane to bypass
|
|
storage placement.
|
|
|
|
Readiness checks follow Deployments, StatefulSets, and DaemonSets, including
|
|
the StatefulSets generated by Prometheus Operator (whose instance label can
|
|
differ from the Helm release). Old failed pods do not block a healthy replacement.
|
|
Missing Prometheus or Grafana workloads, incomplete rollouts, and unavailable
|
|
replicas still fail the check. The pipeline runs a live check even on an
|
|
unchanged apply, and prints scheduling events, requests, and volume placement
|
|
when the bounded readiness wait fails.
|
|
|
|
After syncing the repository, run on Debian or through the remote API:
|
|
|
|
```bash
|
|
./jeannie remote platform monitoring
|
|
```
|
|
|
|
The monitoring target includes the scheduling priority dependency and the
|
|
repo-managed dashboard ConfigMaps; no separate pod deletion or dashboard
|
|
restart command is required.
|