Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the logic to clean up the node when the peering is tearing down. This is composed of 4 steps: * node cordoning * eviction of pods using the Eviction API * waiting for pod deletion * delete the node
- Loading branch information
Showing
16 changed files
with
423 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package consts | ||
|
||
// NodeFinalizer is the finalizer added on a ResourceOffer when the related VirtualNode is up. | ||
const NodeFinalizer = "liqo.io/node" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package liqonodeprovider | ||
|
||
import ( | ||
"context" | ||
|
||
v1 "k8s.io/api/core/v1" | ||
"k8s.io/klog/v2" | ||
) | ||
|
||
// cordonNode cordons the controlled node setting it in the unschedulable state. | ||
func (p *LiqoNodeProvider) cordonNode(ctx context.Context) error { | ||
if err := p.patchNode(func(node *v1.Node) error { | ||
node.Spec.Unschedulable = true | ||
return nil | ||
}); err != nil { | ||
klog.Error(err) | ||
return err | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.