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

K8SPS-291: Add prestop hook to MySQL pods #535

Merged
merged 12 commits into from
Feb 6, 2024
Merged

K8SPS-291: Add prestop hook to MySQL pods #535

merged 12 commits into from
Feb 6, 2024

Conversation

egegunes
Copy link
Contributor

@egegunes egegunes commented Jan 24, 2024

K8SPS-291 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
Terminated MySQL pods don't leave the cluster properly.

Solution:
Add a prestop hook to remove terminating pod from the cluster.

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?
  • 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 PS version?
  • Does the change support oldest and newest supported Kubernetes version?

build/ps-pre-stop.sh Outdated Show resolved Hide resolved
build/ps-pre-stop.sh Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@egegunes egegunes added this to the v0.7.0 milestone Jan 24, 2024
FQDN="${HOSTNAME}.${SERVICE_NAME}.${NAMESPACE}"

echo "$(date +%Y-%m-%dT%H:%M:%S%Z): Removing ${FQDN} from cluster" >>${LOG_FILE}
mysqlsh -i -u operator -p${OPERATOR_PASSWORD} -e "dba.getCluster().removeInstance('${FQDN}:3306')" >>${LOG_FILE} 2>&1
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe better to use admin port

Copy link
Contributor Author

Choose a reason for hiding this comment

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

build/ps-pre-stop.sh Outdated Show resolved Hide resolved
build/ps-pre-stop.sh Outdated Show resolved Hide resolved
egegunes and others added 2 commits January 26, 2024 13:15
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@hors hors self-requested a review January 30, 2024 20:22
Copy link
Collaborator

@hors hors left a comment

Choose a reason for hiding this comment

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

@egegunes please fix gr-scaling test

build/ps-pre-stop.sh Outdated Show resolved Hide resolved
@JNKPercona
Copy link
Collaborator

Test name Status
async-ignore-annotations passed
auto-config passed
config passed
config-router passed
demand-backup passed
gr-demand-backup passed
gr-demand-backup-haproxy passed
gr-haproxy passed
gr-ignore-annotations passed
gr-init-deploy passed
gr-one-pod passed
gr-recreate passed
gr-scaling passed
gr-self-healing passed
gr-tls-cert-manager passed
gr-users passed
haproxy passed
init-deploy passed
limits passed
monitoring passed
one-pod passed
operator-self-healing passed
recreate passed
scaling passed
service-per-pod passed
sidecars passed
smart-update passed
tls-cert-manager passed
users passed
version-service passed
We run 30 out of 30

commit: e69d4b7
image: perconalab/percona-server-mysql-operator:PR-535-e69d4b7

@hors hors self-requested a review February 6, 2024 07:46
@hors hors merged commit 023eeda into main Feb 6, 2024
14 checks passed
@hors hors deleted the K8SPS-291 branch February 6, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L 100-499 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants