mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-24 14:10:49 -04:00
[node operator] PendingNode CRD definition
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
b36160e8a4
commit
59a9f49fbe
3 changed files with 94 additions and 13 deletions
|
@ -5,22 +5,64 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
const (
|
||||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
// NodeGoalJoin is the goal to join the cluster.
|
||||||
|
NodeGoalJoin PendingNodeGoal = "Join"
|
||||||
|
// NodeGoalLeave is the goal to leave the cluster and terminate the node.
|
||||||
|
NodeGoalLeave PendingNodeGoal = "Leave"
|
||||||
|
|
||||||
|
// NodeStateUnknown is the default state of the node if no information is available.
|
||||||
|
NodeStateUnknown CSPNodeState = "Unknown"
|
||||||
|
// NodeStateCreating is the state of the node when it is being created.
|
||||||
|
NodeStateCreating CSPNodeState = "Creating"
|
||||||
|
// NodeStateReady is the state of the node when it is ready to use.
|
||||||
|
// This state is reached when the CSP reports a node to be ready.
|
||||||
|
// This does not guarantee that a node has already joined the cluster.
|
||||||
|
NodeStateReady CSPNodeState = "Ready"
|
||||||
|
// NodeStateStopped is the state of the node when not running temporarily.
|
||||||
|
NodeStateStopped CSPNodeState = "Stopped"
|
||||||
|
// NodeStateTerminating is the state of the node when it is being terminated.
|
||||||
|
NodeStateTerminating CSPNodeState = "Terminating"
|
||||||
|
// NodeStateTerminated is the state of the node when it is terminated.
|
||||||
|
NodeStateTerminated CSPNodeState = "Terminated"
|
||||||
|
// NodeStateFailed is the state of the node when it encounters an unrecoverable error.
|
||||||
|
NodeStateFailed CSPNodeState = "Failed"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PendingNodeGoal is the desired state of PendingNode.
|
||||||
|
// Only one of the following goals may be specified.
|
||||||
|
// +kubebuilder:validation:Enum=Join;Leave
|
||||||
|
type PendingNodeGoal string
|
||||||
|
|
||||||
|
// CSPNodeState is the state of a Node in the cloud.
|
||||||
|
// Only one of the following states may be specified.
|
||||||
|
// +kubebuilder:validation:Enum=Unknown;Creating;Ready;Stopped;Terminating;Terminated;Failed
|
||||||
|
type CSPNodeState string
|
||||||
|
|
||||||
// PendingNodeSpec defines the desired state of PendingNode
|
// PendingNodeSpec defines the desired state of PendingNode
|
||||||
type PendingNodeSpec struct {
|
type PendingNodeSpec struct {
|
||||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
// ProviderID is the provider ID of the node.
|
||||||
// Important: Run "make" to regenerate code after modifying this file
|
ProviderID string `json:"providerID,omitempty"`
|
||||||
|
// ScalingGroupID is the ID of the group that this node shall be part of.
|
||||||
// Foo is an example field of PendingNode. Edit pendingnode_types.go to remove/update
|
ScalingGroupID string `json:"groupID,omitempty"`
|
||||||
Foo string `json:"foo,omitempty"`
|
// NodeName is the kubernetes internal name of the node.
|
||||||
|
NodeName string `json:"nodeName,omitempty"`
|
||||||
|
// Goal is the goal of the pending state.
|
||||||
|
Goal PendingNodeGoal `json:"goal,omitempty"`
|
||||||
|
// Deadline is the deadline for reaching the goal state.
|
||||||
|
// Joining nodes will be terminated if the deadline is exceeded.
|
||||||
|
// Leaving nodes will remain as unschedulable to prevent data loss.
|
||||||
|
// If not specified, the node may remain in the pending state indefinitely.
|
||||||
|
// +optional
|
||||||
|
Deadline *metav1.Time `json:"deadline,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PendingNodeStatus defines the observed state of PendingNode
|
// PendingNodeStatus defines the observed state of PendingNode
|
||||||
type PendingNodeStatus struct {
|
type PendingNodeStatus struct {
|
||||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
// CSPNodeState is the state of the node in the cloud.
|
||||||
// Important: Run "make" to regenerate code after modifying this file
|
CSPNodeState `json:"cspState,omitempty"`
|
||||||
|
// ReachedGoal is true if the node has reached the goal state.
|
||||||
|
ReachedGoal bool `json:"reachedGoal,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
//+kubebuilder:object:root=true
|
//+kubebuilder:object:root=true
|
||||||
|
|
|
@ -242,7 +242,7 @@ func (in *PendingNode) DeepCopyInto(out *PendingNode) {
|
||||||
*out = *in
|
*out = *in
|
||||||
out.TypeMeta = in.TypeMeta
|
out.TypeMeta = in.TypeMeta
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
out.Spec = in.Spec
|
in.Spec.DeepCopyInto(&out.Spec)
|
||||||
out.Status = in.Status
|
out.Status = in.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,6 +299,10 @@ func (in *PendingNodeList) DeepCopyObject() runtime.Object {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *PendingNodeSpec) DeepCopyInto(out *PendingNodeSpec) {
|
func (in *PendingNodeSpec) DeepCopyInto(out *PendingNodeSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.Deadline != nil {
|
||||||
|
in, out := &in.Deadline, &out.Deadline
|
||||||
|
*out = (*in).DeepCopy()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingNodeSpec.
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingNodeSpec.
|
||||||
|
|
|
@ -35,13 +35,48 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
description: PendingNodeSpec defines the desired state of PendingNode
|
description: PendingNodeSpec defines the desired state of PendingNode
|
||||||
properties:
|
properties:
|
||||||
foo:
|
deadline:
|
||||||
description: Foo is an example field of PendingNode. Edit pendingnode_types.go
|
description: Deadline is the deadline for reaching the goal state.
|
||||||
to remove/update
|
Joining nodes will be terminated if the deadline is exceeded. Leaving
|
||||||
|
nodes will remain as unschedulable to prevent data loss. If not
|
||||||
|
specified, the node may remain in the pending state indefinitely.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
goal:
|
||||||
|
description: Goal is the goal of the pending state.
|
||||||
|
enum:
|
||||||
|
- Join
|
||||||
|
- Leave
|
||||||
|
type: string
|
||||||
|
groupID:
|
||||||
|
description: ScalingGroupID is the ID of the group that this node
|
||||||
|
shall be part of.
|
||||||
|
type: string
|
||||||
|
nodeName:
|
||||||
|
description: NodeName is the kubernetes internal name of the node.
|
||||||
|
type: string
|
||||||
|
providerID:
|
||||||
|
description: ProviderID is the provider ID of the node.
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
status:
|
status:
|
||||||
description: PendingNodeStatus defines the observed state of PendingNode
|
description: PendingNodeStatus defines the observed state of PendingNode
|
||||||
|
properties:
|
||||||
|
cspState:
|
||||||
|
description: CSPNodeState is the state of the node in the cloud.
|
||||||
|
enum:
|
||||||
|
- Unknown
|
||||||
|
- Creating
|
||||||
|
- Ready
|
||||||
|
- Stopped
|
||||||
|
- Terminating
|
||||||
|
- Terminated
|
||||||
|
- Failed
|
||||||
|
type: string
|
||||||
|
reachedGoal:
|
||||||
|
description: ReachedGoal is true if the node has reached the goal
|
||||||
|
state.
|
||||||
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue