fix(flux): let source-controller trust the internal CA #208
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/flux-internal-ca"
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?
The mirrored charts (harbor 1.19.2, vault 0.34.1) are pulled from
oci://harbor.grachevko.ru/charts/<name>and the OCIRepository fails withx509: certificate signed by unknown authority: that certificate is signed by the internal CA, while the node-level trust (talos/all/55-registry-harbor.yaml) covers kubelet only and does not extend to the Flux controllers.source-controller receives the CA the same way every other pod in this repository does: the ConfigMap
internal-ca, which the trust-manager Bundle already distributes into all namespaces, mounted into the pod withSSL_CERT_FILEpointing at it. The bundle carries the system roots as well (useDefaultCAs: true), so pulling from public registries keeps working.Chosen over
OCIRepository.spec.certSecretRef(per-object CA, available since source-controller v1.9.5): that path needs a Secret withca.crtin each app namespace, and the only declarative way to produce one is enabling trust-managersecretTargets, which this repository deliberately avoided (see the reasoning inkubernetes/apps/harbor/harbor/app/helmrelease.yaml). This patch adds no RBAC and keeps no copy of the CA, and it covers any future source behind the same certificate.Verified
ghcr.io/fluxcd/source-controller:v1.9.5, the version.mise/config.tomlpins). The merge is additive:SSL_CERT_FILEand theinternal-cavolume and mount are added, while the existing env (RUNTIME_NAMESPACE,TUF_ROOT,GOMEMLIMIT), mounts (data,tmp), volumes and resources stay as they are.flux-local test --enable-helm --all-namespaces --path kubernetes/flux/cluster --sources flux-system=.on this branch: 128 passed, no failures.Watch after merge
source-controller restarts with the new volume; afterwards the OCIRepository of harbor and vault must turn Ready and
x509: certificate signed by unknown authoritymust disappear from its logs. Check the OCIRepository status rather than the HelmRelease: an unreconciled source leaves the release on its last revision.Rollback
Revert the commit: source-controller returns to the image trust store, and the two OCIRepositories go back to failing with the same x509 error (the charts themselves are unaffected).