Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPG-708 replace ready/live probe http check with custom command, change pg entrypoint #1099

Merged
merged 47 commits into from
Apr 9, 2025

Conversation

gkech
Copy link
Contributor

@gkech gkech commented Mar 21, 2025

K8SPG-708 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
We are changing the probes from direct requests to patroni's restful api to a custom command so that we can get more flexibility on what can be executed for the live/ready checks of the pg container. For now this is needed so that we can introduce a sleep forever feature.

Deleted related PR: percona/percona-docker#1148

We are also introducing a new entrypoint for the database container which is defined in the percona-docker repo for now.

Testing sleep forever

Screenshot 2025-03-28 at 5 52 53 PM

Checking the creation of the /tmp/postgres file and verifying that pg_ctl -D /pgdata/pg17 start starts as expected

Screenshot 2025-04-03 at 2 24 08 PM

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

Comment on lines 151 to 152
container.LivenessProbe.Exec = &corev1.ExecAction{
Command: []string{"/usr/local/bin/postgres-liveness-check.sh"},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to do this change only for >2.7.0 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done here: c377050

@gkech gkech marked this pull request as ready for review March 24, 2025 11:25
@gkech gkech requested a review from egegunes March 26, 2025 08:02
egegunes
egegunes previously approved these changes Mar 26, 2025
@gkech gkech requested a review from nmarukovich March 26, 2025 18:04
@gkech gkech requested a review from egegunes March 28, 2025 15:58
@egegunes egegunes added this to the 2.7.0 milestone Mar 31, 2025
@gkech gkech changed the title K8SPG-708 replace ready/live probe http check with custom command K8SPG-708 replace ready/live probe http check with custom command, change pg entrypoint Apr 1, 2025
egegunes
egegunes previously approved these changes Apr 1, 2025
@gkech gkech changed the base branch from main to K8SPG-613 April 6, 2025 23:36
@gkech
Copy link
Contributor Author

gkech commented Apr 6, 2025

Note that this PR has base branch K8SPG-613 in order to utilize the init container spec and not be blocked

Base automatically changed from K8SPG-613 to main April 8, 2025 09:02
@@ -178,6 +178,7 @@ get_cr() {
.spec.users += [{"name":"postgres","password":{"type":"AlphaNumeric"}}] |
.spec.users += [{"name":"'${cr_name}'","password":{"type":"AlphaNumeric"}}] |
.spec.image = "'$IMAGE_POSTGRESQL'" |
.spec.initContainer.image = "perconalab/percona-postgresql-operator:K8SPG-708-12" |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we fix this image with main tag?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is just for tests. As soon as we see that all tests are ok we need to remove it at all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes correct, we have it only for these tests to work and to confirm that the PR is alright. We will change it on a followup PR after we merge.

@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions passed
custom-tls passed
demand-backup passed
finalizers passed
init-deploy passed
monitoring passed
monitoring-pmm3 passed
one-pod passed
operator-self-healing passed
pitr passed
scaling passed
scheduled-backup passed
self-healing passed
sidecars passed
start-from-backup passed
tablespaces passed
telemetry-transfer passed
upgrade-consistency passed
upgrade-minor passed
users passed
We run 20 out of 20

commit: 41fa93d
image: perconalab/percona-postgresql-operator:PR-1099-41fa93d8e

@gkech gkech requested a review from nmarukovich April 9, 2025 08:03
@gkech gkech merged commit a2dbe30 into main Apr 9, 2025
18 checks passed
@gkech gkech deleted the K8SPG-708 branch April 9, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants