Create a RabbitMQ Service on Milner #55
Labels
No labels
blocked
bug
duplicate
effort
high
effort
low
effort
medium
effort
minimal
enhancement
help wanted
invalid
pr
feedback
pr
reviewing
question
status
backlog
status
document
status
done
status
implement
status
pending
status
planning
status
reviewing
waiting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tepichord/milner#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Naina:
Overview
Deploy a single-node RabbitMQ broker on Milner as the cluster-internal message bus for the evolved-npcs orchestrator/simulation pipeline, following the allocation and topology already fixed in
ARCHITECTURE.md§4 and §7. This issue covers the RabbitMQ Cluster Operator, theRabbitmqClusterinstance, Vault-backed credentials, and the offline gates that keep them honest; KEDA is deliberately out of scope.Technical Approach
rabbitmqnamespace —infrastructure/namespaces/rabbitmq.yaml, then list it ininfrastructure/kustomization.yaml.12infrastructure/rabbitmq-operator/using the cloudpirates OCI chart — it wraps the officialghcr.io/rabbitmq/cluster-operator:2.23.0arm64 image and generates no cert-manager objects.3456apps/rabbitmq/rabbitmqcluster.yaml— one CR is all the operator needs; it then creates Servicerabbitmq(5672/15672/15692), StatefulSetrabbitmq-server, and the PVC.78secrets/vaultauth-rabbitmq.yaml+secrets/rabbitmq-credentials.yaml.externalSecretmakes the operator skip its ownrabbitmq-default-userSecret and wait for this one.91011chartRefbefore adding the RabbitMQ row —_helmrelease_chartreturnsNoneforchartRef, so the row would silently find no provider.1213test_vault_crs_match_the_vso_crd_shapeasserts exact counts, and Vault must hold the broker's credentials before the StatefulSet can start.1415guest:guestexample inARCHITECTURE.md§4 — RabbitMQ refuses remote logins forguestwith "user 'guest' can only connect via localhost", so the KEDA trigger example must reference aTriggerAuthenticationinstead.161718Implementation Details
New files
gitops/clusters/milner/infrastructure/namespaces/rabbitmq.yamlgitops/clusters/milner/infrastructure/rabbitmq-operator/{kustomization,ocirepository,helmrelease,values}.yamlnamespace: rabbitmq,configMapGeneratorfor valuesgitops/clusters/milner/apps/rabbitmq/{kustomization,rabbitmqcluster}.yamlgitops/clusters/milner/secrets/{vaultauth-rabbitmq,rabbitmq-credentials}.yamlModified files
gitops/clusters/milner/infrastructure/kustomization.yamlnamespaces/rabbitmq.yaml+rabbitmq-operatorgitops/clusters/milner/apps/kustomization.yamlrabbitmqgitops/clusters/milner/secrets/kustomization.yamltests/test_gitops.pychartRef-aware_helmrelease_chart,rabbitmq.comrow, VSO count(3,3)→(4,4)OPERATIONS.mdvkpath, RabbitMQ section1920ARCHITECTURE.mdguest:guestfix; RabbitMQ rowsplanned→deployed2122gitops/clusters/milner/apps/evolved-npcs/README.mdDependencies / constraints
infrastructure, theRabbitmqClusterCR inapps, and the credentials Secret (viasecrets) must beat theappslayer — already guaranteed bydependsOn.242526cert-manageris not added:clusterOperator.webhook.enabledstaysfalse, so the operator runs withENABLE_WEBHOOKS=false. Trade-off:RabbitmqClusterCRs get no admission validation.2930crds/files unconditionally, including the messaging-topology CRDs, even withmsgTopologyOperator.enabled: false; they are inert with no controller.3132apps; a missing path leaves the broker Pending forever.373839Out-of-scope notes
ScaledObject,TriggerAuthentication, queuesim-tasks) is not part of this issue — no scaling target pods exist yet. Its Vault credentials can reusesecret/rabbitmq/config.msgTopologyOperatoris left disabled, sosim-tasksand per-service users are not declared declaratively here; the orchestrator's idempotentqueue.declarecovers it.rabbitmq.comhas no entry in the datreeio CRD catalog, sokubeconform -ignore-missing-schemasskips the CR offline; L2 only dry-runs the preview overlay, so the CR's real schema check happens at L3.404142 unverified — the catalog does carryrabbitmq.com/rabbitmqcluster_v1beta1.json(verified since 2022), and L1 validates it against that catalog; L2/L3 only ever renderapps/preview, so neither is the gate this bullet claims.Acceptance Criteria
python -m pytest tests/ -vpasses, including the newrabbitmq.comrow intest_crd_providers_are_not_in_the_layer_that_uses_their_crdsand the(4, 4)VSO count.flux buildrendersinfrastructure,secrets, andapps;grepfinds no cert-manager HelmRelease,Certificate, orIssueranywhere ingitops/.kubectl -n rabbitmq get rabbitmqcluster/rabbitmq -o jsonpath='{.status.conditions[?(@.type=="AllReplicasReady")].status}'returnsTrue.rabbitmq.rabbitmq.svc.cluster.local:5672and:15672both answer from a throwaway in-cluster pod authenticated with the credentials insecret/rabbitmq-credentials.secret/rabbitmq-default-userdoes not exist (provessecretBackend.externalSecrettook effect) andsecret/rabbitmq-credentialscarries a non-emptydefault_user.conf.Testing Plan
kustomize build+ kubeconform + conftest + namespace/PSA/CRD-layer/VSO-shape guards) — the CRD-layer row must fail if the operator and theRabbitmqClusterCR are ever put in one layer.tests/test_chart_sources.pyproves the pinned0.6.16OCI tag exists.kubectl -n rabbitmq get pods,pvc,svc— onerabbitmq-server-0Running/Readywith a boundpersistentPVC.kubectl -n rabbitmq port-forward svc/rabbitmq 15672:15672, then log in with the Vault username/password;/api/overviewreturns 200.sim-tasksfrom a throwaway pod using the same Secret.Related Issues/PRs
ARCHITECTURE.md§4 (RabbitMQ allocation) and §6/§7 (KEDA, network topology) — the pre-agreed constraints.OCIRepository/HelmRelease/VSO shape is reused here.ScaledObjectforsim-tasks(ARCHITECTURE.md §4, §6).Research Findings
bitnami/rabbitmq-cluster-operatorimages returned 404), leaving the cloudpirates OCI chart as the only chart using the official arm64ghcr.io/rabbitmq/cluster-operator:2.23.0image.rabbitmqwith 5672, 15672, and 15692 as ClusterIP, so KEDA can reach the management API without extra configuration.spec.secretBackend.externalSecretlets VSO own the default-user Secret; its native Vault integration needs the Vault Agent Injector, which Milner disables.TriggerAuthenticationcan only reference a Secret in the same namespace as theScaledObject, and ARCHITECTURE.md'sguest:guesttrigger can never work becauseguestis loopback-only.Pre-Mortem
clusterOperator.webhook.enableddefaulting tofalseand on exact value keys/digest pins that were never rendered locally, so a schema mismatch fails the HelmRelease or, worse, silently deploys cert-managerIssuer/Certificateobjects. With no official chart and no maintainer fallback, an upstream value rename leaves Milner without a broker until the chart is re-pinned.secretBackend.externalSecretmakes the StatefulSet wait forrabbitmq-credentials, so if the Vault path is not bootstrapped first or the VSOdestination.transformation.templatesshape differs from the installed VSO version,rabbitmq-server-0stays Pending with no obvious error. Because the plan treats the template as known-good rather than testing the rendereddefault_user.conf, this surfaces only on the live cluster.RabbitmqClusterCR.kubeconformruns with-ignore-missing-schemasandrabbitmq.comhas no catalog entry, so wrong field names such assecretBackendorpersistencepass CI and fail at apply time; meanwhile the brittle exact-count assertion ((4, 4)VSO objects, the newchartRefbranch) can fail the suite for unrelated reasons. Either failure mode stops the PR without proving the broker actually works.