Skip to content

Conversation

gkech
Copy link
Contributor

@gkech gkech commented Aug 18, 2025

K8SPS-475 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:

While testing the expose primary functionality, we observed the following issues:

  • adding a label to exposePrimary applies label to selector and it breaks pod selection. we have the same problem with expose.labels

  • deleting the label from exposePrimary deletes the label from service selector but doesn't delete it from service metadata - 👉🏽 after checking with @pooknull , seems that this is actually a feature, so we will not change the behaviour.

The labels were also added by default to the already existing services and as a result, the pod selection was failing if the labels were not added to the respective component as well.

With this PR, we will add the labels only to the labels section and not to the selector. Selector labels will be added as a separate task, ticket: https://perconadev.atlassian.net/browse/K8SPS-486

Note that we also updated: router, haproxy and orchestractor, together with mysql to behave the same way.

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

Solution:

On top of the respective fixes for the selector and the deletion of the old labels, we added unit testing were missing.

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

@pull-request-size pull-request-size bot added the size/XS 0-9 lines label Aug 18, 2025
@pull-request-size pull-request-size bot added size/S 10-29 lines and removed size/XS 0-9 lines labels Aug 18, 2025
@pull-request-size pull-request-size bot added size/L 100-499 lines and removed size/S 10-29 lines labels Aug 18, 2025
@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/L 100-499 lines labels Aug 18, 2025
@pull-request-size pull-request-size bot added size/L 100-499 lines and removed size/M 30-99 lines labels Aug 19, 2025
@gkech gkech marked this pull request as ready for review August 20, 2025 11:03
@pull-request-size pull-request-size bot added size/XL 500-999 lines and removed size/L 100-499 lines labels Aug 21, 2025
@pooknull
Copy link
Contributor

deleting the label from exposePrimary deletes the label from service selector but doesn't delete it from service metadata

This is an expected behavior as specified here: https://perconadev.atlassian.net/browse/K8SPXC-1082

@pooknull
Copy link
Contributor

We will also add the labels only to the labels section and not to the selector

I suggest keeping the changes related only to this

@gkech
Copy link
Contributor Author

gkech commented Aug 21, 2025

We will also add the labels only to the labels section and not to the selector

I suggest keeping the changes related only to this

thanks @pooknull 🙌🏽

@JNKPercona
Copy link
Collaborator

Test name Status
version-service passed
async-ignore-annotations passed
auto-config passed
config passed
config-router passed
demand-backup passed
async-data-at-rest-encryption passed
gr-data-at-rest-encryption passed
gr-demand-backup passed
gr-demand-backup-haproxy passed
gr-finalizer passed
gr-haproxy passed
gr-ignore-annotations passed
gr-init-deploy passed
gr-one-pod passed
gr-recreate passed
gr-scaling passed
gr-scheduled-backup passed
gr-security-context 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
scheduled-backup passed
service-per-pod passed
sidecars passed
smart-update passed
storage passed
tls-cert-manager passed
users passed
pvc-resize failure
We run 38 out of 38

commit: bed66a5
image: perconalab/percona-server-mysql-operator:PR-1001-bed66a55

@hors hors merged commit c2c7ea4 into main Aug 27, 2025
21 of 23 checks passed
@hors hors deleted the K8SPS-475 branch August 27, 2025 09:11
egegunes pushed a commit that referenced this pull request Sep 5, 2025
* K8SPS-475 don't include expose labels to selector

* additions and fixes

* fix orchestrator selector

* dont keep old metadata for services, rely only on the ignore mechanism

* remove false to ensure service

* remove labels from selector

* fix router and haproxy selector

---------

Co-authored-by: Viacheslav Sarzhan <[email protected]>
Co-authored-by: Natalia Marukovich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL 500-999 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants