-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add node pool garbage collector and improve events
- Loading branch information
Showing
10 changed files
with
233 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cloud | ||
|
||
const ( | ||
keyPrefix = "google.com/" | ||
|
||
LabelNodepoolManager = keyPrefix + "nodepool-manager" | ||
LabelNodepoolManagerTPUPodinator = "tpu-provisioner" | ||
|
||
LabelParentKind = keyPrefix + "tpu-provisioner-parent-kind" | ||
LabelParentName = keyPrefix + "tpu-provisioner-parent-name" | ||
LabelParentNamespace = keyPrefix + "tpu-provisioner-parent-namespace" | ||
|
||
LabelPodName = keyPrefix + "tpu-provisioner-pod-name" | ||
LabelPodNamespace = keyPrefix + "tpu-provisioner-pod-namespace" | ||
|
||
EventNodePoolCreationStarted = "NodePoolCreationStarted" | ||
EventNodePoolCreationSucceeded = "NodePoolCreationSucceeded" | ||
EventNodePoolCreationFailed = "NodePoolCreationFailed" | ||
|
||
EventNodePoolDeletionStarted = "NodePoolDeletionStarted" | ||
EventNodePoolDeletionSucceeded = "NodePoolDeletionSucceeded" | ||
EventNodePoolDeletionFailed = "NodePoolDeletionFailed" | ||
|
||
EventNodePoolNotFound = "NodePoolNotFound" | ||
) |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,19 @@ | ||
package cloud | ||
|
||
import corev1 "k8s.io/api/core/v1" | ||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
var _ Provider = &Mock{} | ||
|
||
// Mock is useful for local development or debugging purposes to understand what | ||
// the controller would do without it doing anything. | ||
type Mock struct{} | ||
|
||
// TODO: Find a better mock node pool label key. | ||
func (m *Mock) NodePoolLabelKey() string { return "kubernetes.io/os" } | ||
func (m *Mock) EnsureNodePoolForPod(*corev1.Pod) error { return nil } | ||
func (m *Mock) DeleteNodePoolForNode(*corev1.Node) error { return nil } | ||
func (m *Mock) NodePoolLabelKey() string { return "kubernetes.io/os" } | ||
func (m *Mock) EnsureNodePoolForPod(*corev1.Pod, string) error { return nil } | ||
func (m *Mock) DeleteNodePoolForNode(*corev1.Node, string) error { return nil } | ||
func (m *Mock) DeleteNodePool(string, client.Object, string) error { return nil } | ||
func (m *Mock) ListNodePools() ([]NodePoolRef, error) { return nil, nil } |
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
Oops, something went wrong.