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

Support additional containers and volumes in TiDB cluster #2229

Merged
merged 3 commits into from
Jun 19, 2020

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Apr 17, 2020

Signed-off-by: yeya24 yb532204897@gmail.com

UCP: #2186

What problem does this PR solve?

fixes: #2186

What is changed and how does it work?

Add additionalContainers and additionalVolumes fields so that Tidb-operator can support adding sidecars to TiDB, TiKV, PD, etc.

Check List

Tests

  • Unit test
  • E2E test
  • Stability test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has Go code change
  • Has CI related scripts change
  • Has Terraform scripts change

Side effects

  • Breaking backward compatibility

Related changes

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

Does this PR introduce a user-facing change?:

Add `additionalContainers` and `additionalVolumes` fields so that Tidb-operator can support adding sidecars to `TiDB`, `TiKV`, `PD`, etc.

@sre-bot
Copy link
Contributor

sre-bot commented Apr 17, 2020

Thanks for your contribution. If your PR get merged, you will be rewarded 100 points.


// Additional containers of the component.
// +optional
Containers []corev1.Container `json:"containers,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think Containers here would be misleading for user. What about Sidecars? As kubernetes support sidecar lifecycle since 1.18, this would be more clear for user to understand.

Copy link
Contributor Author

@yeya24 yeya24 Apr 20, 2020

Choose a reason for hiding this comment

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

Umm, what about additionalContainers? Although this name is longer, but Sidecars is not clear enough. Because something like slow log is already part of the tidb pod

Copy link
Contributor

Choose a reason for hiding this comment

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

additionalContainers is ok to me.


// Additional volumes of the component.
// +optional
Volumes []corev1.Volume `json:"volumes,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto, if Volumes here is only used for sidecars, we should declare it in 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.

additionalVolumes?

Copy link
Contributor

Choose a reason for hiding this comment

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

additionalVolumes is ok to me.

@yeya24
Copy link
Contributor Author

yeya24 commented May 26, 2020

/run-e2e-test

1 similar comment
@yeya24
Copy link
Contributor Author

yeya24 commented May 27, 2020

/run-e2e-test

@yeya24
Copy link
Contributor Author

yeya24 commented Jun 1, 2020

@Yisaer Could you please take a look? The e2e failure is not related to this PR.

Yisaer
Yisaer previously approved these changes Jun 2, 2020
Copy link
Contributor

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

LGTM

@Yisaer
Copy link
Contributor

Yisaer commented Jun 2, 2020

@yeya24 please add the release note and fulfill the request description.

@yeya24
Copy link
Contributor Author

yeya24 commented Jun 2, 2020

@yeya24 please add the release note and fulfill the request description.

I am sorry I don't know what should I update. Is it okay now?

@Yisaer
Copy link
Contributor

Yisaer commented Jun 3, 2020

@yeya24 please add the release note and fulfill the request description.

I am sorry I don't know what should I update. Is it okay now?

it's ok for me


// Additional volumes of the component.
// +optional
AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a question about how to consume additional volumes?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good question. @yeya24 WDYT?

Copy link
Contributor Author

@yeya24 yeya24 Jun 5, 2020

Choose a reason for hiding this comment

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

Good question! In my first thought, the AdditionalVolumes is only designed for the additional sidecar containers since we have the AdditionalContainers field so we can define the volumeMount there.

So it doesn't support to add additional volumeMount for the component itself (TiDB, TiKV, PD, etc). Maybe we can consider adding it in the future, but currently not needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed, If you want to use sidecar to collect log or tracing, shared volume is required.

Copy link
Contributor

Choose a reason for hiding this comment

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

"So it doesn't support to add additional volumeMount for the component itself (TiDB, TiKV, PD, etc).", make this clear in the comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yeya24
Copy link
Contributor Author

yeya24 commented Jun 9, 2020

/run-e2e-test

@yeya24
Copy link
Contributor Author

yeya24 commented Jun 10, 2020

@Yisaer Sorry for the ping, is it good to merge now?

Yisaer
Yisaer previously approved these changes Jun 10, 2020
Copy link
Contributor

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

LGTM @cofyc PTAL

@DanielZhangQD
Copy link
Contributor

@yeya24 Please help update doc here when this PR is merged and give a detailed example for how to use this, thanks!

@yeya24
Copy link
Contributor Author

yeya24 commented Jun 11, 2020

/run-e2e-test

@Yisaer
Copy link
Contributor

Yisaer commented Jun 16, 2020

@yeya24 the codes LGTM, plz solve the conflicts.

Signed-off-by: yeya24 <yb532204897@gmail.com>
@yeya24
Copy link
Contributor Author

yeya24 commented Jun 16, 2020

/run-e2e-test

@yeya24
Copy link
Contributor Author

yeya24 commented Jun 16, 2020

Updated.

@yeya24 yeya24 requested a review from zjj2wry June 17, 2020 13:24
@yeya24
Copy link
Contributor Author

yeya24 commented Jun 17, 2020

@DanielZhangQD Could you please do a quick review? I guess it is ready to go

Copy link
Contributor

@DanielZhangQD DanielZhangQD left a comment

Choose a reason for hiding this comment

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

LGTM

@DanielZhangQD
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 2754
  • 2754

@DanielZhangQD
Copy link
Contributor

@DanielZhangQD Could you please do a quick review? I guess it is ready to go

@yeya24 Sorry for the late review. Thanks for your contribution!

@Yisaer
Copy link
Contributor

Yisaer commented Jun 19, 2020

/run-e2e-in-kind

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit edf15c0 into pingcap:master Jun 19, 2020
ti-srebot pushed a commit to ti-srebot/tidb-operator that referenced this pull request Jun 19, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-1.1 in PR #2777

ti-srebot added a commit that referenced this pull request Jun 19, 2020
)

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Ben Ye <yb532204897@gmail.com>
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.

UCP: support TidbCluster additional sidecar.
6 participants