[apps] [foundationdb] Initial support for FoundationDB operator
PaaS and framework that replace or compete with AWS, VMware
Brought to you by:
cozystack
Originally created by: insignia96
This PR adds initial support to begin testing managed FoundationDB instances in Cozystack. Addresses [#824]
[apps] Add FoundationDB as a managed app for tenants
[foundationdb] Add fdb-kubernetes-operator with v2.13.0
Added managed FoundationDB app and operator with Helm charts to deploy configurable clusters (storage, resources, backups, monitoring, workload monitor).
Documentation
Added comprehensive README, default values, and a JSON Schema for chart configuration and validation.
Tests
Added end-to-end test provisioning a FoundationDB cluster, validating rollout, health, monitoring artifacts, security context, storage claims, and cleanup.
Chores
Originally posted by: coderabbitai[bot]
Walkthrough
Adds a FoundationDB application Helm chart (templates, values, schema, docs, Makefile), bundles the FoundationDB Kubernetes operator (charts, CRDs, operator templates, Makefile), registers FoundationDB resource definitions and versions in Cozystack API/platform bundles, and adds an end-to-end BATs test validating deployment lifecycle.
Changes
hack/e2e-apps/foundationdb.batstenant-test, waits for HelmRelease/FoundationDBCluster readiness, asserts pods/WorkloadMonitor/ConfigMap/health/securityContext/PVCs, and verifies deletion/cleanup with polling/timeouts.packages/apps/foundationdb/.helmignore,packages/apps/foundationdb/Chart.yaml,packages/apps/foundationdb/Makefile,packages/apps/foundationdb/README.md,packages/apps/foundationdb/charts/cozy-libgeneratetarget), README, and cozy-lib reference.packages/apps/foundationdb/values.yaml,packages/apps/foundationdb/values.schema.jsonpackages/apps/foundationdb/templates/_resources.tpl,.../cluster.yaml,.../backup.yaml,.../workloadmonitor.yaml,.../dashboard-resourcemap.yaml,.../role.yaml,.../rolebinding.yaml,.../serviceaccount.yamlpackages/system/cozystack-api/openapi-schemas/foundationdb.json,packages/system/cozystack-api/templates/cozystack-resource-definitions.yaml,packages/apps/versions_mapfoundationdb 0.1.0 HEADto versions_map.packages/system/foundationdb-operator/.helmignore,packages/system/foundationdb-operator/Chart.yaml,packages/system/foundationdb-operator/MakefileupdateMakefile to sync upstream fdb-kubernetes-operator charts/CRDs (tag v2.13.0).packages/system/foundationdb-operator/charts/fdb-operator/Chart.yaml,.../crds/...foundationdbrestores.yaml,.../templates/_helpers.tpl,.../templates/manager/deployment.yaml,.../templates/rbac/*,.../templates/serviceaccount.yaml,.../templates/NOTES.txt,.../values.yamlpackages/system/foundationdb-operator/values.yaml,packages/core/platform/bundles/*.yaml,packages/system/dashboard/values.yamlfoundationdb-operatorreleases in distro/paas bundles, and adds FoundationDB entry to dashboard config.Sequence Diagram(s)
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
cozyvalues-genfor chart README/schema generation.Suggested reviewers
Poem
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation | | :----------------: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title Check | ✅ Passed | The title succinctly and accurately describes the primary change—adding initial support for the FoundationDB operator—and follows the repository’s tagging convention ([apps] [foundationdb]). It is concise, specific, and informative for reviewers scanning the commit history. | | Docstring Coverage | ✅ Passed | No functions found in the changes. Docstring coverage check skipped. |✨ Finishing touches
- [ ] 📝 Generate Docstrings🧪 Generate unit tests
- [ ] Create PR with unit tests - [ ] Post copyable unit tests in a commentThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands and usage tips.Originally posted by: lllamnyp
Hi @insignia96 !
Thanks for taking the time to contribute to Cozystack. This looks really cool! Ping us up once you're ready to mark this PR as ready for review and we'll be happy to test your addition.
Originally posted by: lllamnyp
By the way, could you please run
make generatefor the Makefile in./packages/system/cozystack-apiand update./packages/system/cozystack-api/templates/cozystack-resource-definitions.yamlwith a config for the new app? The format there should be pretty self-explanatory.Originally posted by: insignia96
Thanks @lllamnyp ! I appreciate the feedback. This is still a WIP as I am working on getting an environment for testing. I was wondering about generating the API parts so that is very helpful. I am still working on figuring out how to use my bare-metal nodes to run the tests. Can you run the actual E2E tests on the buildkit or do you use some other method to run the tests on a bare-metal node in the cluster?
Originally posted by: lllamnyp
If you were to mark this as ready for review, we would be able to run tests on our runners. We do in fact run tests with buildkit, essentially, we have a powerful metal server that fires up three qemu-kvm nodes for cozystack and runs everything inside of them. If you already have a Cozystack cluster running, you could install your new build on top of that, by running
make applyfrom a number of directories in your local environment. Can't give exact steps off the top of my head, I'll see if I can get you some more detailed instructions.Originally posted by: insignia96
@lllamnyp I have marked this as ready for review after making the changes you mentioned. I do have one bare metal node in my cluster that could work to run the test setup in the repo. I am working on getting that set up to test on my end as well.
Originally posted by: insignia96
@lllamnyp Okay, as of this latest commit, I think this is in a good working state and I have run the tests in my cluster to verify it seems to work. Backups have not been tested yet, but the core functionality seems to be there in the rest. It is probably ready if you all would like to test it as well.
Future roadmap items would be:
Originally posted by: lllamnyp
Great! We'll get this tested.
Originally posted by: lllamnyp
@insignia96 could you rebase your branch against main to trigger the workflow for the newest CI config?
Originally posted by: insignia96
@lllamnyp Okay, this should be done now.
As far as the backups and other roadmap items I mentioned, I am running into a bit of an issue with the backup and TLS functions and I wanted to solicit the advice of the maintainers on the best way to handle this for Cozystack. FoundationDB and the operator have some interesting constraints on credentials and certificates. In order to run commands against the database it is managing when TLS is used, the operator needs to have access to the cluster CA cert and a client cert/key pair, and for backups the operator needs access to the same blob credentials secret that the backup-agent pods in the actual database also need. Since the operator fundamentally lacks support for the kind of multi-tenancy Cozystack is designed for, because it cannot handle more than one TLS configuration or blob credential file at a time, I am thinking the best solution may be to migrate the operator to an extra feature that can be installed per-namespace, to allow isolation between tenant secrets and CAs, but the need to have the secrets in both parent and child namespaces and the operators limitations might cause an issue with properly implementing tenant inheritance it is implemented for other extra features. The operator can only be in global mode or watching one namespace. If this approach sounds okay, I could rework this to move the operator from a system namespace to an extra feature.
As it stands now, the chart as-is would require only some minor updates to allow cluster administrators to enable backups and TLS, but it would not be possible for the operator to manage any other clusters that are non-TLS or using different certs, and the cluster administrator would have to manually manage the secrets for the operator in the system-level opearator namespace similar to the process for backing up tenant Kubernetes using Velero.
Originally posted by: lllamnyp
Sorry for taking a while, I was away for the latter half of last week. Looks like we're still struggling to get external PRs working properly. I'll test this manually and will come back with feedback soon.