-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
osd: Ensure rook version label is not set on pod #11674
Conversation
The RookVersionLabelMatchesCurrent() method is no longer used, so remove it. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
The rook-version tag must not be set on the pod spec labels since it will result in the ceph daemons being restarted every time there is a rook version update, even if the ceph version or pod spec was not otherwise updated. The rook-version tag was being added to the OSD pod spec due to a shared pointer to the labels. The code intended to only add the version label to the deployment labels, but since the pod labels shared the map variable, the pod unintentionally also had the version label added. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
97a6bea
to
1ba93b4
Compare
@travisn if the cluster had been deployed, upgrade the image version of the rook operator, the osd, mon, mgr and rgw still restart ? it can only be use for new cluster? |
other question: the rook version label not only can not set on osd deployment, but the same with rgw, mon, mgr |
If the rook operator is upgraded, the ceph daemons may or may not restart, it depends on if the pod specs change. Sometimes the pod specs change during upgrade, and sometimes they don't. For example, if a release only has an mgr fix for the mgr pod spec, only the mgr pod would be restarted during upgrade, while other daemons should not restart.
I did not repro the issue with any other daemon except the osd. The rgw, mon, mgr did not have the |
@travisn Thanks, but I mean before upgrade the version of operator image, the label of the "rook-version" under the pod is "v1.10.11-1.g61c9b998e.dirty"; after upgraded(the image build from the branch with yours), the label of the "rook-version" under the pod is empty, so the resource of the pod changed, the osd will restart. |
Before upgrade:
After upgraded:
|
Correct, the first upgrade with this fix will cause the osd pods to restart since the label is removed. The advantage will be for future upgrades that won't have that issue anymore. |
osd: Ensure rook version label is not set on pod (backport #11674)
Description of your changes:
The rook-version tag must not be set on the pod spec labels since it will result in the ceph daemons being restarted every time there is a rook version update, even if the ceph version or pod spec was not otherwise updated.
The rook-version tag was being added to the OSD pod spec due to a shared pointer to the labels. The code intended to only add the version label to the deployment labels, but since the pod labels shared the map variable, the pod unintentionally also had the version label added.
Now the OSD pod will only be updated and restart if there is a ceph version change, or some other pod spec change on the OSD.
Surprisingly, this does not appear to be a regression, at least not any time recently.
Which issue is resolved by this Pull Request:
Resolves #11657
Checklist:
skip-ci
on the PR.