Skip to content

CRC full request flow: GitHub config repository, writes, apply delivery #267

Closed

Description

@ephico2real2

Part of #18. Refs #157 (the owner's decision), #61, #97, #227.

What is wrong: On CRC, cmapi cannot run a namespace request at all. deploy/manifests/environments/crc/20-config.yaml has "writes":false on the one cluster and delivery.mode: argocd, and 10-env.yaml names CMAPI_GIT_URL: https://git-not-configured.invalid. ClusterRegistry.writable() raises 422 cluster-not-writable before any Git call, and Pipeline.plan_namespace calls it first, so even ?dryRun=true stops there (deploy/crc-proof.sh asserted exactly that). The owner's decision (2026-11-15, relayed on #157): enable the full flow on CRC now, with the private GitHub repository ephico2real2/cmapi-cluster-configs, a bot credential in a Secret, writes: true, and delivery.mode: apply with a deliverer identity on the narrowest write RBAC, recorded in docs/13 and reviewed.

Three things stand in the way beyond the config:

  1. BUG-12 BUG-12: A private-CA-only cmapi-trust will fail GitHub TLS in Wave 3 #97: the Git provider is given settings.verify (cmapi-trust, Keycloak's private CA alone), and httpx 0.28.1 honours SSL_CERT_FILE (also cmapi-trust in the pods) for verify=True (httpx/_config.py, create_ssl_context), so github.com cannot verify.
  2. The plain manifests have no deliverer: the chart's cmapi-deliverer ClusterRole and its ValidatingAdmissionPolicy cmapi-deliverer-managed-only (deploy/helm/cmapi/templates/rbac.yaml) have no plain counterpart.
  3. On GitHub, GitHubProvider.external_ci = True: pr_checks waits for check runs ci/kubeconform and ci/kyverno from the config repository's own Actions. cmapi-cluster-configs has no workflow, so every request would wait for syncTimeout and fail.

Where: deploy/manifests/environments/crc/10-env.yaml, 20-config.yaml; cmapi/src/cmapi/core/context.py (the make_provider call), cmapi/src/cmapi/settings.py; deploy/crc-proof.sh, deploy/crc-rollback.sh; docs/13-crc-deployment.md; the repository ephico2real2/cmapi-cluster-configs (no .github/).

How to prove it: On main 9407d8e, POST /api/v1/clusters/CRC/namespaces?dryRun=true on CRC's configuration answers 422 cluster-not-writable (cmapi/tests/service/test_crc_environment.py, as shipped). After the fix: the same configuration plans (200, nothing written), and a request is auto-approved, opened as a PR, merged after ci/* and cmapi/check, and applied (Namespace, ResourceQuota, <ns>-limits-cpu, <ns>-limits-memory) on a fake Git host and cluster; test_git_trust.py shows the Git provider verifying against its own bundle on a real TLS server and refusing one outside it; then the CRC run (docs/13) with the real GitHub repository.

Measured or inferred: Measured by reading main 9407d8e and running the tests named. On CRC: not run yet.

Severity: Medium. No request can be tested live on CRC, which is the owner's next step (#157).

What must hold after the fix: CRC's configuration writes through GitHub with TLS verified against public roots (never off); only the worker writes to the cluster, only to namespaces labelled cmapi.net/managed=true, enforced at admission; the api gets no write; no token in Git, logs or a command line; the rollback removes what it adds by name and stops while a delivered namespace remains; docs/13 says the run, and #227 (no branch protection on the free plan) is said out loud.

Research: Kubernetes, Server-Side Apply, "Access control and permissions": an apply that creates an object needs create as well as patch. RHEL's shared system certificates and update-ca-trust(8): /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem is the PEM bundle for TLS. ValidatingAdmissionPolicy is GA (admissionregistration.k8s.io/v1, Kubernetes 1.30); CRC serves it (Kubernetes v1.35.6, read with oc api-resources).

Solution: One pull request, Closes this and #97: the dedicated Git trust; the CRC config and env; deploy/manifests/environments/crc/deliverer/00-cmapi-deliverer.yaml ported from the chart with a parity test; proofs and rollback; docs/13, docs/18; a workflow template and its checker under examples/cluster-configs/.github/, copied into cmapi-cluster-configs by its own pull request.

Class: INV. A deployment choice the owner made (apply delivery on CRC) and the trust defect it exposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-Progressstatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions