-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support to orphaned driver pod #8
Conversation
Migrate from gitlab to continue discussion |
de7865c
to
7c72eeb
Compare
Signed-off-by: Fred Rolland <[email protected]>
Thanks @rollandf. I did a quick review and this looks good to me. |
pkg/upgrade/upgrade_state.go
Outdated
@@ -506,12 +541,49 @@ func (m *ClusterUpgradeStateManagerImpl) ProcessDoneOrUnknownNodes( | |||
return nil | |||
} | |||
|
|||
// podInSyncWithDS returns true if the Pod and DS have the same Controller Revision Hash, or if Pod is orphaned | |||
func (m *ClusterUpgradeStateManagerImpl) podInSyncWithDS(ctx context.Context, nodeState *NodeUpgradeState) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we split conditions for clarity ?
e.g return: (inSync, orphaned, error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small question/comments otherwise lgtm
pkg/upgrade/upgrade_state.go
Outdated
@@ -43,6 +43,11 @@ type NodeUpgradeState struct { | |||
DriverDaemonSet *appsv1.DaemonSet | |||
} | |||
|
|||
// IsOrphanedPod returns true if Pod is not associated to a DaemonSet or is not managed by a DaemonSet | |||
func (nus *NodeUpgradeState) IsOrphanedPod() bool { | |||
return nus.DriverDaemonSet == nil && nus.DriverPod != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can DriverPod ever be nil ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot actually
pkg/upgrade/upgrade_state.go
Outdated
@@ -43,6 +43,11 @@ type NodeUpgradeState struct { | |||
DriverDaemonSet *appsv1.DaemonSet | |||
} | |||
|
|||
// IsOrphanedPod returns true if Pod is not associated to a DaemonSet or is not managed by a DaemonSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not associated to a DaemonSet or is not managed by a DaemonSet
whats the difference between associated and managed by DaemonSet ? is it the same ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
realized i asked to change the wording originally :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits from me. Overall this lgtm, thanks @rollandf
- Add orphaned driver pods in the state built - Ignore not scheduled pod in the state built - Support upgrade-requested annotation to force moving to upgrade-required state With this functionality, upgrading from a DS to a new one is possible, with the following assumptions: - New DS should have Node Anti Affinity to prevent scheduling new driver pods where old still run. - The old DS should be deleted by Operator with DeletePropagationOrphan option to keep the old driver pods running until the upgrade flow replaces them. In addition, it will also be possible to only detach the pod from DaemonSet to migrate to new DaemonSet. Signed-off-by: Fred Rolland <[email protected]>
Thanks @cdesiniotis for the review. I fixed according to your comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I have triggered the CI.
mergin per 2 LGTMs ! thx for working on it @rollandf ! |
upgrade-required state
With this functionality, upgrading from a DS to a new one
is possible, with the following assumptions:
new driver pods where old still run.
option to keep the old driver pods running until the upgrade flow
replaces them.
In addition, it will also be possible to only detach the pod from
DaemonSet to migrate to new DaemonSet.