Skip to content

Commit 0ee1e47

Browse files
committed
chore: sync config/*.go and values.schema.json to vCluster version v0.28.0-next.8
1 parent 02ad6cc commit 0ee1e47

File tree

3 files changed

+408
-17
lines changed

3 files changed

+408
-17
lines changed

config/config.go

Lines changed: 162 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,163 @@ type PrivateNodes struct {
113113

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

118275
type Deploy struct {
@@ -204,10 +361,13 @@ type StandaloneJoinNode struct {
204361
}
205362

206363
type JoinConfiguration struct {
207-
// PreJoinCommands are commands that will be executed before the join process starts.
364+
// PreInstallCommands are commands that will be executed before containerd, kubelet etc. is installed.
365+
PreInstallCommands []string `json:"preInstallCommands,omitempty"`
366+
367+
// PreJoinCommands are commands that will be executed before kubeadm join is executed.
208368
PreJoinCommands []string `json:"preJoinCommands,omitempty"`
209369

210-
// PostJoinCommands are commands that will be executed after the join process starts.
370+
// PostJoinCommands are commands that will be executed after kubeadm join is executed.
211371
PostJoinCommands []string `json:"postJoinCommands,omitempty"`
212372

213373
// Containerd holds configuration for the containerd join process.
@@ -233,9 +393,6 @@ type ContainerdJoin struct {
233393
// Registry holds configuration for how containerd should be configured to use a registries.
234394
Registry ContainerdRegistry `json:"registry,omitempty"`
235395

236-
// ImportImages is a list of images to import into the containerd registry from local files. If the path is a folder, all files that end with .tar or .tar.gz in the folder will be imported.
237-
ImportImages []string `json:"importImages,omitempty"`
238-
239396
// PauseImage is the image for the pause container.
240397
PauseImage string `json:"pauseImage,omitempty"`
241398
}

config/values.yaml

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

0 commit comments

Comments
 (0)