Skip to content

add tibr controller #6223

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

Merged
merged 4 commits into from
Jun 5, 2025
Merged

add tibr controller #6223

merged 4 commits into from
Jun 5, 2025

Conversation

grovecai
Copy link
Contributor

@grovecai grovecai commented May 29, 2025

Support following operations

  1. create / delete with/without tls
  2. support pod and pvc overlay
  3. cluster deleted
  4. cluster suspend
  5. cluster pause

what is not?

  1. support tibr update. ps: recreate as workround
  2. e2e test

What problem does this PR solve?

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


Copy link
Contributor

ti-chi-bot bot commented May 29, 2025

Hi @grovecai. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@github-actions github-actions bot added the v2 for operator v2 label May 29, 2025
Copy link

/run-pull-e2e-kind-v2

Copy link

/run-pull-e2e-kind-v2

Copy link

/run-pull-e2e-kind-v2

Copy link

/run-pull-e2e-kind-v2

Copy link

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 1, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 1, 2025

/run-pull-e2e-kind-v2

@grovecai grovecai changed the title WIP: add tibr controller add tibr controller Jun 1, 2025
Copy link

github-actions bot commented Jun 1, 2025

/run-pull-e2e-kind-v2

@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2025

Codecov Report

Attention: Patch coverage is 36.45700% with 495 lines in your changes missing coverage. Please review.

Project coverage is 47.03%. Comparing base (af57199) to head (173a49d).

Additional details and impacted files
@@              Coverage Diff               @@
##           feature/v2    #6223      +/-   ##
==============================================
- Coverage       47.43%   47.03%   -0.40%     
==============================================
  Files             283      295      +12     
  Lines           18762    19541     +779     
==============================================
+ Hits             8899     9192     +293     
- Misses           9863    10349     +486     
Flag Coverage Δ
unittest 47.03% <36.45%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

github-actions bot commented Jun 1, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 2, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 2, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 3, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 3, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 4, 2025

/run-pull-e2e-kind-v2

// Define this as array for future extension
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=1
Copy link
Member

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently, only need one optional volume "data"


Spec: appsv1.StatefulSetSpec{
ServiceName: HeadlessSvcName(tibr),
Replicas: ptr.To(StatefulSetReplica),
Copy link
Member

Choose a reason for hiding this comment

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

If only one replica is needed, I think using pod directly is better than using statefulset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discuss offline, statefulset is easy satisfy auto restart and auto pv provisioning.

}

func StatefulSetName(tibr *v1alpha1br.TiBR) string {
return tibr.Name + "-sts"
Copy link
Member

Choose a reason for hiding this comment

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

add component name into all kubernetes resources to avoid name conflict.

Copy link
Member

Choose a reason for hiding this comment

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

normally {groupName}-{component}-{custom name}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link

github-actions bot commented Jun 4, 2025

/run-pull-e2e-kind-v2

Copy link

github-actions bot commented Jun 4, 2025

/run-pull-e2e-kind-v2

@liubog2008
Copy link
Member

/lgtm

@ti-chi-bot ti-chi-bot bot added the lgtm label Jun 5, 2025
Copy link
Contributor

ti-chi-bot bot commented Jun 5, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-06-05 02:29:20.046654447 +0000 UTC m=+495246.248999713: ☑️ agreed by liubog2008.

Copy link
Contributor

ti-chi-bot bot commented Jun 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liubog2008

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jun 5, 2025
@ti-chi-bot ti-chi-bot bot merged commit 283e8b1 into pingcap:feature/v2 Jun 5, 2025
9 checks passed
@grovecai grovecai deleted the yuanrui/tibrc branch July 29, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants