Adjusting the HAMi scheduling policy through config_patch
Adjusting the HAMi scheduling policy through config_patch
Section titled “Adjusting the HAMi scheduling policy through config_patch”When creating or updating a Kubernetes cluster, you can add HAMi configuration in spec.accelerator_virtualization.config_patch through YAML or API. Neutree supports configuring only devicePlugin, scheduler, and global in config_patch.
Configuration example
apiVersion: v1kind: Clustermetadata: name: <cluster-name> workspace: <workspace-name>spec: type: kubernetes version: "v1.1.0" image_registry: <image-registry> accelerator_virtualization: enabled: true config_patch: scheduler: defaultSchedulerPolicy: nodeSchedulerPolicy: binpack gpuSchedulerPolicy: topology-aware config: kubernetes_config: kubeconfig: <kubeconfig>Operation example
To update an existing cluster, refer to the following example.
-
First, export the existing cluster configuration by using the CLI, and then add
accelerator_virtualization.config_patchto the exported YAML:Terminal window neutree-cli-<arch> get Cluster <cluster-name> \-w <workspace-name> \-o yaml \--api-key <api_key> \--server-url <server_url> \> hami-scheduler-policy.yaml -
Edit
hami-scheduler-policy.yamland add or adjust the following fields:spec:accelerator_virtualization:enabled: trueconfig_patch:scheduler:defaultSchedulerPolicy:nodeSchedulerPolicy: binpackgpuSchedulerPolicy: topology-aware -
Save the file and run:
Terminal window neutree-cli-<arch> apply -f hami-scheduler-policy.yaml \--api-key <api_key> \--server-url <server_url> -
View the updated cluster configuration:
Terminal window neutree-cli-<arch> get Cluster <cluster-name> \-w <workspace-name> \-o yaml \--api-key <api_key> \--server-url <server_url>