feat(bootstrap): manage local infrastructure with Argo CD - #731
Conversation
Install Rook and CloudNativePG through Argo CD applications and wait for the requested revisions to become healthy and synced before continuing. Add configurable Ceph device filters, make the local RBD storage class the default, streamline installer bundle preparation, and update the bootstrap-local CLI documentation.
Signed-off-by: schrodit <7979201+schrodit@users.noreply.github.com>
Document the exported bootstrap APIs, wrap cross-package errors with operation context, and apply the repository formatter to the changed files.
OliverTrautvetter
left a comment
There was a problem hiding this comment.
Some questions and ideas to improve it
| CreateNamespace: true, | ||
| return b.installHelmApplication(helmApplicationConfig{ | ||
| Name: cnpgReleaseName, Chart: "cloudnative-pg", RepoURL: cnpgRepoURL, | ||
| TargetRevision: "*", Namespace: codesphereNamespace, |
There was a problem hiding this comment.
For rook we have
rookVersion = "v1.19.6"
but here we use the latest version. So Argo CD will silently upgrade the cloudnative-pg operator to whatever latest is.
Do we want that?
in postgres.go we have it pinned
cnpgDatabaseVersion = "15.14"
There was a problem hiding this comment.
I guess even better would be to use the version from the bom
| return b.installHelmApplication(helmApplicationConfig{ | ||
| Name: rookReleaseName, Chart: "rook-ceph", RepoURL: rookRepoURL, | ||
| TargetRevision: rookVersion, Namespace: rookNamespace, Values: helmValues, | ||
| }) |
There was a problem hiding this comment.
What happens when this runs against a cluster where Rook/CNPG were previously installed via direct helm upgrade?
Or do we just assume it is only used on fresh clusters?
There was a problem hiding this comment.
doesn't matter argo just takes over
| cephBlockPoolName = "codesphere-rbd" | ||
| cephStorageClassName = "codesphere-rbd" | ||
| cephRBDProvisionerName = "rook-ceph.rbd.csi.ceph.com" | ||
| defaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class" |
There was a problem hiding this comment.
what if something else is already default class?
There was a problem hiding this comment.
good point. will add a check for that and only set a default class if there is not another one
| if err := kubeClient.Get(ctx, client.ObjectKey{Name: name, Namespace: DefaultNamespace}, app); err != nil { | ||
| logf("Waiting for ArgoCD Application %q: failed to read status: %v", name, err) | ||
| return false, nil | ||
| } | ||
|
|
||
| lastHealth, lastSync = string(app.Status.Health.Status), string(app.Status.Sync.Status) |
There was a problem hiding this comment.
Would a non NotFound error not also trigger this 30 minute timeout? So for example a 403 Forbidden?
| } | ||
|
|
||
| desired := &argov1alpha1.Application{ | ||
| ObjectMeta: metav1.ObjectMeta{Name: cfg.Name, Namespace: "argocd"}, |
There was a problem hiding this comment.
nit, this could use DefaultNamespace instead of "argocd"
Prepare the installer bundle before bootstrap dependencies and pin the CloudNativePG operator chart to the version from the installer BOM. Preserve an existing default storage class and fail fast on non-retryable Argo CD API errors.
|
Implemented the review feedback in commit
Verification:
|
Parse the installer BOM during bundle preparation and pass the resulting config to CNPG and pc-apps consumers. Keep BOM file handling at orchestration boundaries instead of reparsing paths in downstream installers.
|
Follow-up implemented in
Verification remains green: |
Summary
--ceph-device-filterand--ceph-device-path-filteroptions while retaining all-device selection as the defaultcodesphere-rbdstorage class as the default storage classbootstrap-localcommand documentation and ignore localtmp/artifactsTesting
go test ./...git diff --check