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 388 small refactor on InitContainer, reuse it when needed - e2e test introduction for the case #811

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gkech
Copy link
Contributor

@gkech gkech commented Jan 20, 2025

K8SPS-388 Powered by Pull Request Badge

In this PR we followup on #806 and we add some small refactors to increase maintainability.

Resource Quotas yaml used for testing:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: resource-quota-kech
spec:
  hard:
    requests.cpu: "10"
    requests.memory: "16Gi"
    limits.cpu: "20"
    limits.memory: "32Gi"

Tested the following 2 scenarios:

  • spec.mysql.clusterType: group-replication
  • spec.mysql.clusterType: async

Screenshot 2025-01-20 at 1 41 41 PM

Resources testing:

Screenshot 2025-01-27 at 5 35 51 PM
Screenshot 2025-01-27 at 5 35 36 PM

CHANGE DESCRIPTION

Problem:
Short explanation of the problem.

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?
  • 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/L 100-499 lines label Jan 20, 2025
@CLAassistant
Copy link

CLAassistant commented Jan 20, 2025

CLA assistant check
All committers have signed the CLA.

@gkech gkech force-pushed the K8SPS-388 branch 3 times, most recently from 574d9df to f3f51f2 Compare January 20, 2025 11:04
@gkech gkech changed the title K8SPS 388 K8SPS 388 Introduce container resources where needed for when Resource Quotas are specified Jan 20, 2025
@gkech gkech marked this pull request as ready for review January 20, 2025 11:51
@@ -22,7 +22,6 @@ const (
configVolumeName = "config"
configMountPath = "/etc/binlog_server/config"
storageCredsVolumeName = "storage"
storageCredsMountPath = "/etc/binlog_server/storage"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this since it wasn't used anywhere in the codebase.

deploy/cr.yaml Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/XXL 1000+ lines and removed size/L 100-499 lines labels Jan 20, 2025
@pull-request-size pull-request-size bot added size/L 100-499 lines and removed size/XXL 1000+ lines labels Jan 20, 2025
@gkech gkech requested a review from egegunes January 21, 2025 10:53
@gkech gkech force-pushed the K8SPS-388 branch 2 times, most recently from b09cd00 to 62d68db Compare January 23, 2025 12:13
@gkech gkech changed the title K8SPS 388 Introduce container resources where needed for when Resource Quotas are specified K8SPS 388 small refactor on InitContainer, reuse it when needed Jan 23, 2025
requests.memory: "16Gi"
limits.cpu: "20"
limits.memory: "32Gi"
requests.cpu: "2"
Copy link
Contributor Author

@gkech gkech Jan 24, 2025

Choose a reason for hiding this comment

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

egegunes
egegunes previously approved these changes Jan 24, 2025
Comment on lines 8 to 10
requests.memory: "4Gi"
limits.cpu: "4"
limits.memory: "6Gi"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Increased memory in order to address some errors as reported here: https://percona-jenkins-artifactory-public.s3.amazonaws.com/cloud-ps-operator/PR-811/21e66a83/init-deploy.log

e.g.

    logger.go:42: 18:50:03 | init-deploy | 2025-01-24 18:43:39 +0000 UTC	Warning	StatefulSet.apps init-deploy-orc		FailedCreate	create Pod init-deploy-orc-1 in StatefulSet init-deploy-orc failed error: pods "init-deploy-orc-1" is forbidden: exceeded quota: init-deploy-resource-quota, requested: limits.memory=1Gi, used: limits.memory=2560Mi, limited: limits.memory=3Gi	statefulset-controller	

Copy link
Contributor Author

@gkech gkech Jan 27, 2025

Choose a reason for hiding this comment

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

commit: 7c64521

@gkech gkech requested a review from egegunes January 27, 2025 08:26
@gkech gkech changed the title K8SPS 388 small refactor on InitContainer, reuse it when needed K8SPS 388 small refactor on InitContainer, reuse it when needed - e2e test introduction for the case Jan 27, 2025
@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
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
tls-cert-manager passed
users passed
We run 34 out of 34

commit: 8a96dcd
image: perconalab/percona-server-mysql-operator:PR-811-8a96dcd8

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.

5 participants