Skip to content

Commit 03b6b76

Browse files
committed
chore: sync config/*.go and values.schema.json to vCluster version v0.28.0-next.4
1 parent 5b43254 commit 03b6b76

File tree

3 files changed

+303
-11
lines changed

3 files changed

+303
-11
lines changed

config/config.go

Lines changed: 115 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,121 @@ 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"`
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+
// Limits specify the maximum resources that can be provisioned by this node pool,
160+
// mapping to the 'limits' field in Karpenter's NodePool API.
161+
Limits map[string]string `json:"limits,omitempty"`
162+
163+
// Disruption contains the parameters that relate to Karpenter's disruption logic
164+
Disruption DynamicNodePoolDisruption `json:"disruption,omitempty"`
165+
166+
// The amount of time a Node can live on the cluster before being removed
167+
ExpireAfter string `json:"expireAfter,omitempty"`
168+
}
169+
170+
type DynamicNodePoolDisruption struct {
171+
// ConsolidateAfter is the duration the controller will wait
172+
// before attempting to terminate nodes that are underutilized.
173+
// Refer to ConsolidationPolicy for how underutilization is considered.
174+
ConsolidateAfter string `json:"consolidateAfter,omitempty"`
175+
176+
// ConsolidationPolicy describes which nodes Karpenter can disrupt through its consolidation
177+
// algorithm. This policy defaults to "WhenEmptyOrUnderutilized" if not specified
178+
ConsolidationPolicy string `json:"consolidationPolicy,omitempty"`
179+
180+
// Budgets is a list of Budgets.
181+
// If there are multiple active budgets, Karpenter uses
182+
// the most restrictive value. If left undefined,
183+
// this will default to one budget with a value to 10%.
184+
Budgets []DynamicNodePoolDisruptionBudget `json:"budgets,omitempty"`
185+
}
186+
type DynamicNodePoolDisruptionBudget struct {
187+
// Nodes dictates the maximum number of NodeClaims owned by this NodePool
188+
// that can be terminating at once. This is calculated by counting nodes that
189+
// have a deletion timestamp set, or are actively being deleted by Karpenter.
190+
// This field is required when specifying a budget.
191+
Nodes string `json:"nodes,omitempty"`
192+
193+
// Schedule specifies when a budget begins being active, following
194+
// the upstream cronjob syntax. If omitted, the budget is always active.
195+
// Timezones are not supported.
196+
Schedule string `json:"schedule,omitempty"`
197+
198+
// Duration determines how long a Budget is active since each Schedule hit.
199+
// Only minutes and hours are accepted, as cron does not work in seconds.
200+
// If omitted, the budget is always active.
201+
// This is required if Schedule is set.
202+
Duration string `json:"duration,omitempty"`
203+
}
204+
205+
type StaticNodePool struct {
206+
// Name is the name of this static nodePool
207+
Name string `json:"name"`
208+
209+
// Requirements filter the types of nodes that can be provisioned by this pool.
210+
// All requirements must be met for a node type to be eligible.
211+
Requirements []Requirement `json:"requirements,omitempty"`
212+
213+
// Taints are the taints to apply to the nodes in this pool.
214+
Taints []KubeletJoinTaint `json:"taints,omitempty"`
215+
216+
// Quantity is the number of desired nodes in this pool.
217+
Quantity int `json:"quantity,omitempty"`
218+
}
219+
220+
// KarpenterRequirement defines a scheduling requirement for a dynamic node pool.
221+
// It corresponds to an entry in the 'requirements' list of a Karpenter NodePool.
222+
type Requirement struct {
223+
// Key is the label key or field name to filter on.
224+
Key string `json:"key,omitempty"`
225+
226+
// Operator is the comparison operator, such as "In", "NotIn", "Exists".
227+
Operator string `json:"operator,omitempty"`
228+
229+
// Values is the list of values to use for the comparison.
230+
Values []string `json:"values,omitempty"`
116231
}
117232

118233
type Deploy struct {
@@ -233,9 +348,6 @@ type ContainerdJoin struct {
233348
// Registry holds configuration for how containerd should be configured to use a registries.
234349
Registry ContainerdRegistry `json:"registry,omitempty"`
235350

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-
239351
// PauseImage is the image for the pause container.
240352
PauseImage string `json:"pauseImage,omitempty"`
241353
}

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

values.schema.json

Lines changed: 181 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,6 @@
248248
"$ref": "#/$defs/ContainerdRegistry",
249249
"description": "Registry holds configuration for how containerd should be configured to use a registries."
250250
},
251-
"importImages": {
252-
"items": {
253-
"type": "string"
254-
},
255-
"type": "array",
256-
"description": "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."
257-
},
258251
"pauseImage": {
259252
"type": "string",
260253
"description": "PauseImage is the image for the pause container."
@@ -1236,6 +1229,84 @@
12361229
"additionalProperties": false,
12371230
"type": "object"
12381231
},
1232+
"DynamicNodePool": {
1233+
"properties": {
1234+
"name": {
1235+
"type": "string",
1236+
"description": "Name is the name of this NodePool"
1237+
},
1238+
"requirements": {
1239+
"items": {
1240+
"$ref": "#/$defs/Requirement"
1241+
},
1242+
"type": "array",
1243+
"description": "Requirements filter the types of nodes that can be provisioned by this pool.\nAll requirements must be met for a node type to be eligible."
1244+
},
1245+
"taints": {
1246+
"items": {
1247+
"$ref": "#/$defs/KubeletJoinTaint"
1248+
},
1249+
"type": "array",
1250+
"description": "Taints are the taints to apply to the nodes in this pool."
1251+
},
1252+
"limits": {
1253+
"additionalProperties": {
1254+
"type": "string"
1255+
},
1256+
"type": "object",
1257+
"description": "Limits specify the maximum resources that can be provisioned by this node pool,\nmapping to the 'limits' field in Karpenter's NodePool API."
1258+
},
1259+
"disruption": {
1260+
"$ref": "#/$defs/DynamicNodePoolDisruption",
1261+
"description": "Disruption contains the parameters that relate to Karpenter's disruption logic"
1262+
},
1263+
"expireAfter": {
1264+
"type": "string",
1265+
"description": "The amount of time a Node can live on the cluster before being removed"
1266+
}
1267+
},
1268+
"additionalProperties": false,
1269+
"type": "object"
1270+
},
1271+
"DynamicNodePoolDisruption": {
1272+
"properties": {
1273+
"consolidateAfter": {
1274+
"type": "string",
1275+
"description": "ConsolidateAfter is the duration the controller will wait\nbefore attempting to terminate nodes that are underutilized.\nRefer to ConsolidationPolicy for how underutilization is considered."
1276+
},
1277+
"consolidationPolicy": {
1278+
"type": "string",
1279+
"description": "ConsolidationPolicy describes which nodes Karpenter can disrupt through its consolidation\nalgorithm. This policy defaults to \"WhenEmptyOrUnderutilized\" if not specified"
1280+
},
1281+
"budgets": {
1282+
"items": {
1283+
"$ref": "#/$defs/DynamicNodePoolDisruptionBudget"
1284+
},
1285+
"type": "array",
1286+
"description": "Budgets is a list of Budgets.\nIf there are multiple active budgets, Karpenter uses\nthe most restrictive value. If left undefined,\nthis will default to one budget with a value to 10%."
1287+
}
1288+
},
1289+
"additionalProperties": false,
1290+
"type": "object"
1291+
},
1292+
"DynamicNodePoolDisruptionBudget": {
1293+
"properties": {
1294+
"nodes": {
1295+
"type": "string",
1296+
"description": "Nodes dictates the maximum number of NodeClaims owned by this NodePool\nthat can be terminating at once. This is calculated by counting nodes that\nhave a deletion timestamp set, or are actively being deleted by Karpenter.\nThis field is required when specifying a budget."
1297+
},
1298+
"schedule": {
1299+
"type": "string",
1300+
"description": "Schedule specifies when a budget begins being active, following\nthe upstream cronjob syntax. If omitted, the budget is always active.\nTimezones are not supported."
1301+
},
1302+
"duration": {
1303+
"type": "string",
1304+
"description": "Duration determines how long a Budget is active since each Schedule hit.\nOnly minutes and hours are accepted, as cron does not work in seconds.\nIf omitted, the budget is always active.\nThis is required if Schedule is set."
1305+
}
1306+
},
1307+
"additionalProperties": false,
1308+
"type": "object"
1309+
},
12391310
"EnableAutoSwitchWithPatches": {
12401311
"properties": {
12411312
"enabled": {
@@ -3513,12 +3584,65 @@
35133584
"joinNode": {
35143585
"$ref": "#/$defs/JoinConfiguration",
35153586
"description": "JoinNode holds configuration specifically used during joining the node (see \"kubeadm join\")."
3587+
},
3588+
"nodePools": {
3589+
"$ref": "#/$defs/PrivateNodesNodePools",
3590+
"description": "NodePools stores karpenter node pool configuration"
3591+
},
3592+
"tunnel": {
3593+
"$ref": "#/$defs/PrivateNodesTunnel",
3594+
"description": "Tunnel holds configuration for the private nodes tunnel. This can be used to connect the private nodes to the control plane or\nconnect the private nodes to each other if they are not running in the same network. Platform connection is required for the tunnel to work."
35163595
}
35173596
},
35183597
"additionalProperties": false,
35193598
"type": "object",
35203599
"description": "PrivateNodes enables private nodes for vCluster."
35213600
},
3601+
"PrivateNodesNodePools": {
3602+
"properties": {
3603+
"static": {
3604+
"items": {
3605+
"$ref": "#/$defs/StaticNodePool"
3606+
},
3607+
"type": "array",
3608+
"description": "Static defines static node pools. Static node pools have a fixed size and are not scaled automatically."
3609+
},
3610+
"dynamic": {
3611+
"items": {
3612+
"$ref": "#/$defs/DynamicNodePool"
3613+
},
3614+
"type": "array",
3615+
"description": "Dynamic defines dynamic node pools. Dynamic node pools are scaled automatically based on the requirements within the cluster.\nKarpenter is used under the hood to handle the scheduling of the nodes."
3616+
}
3617+
},
3618+
"additionalProperties": false,
3619+
"type": "object",
3620+
"description": "PrivateNodesNodePools defines node pools"
3621+
},
3622+
"PrivateNodesTunnel": {
3623+
"properties": {
3624+
"enabled": {
3625+
"type": "boolean",
3626+
"description": "Enabled defines if the private nodes tunnel should be enabled."
3627+
},
3628+
"nodeToNode": {
3629+
"$ref": "#/$defs/PrivateNodesTunnelNodeToNode",
3630+
"description": "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."
3631+
}
3632+
},
3633+
"additionalProperties": false,
3634+
"type": "object"
3635+
},
3636+
"PrivateNodesTunnelNodeToNode": {
3637+
"properties": {
3638+
"enabled": {
3639+
"type": "boolean",
3640+
"description": "Enabled defines if the node to node tunnel should be enabled."
3641+
}
3642+
},
3643+
"additionalProperties": false,
3644+
"type": "object"
3645+
},
35223646
"RBAC": {
35233647
"properties": {
35243648
"role": {
@@ -3689,6 +3813,28 @@
36893813
"additionalProperties": false,
36903814
"type": "object"
36913815
},
3816+
"Requirement": {
3817+
"properties": {
3818+
"key": {
3819+
"type": "string",
3820+
"description": "Key is the label key or field name to filter on."
3821+
},
3822+
"operator": {
3823+
"type": "string",
3824+
"description": "Operator is the comparison operator, such as \"In\", \"NotIn\", \"Exists\"."
3825+
},
3826+
"values": {
3827+
"items": {
3828+
"type": "string"
3829+
},
3830+
"type": "array",
3831+
"description": "Values is the list of values to use for the comparison."
3832+
}
3833+
},
3834+
"additionalProperties": false,
3835+
"type": "object",
3836+
"description": "KarpenterRequirement defines a scheduling requirement for a dynamic node pool."
3837+
},
36923838
"ResolveDNS": {
36933839
"properties": {
36943840
"hostname": {
@@ -4061,6 +4207,34 @@
40614207
"type": "object",
40624208
"description": "StartupProbe defines the configuration for the startup probe."
40634209
},
4210+
"StaticNodePool": {
4211+
"properties": {
4212+
"name": {
4213+
"type": "string",
4214+
"description": "Name is the name of this static nodePool"
4215+
},
4216+
"requirements": {
4217+
"items": {
4218+
"$ref": "#/$defs/Requirement"
4219+
},
4220+
"type": "array",
4221+
"description": "Requirements filter the types of nodes that can be provisioned by this pool.\nAll requirements must be met for a node type to be eligible."
4222+
},
4223+
"taints": {
4224+
"items": {
4225+
"$ref": "#/$defs/KubeletJoinTaint"
4226+
},
4227+
"type": "array",
4228+
"description": "Taints are the taints to apply to the nodes in this pool."
4229+
},
4230+
"quantity": {
4231+
"type": "integer",
4232+
"description": "Quantity is the number of desired nodes in this pool."
4233+
}
4234+
},
4235+
"additionalProperties": false,
4236+
"type": "object"
4237+
},
40644238
"Sync": {
40654239
"properties": {
40664240
"toHost": {

0 commit comments

Comments
 (0)