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

Remove helm hook annotation for initializer job #526

Merged
merged 8 commits into from
May 30, 2019

Conversation

aylei
Copy link
Contributor

@aylei aylei commented May 27, 2019

Signed-off-by: Aylei rayingecho@gmail.com

What problem does this PR solve?

close #523

A fix for wrong conditional expression is also included (and & or are functions in golang template, refer to template#functions)

What is changed and how it works?

Helm hook removed

Check List

Tests

  • Manual test

Code changes

  • Has Helm charts change

@LinuxGit @xiaojingchen @tennix PTAL

@aylei
Copy link
Contributor Author

aylei commented May 27, 2019

/run-e2e-tests

1 similar comment
@aylei
Copy link
Contributor Author

aylei commented May 27, 2019

/run-e2e-tests

@aylei
Copy link
Contributor Author

aylei commented May 27, 2019

/run-e2e-tests

Signed-off-by: Aylei <rayingecho@gmail.com>
@aylei
Copy link
Contributor Author

aylei commented May 27, 2019

/run-e2e-tests

Copy link
Contributor

@xiaojingchen xiaojingchen left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Aylei <rayingecho@gmail.com>
@aylei
Copy link
Contributor Author

aylei commented May 28, 2019

After communicating with @weekface , make the original tidb-configmap stable is a better idea. I've updated this PR accordingly.

@xiaojingchen PTAL again😆

@aylei
Copy link
Contributor Author

aylei commented May 28, 2019

/run-e2e-tests

apiVersion: v1
kind: ConfigMap
metadata:
{{- if .Values.enableConfigMapRollout }}
name: {{ template "cluster.name" . }}-tidb-{{ template "tidb-configmap.data-digest" . }}
{{- else }}
name: {{ template "cluster.name" . }}-tidb
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 pd-configmap.yaml and tikv-configmap.yaml should also be modified.

Copy link
Contributor Author

@aylei aylei May 28, 2019

Choose a reason for hiding this comment

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

What's the purpose of this? pd-configmap and tikv-configmap are only intended to be referenced by the corresponding statefulset and there's no compatibility issue.

BTW, actually there is an issue about configmap rollout: the old configmap will be deleted when the new configmap created, which will cause the old controller-revision's reference to the old configmap is invalid. Although this issue is not a problem now because of the careful statefulset upgrade procedure, it should (and will) be fixed for better maintainability (it is out of the scope of this issue, of course).

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, it is not related to this issue. Another PR is more reasonable.

Copy link
Contributor

@weekface weekface left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

I think it's better to separate the initializer configurations with tidb itself configurations. So the initializer job can have a standalone stable configmap.

@aylei
Copy link
Contributor Author

aylei commented May 29, 2019

I think it's better to separate the initializer configurations with tidb itself configurations. So the initializer job can have a standalone stable configmap.

Yes, It should be if there's no backward compatibility issue. If we choose a different configmap name for initializer job, users who have tidb-clusters installed cannot upgrade to our new chart because of the change of configmap name in the initializer job, which will cause an error because the podTemplate of Jobs is immutable.

@tennix
Copy link
Member

tennix commented May 29, 2019

The job should be run once. Does helm try to upgrade the Job even if it's already completed?

@aylei
Copy link
Contributor Author

aylei commented May 29, 2019

The job should be run once. Does helm try to upgrade the Job even if it's already completed?

According to my previous experience, it is. That's why I added the helm hook annotation in the initializer job (to avoid upgrading after installing), but this was proven to be un-acceptable due to the wait time when install tidb-cluster.

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

LGTM

@tennix tennix merged commit 33e4142 into pingcap:master May 30, 2019
yahonda pushed a commit that referenced this pull request Dec 27, 2021
* zh: add get-started tutorial

* Apply suggestions from code review

Thanks for the review!

Co-authored-by: Ran <huangran@pingcap.com>

* Apply suggestions from code review

Co-authored-by: Ran <huangran@pingcap.com>

* Apply suggestions from code review

Co-authored-by: DanielZhangQD <36026334+DanielZhangQD@users.noreply.github.com>

* fix

* delete kind/minikube

* fix anchor links

* fix

* sync pingcap/docs-tidb-operator#542

* refine some expression

Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: DanielZhangQD <36026334+DanielZhangQD@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm webhook blocks tidb-cluster installation
4 participants