mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
Rename machineInit.infra to machineInit.bootstrap and its preKubeadmCommands to preBootstrapCommands on ClusterRelease and NodeProfile, and remove machineInit.userDataTemplate, which nothing in the management engine reads. The infra template variable PreKubeadmCommandsJSON becomes PreBootstrapCommandsJSON to match its source field. Templates still emit the NVKE controller API field preKubeadmCommands, so requests to the controller do not change. BREAKING CHANGE: ClusterRelease and NodeProfile accept machineInit.bootstrap with bootstrapFiles and preBootstrapCommands; machineInit.infra and machineInit.userDataTemplate are no longer part of the schema and are pruned. Infra templates must reference .PreBootstrapCommandsJSON; rendering uses missingkey=error, so a template still using .PreKubeadmCommandsJSON fails. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
129 lines
3.0 KiB
YAML
129 lines
3.0 KiB
YAML
apiVersion: service.nvke.nvidia.com/v1
|
|
kind: MachineImage
|
|
metadata:
|
|
name: test-image
|
|
spec:
|
|
operatingSystem:
|
|
family: ubuntu
|
|
version: "24.04"
|
|
architecture: amd64
|
|
buildDate: "2026-10-01"
|
|
nico:
|
|
ipxeScript: |
|
|
#!ipxe
|
|
chain https://images.example.com/nvke/boot.ipxe
|
|
---
|
|
apiVersion: service.nvke.nvidia.com/v1
|
|
kind: ClusterReleaseChannel
|
|
metadata:
|
|
name: stable
|
|
spec:
|
|
releases:
|
|
"1.36":
|
|
- name: test-release
|
|
minimumUpgradeAge: 0s
|
|
---
|
|
apiVersion: service.nvke.nvidia.com/v1
|
|
kind: ClusterRelease
|
|
metadata:
|
|
name: test-release
|
|
spec:
|
|
kubernetes:
|
|
version: "1.36.1"
|
|
machineImageRef:
|
|
name: test-image
|
|
machineInit:
|
|
bootstrap:
|
|
bootstrapFiles: []
|
|
preBootstrapCommands:
|
|
- "mkdir -p /run/cluster-api"
|
|
- "echo success > /run/cluster-api/bootstrap-success.complete"
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: infra-template
|
|
namespace: default
|
|
data:
|
|
clusterTmpl: |
|
|
{
|
|
"cluster": {
|
|
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha1",
|
|
"kind": "NicoCluster",
|
|
"metadata": {
|
|
"labels": {
|
|
"vpc-id": "{{ .VPCID }}"
|
|
}
|
|
},
|
|
"spec": {"siteID": "11111111-1111-4111-8111-111111111111"}
|
|
}
|
|
}
|
|
nodepoolTmpl: &machineTemplate |
|
|
{
|
|
"bootstrapFiles": {{ .BootstrapFilesJSON }},
|
|
"preKubeadmCommands": {{ .PreBootstrapCommandsJSON }},
|
|
"machineTemplate": {
|
|
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha1",
|
|
"kind": "NicoMachineTemplate",
|
|
"spec": {
|
|
"template": {
|
|
"metadata": {
|
|
"annotations": {
|
|
"cluster.x-k8s.io/paused": "true"
|
|
},
|
|
"labels": {
|
|
"vpc-id": "{{ .VPCID }}",
|
|
"instance-type": "{{ .InstanceType }}"
|
|
}
|
|
},
|
|
"spec": {
|
|
"vpcID": "{{ .VPCID }}",
|
|
"instanceTypeID": "{{ .InstanceType }}",
|
|
"interfaces": [{"subnetID": "44444444-4444-4444-8444-444444444444"}],
|
|
"ipxeScript": {{ .IPXEScript }}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
controlplaneTmpl: *machineTemplate
|
|
---
|
|
apiVersion: service.nvke.nvidia.com/v1
|
|
kind: ControlPlaneClass
|
|
metadata:
|
|
name: standard
|
|
spec:
|
|
controlPlane:
|
|
replicas: 1
|
|
instanceTypePreferences: [33333333-3333-4333-8333-333333333333]
|
|
systemReservedMemory: 1Gi
|
|
rollout:
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
---
|
|
apiVersion: service.nvke.nvidia.com/v1
|
|
kind: NVKECluster
|
|
metadata:
|
|
name: cluster-1
|
|
namespace: default
|
|
spec:
|
|
clusterNetwork:
|
|
pods:
|
|
cidrBlocks: [10.244.0.0/16]
|
|
services:
|
|
cidrBlocks: [10.96.0.0/12]
|
|
release:
|
|
channel:
|
|
name: stable
|
|
controlPlaneClass: standard
|
|
network:
|
|
vpcID: 22222222-2222-4222-8222-222222222222
|
|
nodePools:
|
|
- name: workers
|
|
instanceType: 33333333-3333-4333-8333-333333333333
|
|
replicas: 1
|
|
vpcSubnetID: 44444444-4444-4444-8444-444444444444
|
|
nodeProfile: "example:1.36.1"
|