statefulset: Use stateful sets for posgres deployments (PROJQUAY-6672)
- Swap Postgres and Clair Postgres Deployments to StatefulSets
Summary by Sourcery
Convert Postgres deployments for Quay and Clair from Deployments to StatefulSets to improve database management and persistence
Enhancements:
- Migrate Postgres and Clair Postgres configurations from Deployments to StatefulSets to provide better stateful application management
CI:
- Update CI workflow to simplify test command
- Remove manual Kubebuilder installation step
Chores:
- Update Kustomize configurations and patches to reflect StatefulSet changes
- Modify Kubernetes resource management to use StatefulSet kind
/retest
/retest
@jonathankingfc: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| ci/prow/ocp-latest-e2e | 0ba46ee741263ba358fabaf26489156c59ae15e3 | link | true | /test ocp-latest-e2e |
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
@sourcery-ai summary
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
@sourcery-ai review
@sourcery-ai guide
Reviewer's Guide by Sourcery
This pull request migrates the Postgres and Clair Postgres deployments to StatefulSets for improved database management and persistence. The Kustomize configurations and patches have been updated to reflect these changes. The test command in the Makefile has been simplified, and the Kubebuilder installation process in the CI workflow has been updated. Finally, the StatefulSet kind was added to the kustomize package.
Updated class diagram for Kustomize ModelFor function
classDiagram
class client.Object {
}
class apps.StatefulSet {
}
client.Object <|-- apps.StatefulSet
note for apps.StatefulSet "Added StatefulSet type to ModelFor function"
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Migrated Postgres and Clair Postgres configurations from Deployments to StatefulSets. |
|
kustomize/components/clairpostgres/postgres.statefulset.yamlkustomize/components/postgres/postgres.statefulset.yamlkustomize/components/clairpostgres/kustomization.yamlkustomize/components/clairpgupgrade/base/clair-pg.statefulset.patch.yamlkustomize/components/clairpgupgrade/base/kustomization.yamlkustomize/components/pgupgrade/kustomization.yamlkustomize/components/pgupgrade/quay-pg.statefulset.patch.yamlkustomize/components/postgres/kustomization.yaml |
| Updated the Kustomize configurations and patches to reflect the StatefulSet changes. |
|
kustomize/components/clairpostgres/kustomization.yamlkustomize/components/clairpgupgrade/base/kustomization.yamlkustomize/components/pgupgrade/kustomization.yamlkustomize/components/postgres/kustomization.yaml |
| Simplified the test command in the Makefile and updated Kubebuilder installation in CI workflow. |
|
.github/workflows/ci.yamlMakefile |
| Added StatefulSet to the list of known Kinds in the kustomize package. |
|
pkg/kustomize/kustomize.go |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review! - Generate a plan of action for an issue: Comment
@sourcery-ai planon an issue to generate a plan of action for it.
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Hey @jonathankingfc - I've reviewed your changes - here's some feedback:
Overall Comments:
* Consider adding podManagementPolicy: Parallel to the StatefulSet spec to speed up deployments. * Consider adding updateStrategy to the StatefulSet spec to control the update process.Here's what I looked at during the review Sourcery is free for open source - if you like our reviews please consider sharing them ✨ Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Can you provide an example of the proposed changes?
Hey @jonathankingfc - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding podManagementPolicy: Parallel to the StatefulSet spec to speed up deployments.
- Consider adding updateStrategy to the StatefulSet spec to control the update process.
Here's what I looked at during the review Sourcery is free for open source - if you like our reviews please consider sharing them ✨ Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@sourcery-ai how did you evaluate tests?
@sourcery-ai plan
@sourcery-ai review
Sure! I'm generating a new review now.
Hey @deshpandevlab, I've posted a new review for you!
@sourcery-ai help