Skip to content

Commit 9f5165d

Browse files
committed
chore: sync config/*.go and values.schema.json to vCluster version v0.28.0-next.12
1 parent ae8e084 commit 9f5165d

File tree

3 files changed

+418
-1
lines changed

3 files changed

+418
-1
lines changed

config/config.go

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,163 @@ type PrivateNodes struct {
109109

110110
// JoinNode holds configuration specifically used during joining the node (see "kubeadm join").
111111
JoinNode JoinConfiguration `json:"joinNode,omitempty"`
112+
113+
// NodePools stores karpenter node pool configuration
114+
NodePools PrivateNodesNodePools `json:"nodePools,omitempty"`
115+
116+
// Tunnel holds configuration for the private nodes tunnel. This can be used to connect the private nodes to the control plane or
117+
// connect the private nodes to each other if they are not running in the same network. Platform connection is required for the tunnel to work.
118+
Tunnel PrivateNodesTunnel `json:"tunnel,omitempty"`
119+
}
120+
121+
type PrivateNodesTunnel struct {
122+
// Enabled defines if the private nodes tunnel should be enabled.
123+
Enabled bool `json:"enabled,omitempty"`
124+
125+
// NodeToNode holds configuration for the node to node tunnel. This can be used to connect the private nodes to each other if they are not running in the same network.
126+
NodeToNode PrivateNodesTunnelNodeToNode `json:"nodeToNode,omitempty"`
127+
}
128+
129+
type PrivateNodesTunnelNodeToNode struct {
130+
// Enabled defines if the node to node tunnel should be enabled.
131+
Enabled bool `json:"enabled,omitempty"`
132+
}
133+
134+
// PrivateNodesNodePools defines node pools
135+
type PrivateNodesNodePools struct {
136+
// Static defines static node pools. Static node pools have a fixed size and are not scaled automatically.
137+
Static []StaticNodePool `json:"static,omitempty"`
138+
139+
// Dynamic defines dynamic node pools. Dynamic node pools are scaled automatically based on the requirements within the cluster.
140+
// Karpenter is used under the hood to handle the scheduling of the nodes.
141+
Dynamic []DynamicNodePool `json:"dynamic,omitempty"`
142+
}
143+
144+
type DynamicNodePool struct {
145+
// Name is the name of this NodePool
146+
Name string `json:"name" jsonschema:"required"`
147+
148+
// Requirements filter the types of nodes that can be provisioned by this pool.
149+
// All requirements must be met for a node type to be eligible.
150+
Requirements []Requirement `json:"requirements,omitempty"`
151+
152+
// Taints are the taints to apply to the nodes in this pool.
153+
Taints []KubeletJoinTaint `json:"taints,omitempty"`
154+
155+
// NodeLabels are the labels to apply to the nodes in this pool.
156+
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
157+
158+
// Limits specify the maximum resources that can be provisioned by this node pool,
159+
// mapping to the 'limits' field in Karpenter's NodePool API.
160+
Limits map[string]string `json:"limits,omitempty"`
161+
162+
// Disruption contains the parameters that relate to Karpenter's disruption logic
163+
Disruption DynamicNodePoolDisruption `json:"disruption,omitempty"`
164+
165+
// TerminationGracePeriod is the maximum duration the controller will wait before forcefully deleting the pods on a node, measured from when deletion is first initiated.
166+
//
167+
// Warning: this feature takes precedence over a Pod's terminationGracePeriodSeconds value, and bypasses any blocked PDBs or the karpenter.sh/do-not-disrupt annotation.
168+
//
169+
// This field is intended to be used by cluster administrators to enforce that nodes can be cycled within a given time period.
170+
// When set, drifted nodes will begin draining even if there are pods blocking eviction. Draining will respect PDBs and the do-not-disrupt annotation until the TGP is reached.
171+
//
172+
// Karpenter will preemptively delete pods so their terminationGracePeriodSeconds align with the node's terminationGracePeriod.
173+
// If a pod would be terminated without being granted its full terminationGracePeriodSeconds prior to the node timeout,
174+
// that pod will be deleted at T = node timeout - pod terminationGracePeriodSeconds.
175+
//
176+
// The feature can also be used to allow maximum time limits for long-running jobs which can delay node termination with preStop hooks.
177+
// Defaults to 30s. Set to Never to wait indefinitely for pods to be drained.
178+
TerminationGracePeriod string `json:"terminationGracePeriod,omitempty"`
179+
180+
// The amount of time a Node can live on the cluster before being removed
181+
ExpireAfter string `json:"expireAfter,omitempty"`
182+
183+
// Weight is the weight of this node pool.
184+
Weight int `json:"weight,omitempty"`
185+
}
186+
187+
type DynamicNodePoolDisruption struct {
188+
// ConsolidateAfter is the duration the controller will wait
189+
// before attempting to terminate nodes that are underutilized.
190+
// Refer to ConsolidationPolicy for how underutilization is considered.
191+
ConsolidateAfter string `json:"consolidateAfter,omitempty"`
192+
193+
// ConsolidationPolicy describes which nodes Karpenter can disrupt through its consolidation
194+
// algorithm. This policy defaults to "WhenEmptyOrUnderutilized" if not specified
195+
ConsolidationPolicy string `json:"consolidationPolicy,omitempty"`
196+
197+
// Budgets is a list of Budgets.
198+
// If there are multiple active budgets, Karpenter uses
199+
// the most restrictive value. If left undefined,
200+
// this will default to one budget with a value to 10%.
201+
Budgets []DynamicNodePoolDisruptionBudget `json:"budgets,omitempty"`
202+
}
203+
type DynamicNodePoolDisruptionBudget struct {
204+
// Nodes dictates the maximum number of NodeClaims owned by this NodePool
205+
// that can be terminating at once. This is calculated by counting nodes that
206+
// have a deletion timestamp set, or are actively being deleted by Karpenter.
207+
// This field is required when specifying a budget.
208+
Nodes string `json:"nodes,omitempty"`
209+
210+
// Schedule specifies when a budget begins being active, following
211+
// the upstream cronjob syntax. If omitted, the budget is always active.
212+
// Timezones are not supported.
213+
Schedule string `json:"schedule,omitempty"`
214+
215+
// Duration determines how long a Budget is active since each Schedule hit.
216+
// Only minutes and hours are accepted, as cron does not work in seconds.
217+
// If omitted, the budget is always active.
218+
// This is required if Schedule is set.
219+
Duration string `json:"duration,omitempty"`
220+
}
221+
222+
type StaticNodePool struct {
223+
// Name is the name of this static nodePool
224+
Name string `json:"name" jsonschema:"required"`
225+
226+
// Requirements filter the types of nodes that can be provisioned by this pool.
227+
// All requirements must be met for a node type to be eligible.
228+
Requirements []Requirement `json:"requirements,omitempty"`
229+
230+
// Taints are the taints to apply to the nodes in this pool.
231+
Taints []KubeletJoinTaint `json:"taints,omitempty"`
232+
233+
// NodeLabels are the labels to apply to the nodes in this pool.
234+
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
235+
236+
// TerminationGracePeriod is the maximum duration the controller will wait before forcefully deleting the pods on a node, measured from when deletion is first initiated.
237+
//
238+
// Warning: this feature takes precedence over a Pod's terminationGracePeriodSeconds value, and bypasses any blocked PDBs or the karpenter.sh/do-not-disrupt annotation.
239+
//
240+
// This field is intended to be used by cluster administrators to enforce that nodes can be cycled within a given time period.
241+
// When set, drifted nodes will begin draining even if there are pods blocking eviction. Draining will respect PDBs and the do-not-disrupt annotation until the TGP is reached.
242+
//
243+
// Karpenter will preemptively delete pods so their terminationGracePeriodSeconds align with the node's terminationGracePeriod.
244+
// If a pod would be terminated without being granted its full terminationGracePeriodSeconds prior to the node timeout,
245+
// that pod will be deleted at T = node timeout - pod terminationGracePeriodSeconds.
246+
//
247+
// The feature can also be used to allow maximum time limits for long-running jobs which can delay node termination with preStop hooks.
248+
// Defaults to 30s. Set to Never to wait indefinitely for pods to be drained.
249+
TerminationGracePeriod string `json:"terminationGracePeriod,omitempty"`
250+
251+
// Quantity is the number of desired nodes in this pool.
252+
Quantity int `json:"quantity" jsonschema:"required"`
253+
}
254+
255+
// KarpenterRequirement defines a scheduling requirement for a dynamic node pool.
256+
// It corresponds to an entry in the 'requirements' list of a Karpenter NodePool.
257+
type Requirement struct {
258+
// Property is the property on the node type to select.
259+
Property string `json:"property" jsonschema:"required"`
260+
261+
// Operator is the comparison operator, such as "In", "NotIn", "Exists". If empty, defaults to "In".
262+
Operator string `json:"operator,omitempty"`
263+
264+
// Values is the list of values to use for comparison. This is mutually exclusive with value.
265+
Values []string `json:"values,omitempty"`
266+
267+
// Value is the value to use for comparison. This is mutually exclusive with values.
268+
Value string `json:"value,omitempty"`
112269
}
113270

114271
type Deploy struct {
@@ -183,10 +340,22 @@ type Standalone struct {
183340
// Bundle is a path to a Kubernetes bundle to use for the standalone mode. If empty, will use the bundleRepository to download the bundle.
184341
Bundle string `json:"bundle,omitempty"`
185342

343+
// Nodes is a list of nodes to deploy for standalone mode.
344+
Nodes StandaloneNodes `json:"nodes,omitempty"`
345+
186346
// JoinNode holds configuration for the standalone control plane node.
187347
JoinNode StandaloneJoinNode `json:"joinNode,omitempty"`
188348
}
189349

350+
type StandaloneNodes struct {
351+
// Quantity is the number of nodes to deploy for standalone mode.
352+
Quantity int `json:"quantity,omitempty"`
353+
354+
// Requirements filter the types of nodes that can be provisioned by this pool.
355+
// All requirements must be met for a node type to be eligible.
356+
Requirements []Requirement `json:"requirements,omitempty"`
357+
}
358+
190359
type StandaloneSyncConfig struct {
191360
// Enabled defines if config syncing should be enabled.
192361
Enabled bool `json:"enabled,omitempty"`

config/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,13 @@ privateNodes:
440440
joinNode:
441441
containerd:
442442
enabled: true
443-
443+
nodePools:
444+
static: []
445+
dynamic: []
446+
tunnel:
447+
enabled: false
448+
nodeToNode:
449+
enabled: false
444450
deploy:
445451
localPathProvisioner:
446452
enabled: true

0 commit comments

Comments
 (0)