Drain a node: HTTP API
Before you start
Section titled “Before you start”This example has two reachable workers in one pool and one running production. The setup is the same as Launch a show format; here the walkthrough begins at the fleet operation.
curl --silent --show-error --fail-with-body --request GET --header 'Accept: application/json' --header 'X-Norsk-Proxy: $(cat ~/.norsk-mgr/proxy-secret)' http://127.0.0.1:9333/api/v1/runtimes/drainable-show-01.0.main{ "job": { "runtimeRecordId": "drainable-show-01.0.main", "state": "active", "currentHash": "98453889", "tags": { "auto-manager": "true", "productionId": "drainable-show-01", "runtimeId": "main", "launchCredentialSha256": "b670d981bf3ba6f1217e5f50dfda5ab57e0f4f3f81c0cba83b95d4549bdb5f8b", "productTemplateRevisionId": "b65b9284-2333-4e41-8807-4befa967c09b", "replicaIndex": "0" }, "startDateTime": "2026-11-21T11:15:25.655Z", "cloud": "aws", "description": "", "writeFiles": [], "services": [], "volumes": [], "managerConfiguration": "", "norskMediaVersion": "recommended", "norskServiceParameters": { "portMappings": [], "environmentVariables": [], "cpuSet": [], "volumeMounts": [], "bindMounts": [], "ulimits": [] }, "shape": "", "availabilityDomain": "", "subnet": "", "architecture": "", "norskCpuList": [], "autoPlacement": { "$typeName": "norsk.api.manager.AutoPlacement", "requirements": { "$typeName": "norsk.api.manager.JobRequirements", "requiredCapacity": 1, "requiredCapabilities": [], "onRuntimeFailure": 1, "requiredHostPorts": [] } }, "productTemplate": { "productName": "e2e-fixture", "productVersion": "0.0.1", "sha256": "97fa3005e12843c95595a03745c5c2d7ed4be46c32db28ed0f946372ba16f6a0", "templateName": "drainable-studio", "source": { "kind": "url", "url": "http://127.0.0.1:9333/api/v1/product-templates/by-sha/97fa3005e12843c95595a03745c5c2d7ed4be46c32db28ed0f946372ba16f6a0/tar?token=…" } }, "productTemplateParameters": { "INSTANCE_NAME": "drainable-show-01" } }, "history": [ { "event": "running", "timestamp": "2026-11-21T11:15:29.640Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "provisioned", "timestamp": "2026-11-21T11:15:25.792Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "created", "timestamp": "2026-11-21T11:15:25.747Z" } ], "dropped": false, "dormant": false, "nodeId": "cluster-TFUlo0gxGzs1CKME", "nodeAddress": "127.0.0.1", "migration": { "declaredStrategy": "stopThenStart" }}Cordon the node
Section titled “Cordon the node”Cordoning removes a node from new placement. It does not move or stop anything already assigned to the node.
curl --silent --show-error --fail-with-body --request POST --header 'Accept: application/json' --header 'X-Norsk-Proxy: $(cat ~/.norsk-mgr/proxy-secret)' http://127.0.0.1:9333/api/v1/nodes/cluster-TFUlo0gxGzs1CKME/cordon{ "nodeId": "cluster-TFUlo0gxGzs1CKME", "action": "cordoned"}curl --silent --show-error --fail-with-body --request GET --header 'Accept: application/json' --header 'X-Norsk-Proxy: $(cat ~/.norsk-mgr/proxy-secret)' http://127.0.0.1:9333/api/v1/runtimes/drainable-show-01.0.main{ "job": { "runtimeRecordId": "drainable-show-01.0.main", "state": "active", "currentHash": "98453889", "tags": { "auto-manager": "true", "productionId": "drainable-show-01", "runtimeId": "main", "launchCredentialSha256": "b670d981bf3ba6f1217e5f50dfda5ab57e0f4f3f81c0cba83b95d4549bdb5f8b", "productTemplateRevisionId": "b65b9284-2333-4e41-8807-4befa967c09b", "replicaIndex": "0" }, "startDateTime": "2026-11-21T11:15:25.655Z", "cloud": "aws", "description": "", "writeFiles": [], "services": [], "volumes": [], "managerConfiguration": "", "norskMediaVersion": "recommended", "norskServiceParameters": { "portMappings": [], "environmentVariables": [], "cpuSet": [], "volumeMounts": [], "bindMounts": [], "ulimits": [] }, "shape": "", "availabilityDomain": "", "subnet": "", "architecture": "", "norskCpuList": [], "autoPlacement": { "$typeName": "norsk.api.manager.AutoPlacement", "requirements": { "$typeName": "norsk.api.manager.JobRequirements", "requiredCapacity": 1, "requiredCapabilities": [], "onRuntimeFailure": 1, "requiredHostPorts": [] } }, "productTemplate": { "productName": "e2e-fixture", "productVersion": "0.0.1", "sha256": "97fa3005e12843c95595a03745c5c2d7ed4be46c32db28ed0f946372ba16f6a0", "templateName": "drainable-studio", "source": { "kind": "url", "url": "http://127.0.0.1:9333/api/v1/product-templates/by-sha/97fa3005e12843c95595a03745c5c2d7ed4be46c32db28ed0f946372ba16f6a0/tar?token=…" } }, "productTemplateParameters": { "INSTANCE_NAME": "drainable-show-01" } }, "history": [ { "event": "running", "timestamp": "2026-11-21T11:15:29.640Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "provisioned", "timestamp": "2026-11-21T11:15:25.792Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "created", "timestamp": "2026-11-21T11:15:25.747Z" } ], "dropped": false, "dormant": false, "nodeId": "cluster-TFUlo0gxGzs1CKME", "nodeAddress": "127.0.0.1", "migration": { "declaredStrategy": "stopThenStart" }}Drain it
Section titled “Drain it”A drain keeps the node cordoned, starts a migration for every runtime on it, and terminates the node only after it is empty. With force: false, an unmovable runtime leaves the drain partial and the node intact.
curl --silent --show-error --fail-with-body --request POST --header 'Accept: application/json' --header 'X-Norsk-Proxy: $(cat ~/.norsk-mgr/proxy-secret)' --header 'Content-Type: application/json' --data '{"force":false}' http://127.0.0.1:9333/api/v1/nodes/cluster-TFUlo0gxGzs1CKME/drain{ "nodeId": "cluster-TFUlo0gxGzs1CKME", "phase": "migrating", "startedAt": "2026-11-21T11:15:29.949Z", "timeoutMs": 600000, "force": false, "runtimes": [ { "runtimeRecordId": "drainable-show-01.0.main", "status": "migrating", "migrationId": "3eb5d94c-cc89-4a39-8fc8-e521847acbeb" } ]}curl --silent --show-error --fail-with-body --request GET --header 'Accept: application/json' --header 'X-Norsk-Proxy: $(cat ~/.norsk-mgr/proxy-secret)' http://127.0.0.1:9333/api/v1/nodes/cluster-TFUlo0gxGzs1CKME/drain{ "nodeId": "cluster-TFUlo0gxGzs1CKME", "phase": "done", "startedAt": "2026-11-21T11:15:29.949Z", "timeoutMs": 600000, "force": false, "runtimes": [ { "runtimeRecordId": "drainable-show-01.0.main", "status": "migrated", "migrationId": "3eb5d94c-cc89-4a39-8fc8-e521847acbeb" } ]}curl --silent --show-error --fail-with-body --request GET --header 'Accept: application/json' --header 'X-Norsk-Proxy: $(cat ~/.norsk-mgr/proxy-secret)' http://127.0.0.1:9333/api/v1/runtimes/drainable-show-01.0.main{ "job": { "runtimeRecordId": "drainable-show-01.0.main", "state": "active", "currentHash": "98453889", "tags": { "auto-manager": "true", "productionId": "drainable-show-01", "runtimeId": "main", "launchCredentialSha256": "b670d981bf3ba6f1217e5f50dfda5ab57e0f4f3f81c0cba83b95d4549bdb5f8b", "productTemplateRevisionId": "b65b9284-2333-4e41-8807-4befa967c09b", "replicaIndex": "0" }, "startDateTime": "2026-11-21T11:15:25.655Z", "cloud": "aws", "description": "", "writeFiles": [], "services": [], "volumes": [], "managerConfiguration": "", "norskMediaVersion": "recommended", "norskServiceParameters": { "portMappings": [], "environmentVariables": [], "cpuSet": [], "volumeMounts": [], "bindMounts": [], "ulimits": [] }, "shape": "", "availabilityDomain": "", "subnet": "", "architecture": "", "norskCpuList": [], "autoPlacement": { "$typeName": "norsk.api.manager.AutoPlacement", "requirements": { "$typeName": "norsk.api.manager.JobRequirements", "requiredCapacity": 1, "requiredCapabilities": [], "onRuntimeFailure": 1, "requiredHostPorts": [] } }, "productTemplate": { "productName": "e2e-fixture", "productVersion": "0.0.1", "sha256": "97fa3005e12843c95595a03745c5c2d7ed4be46c32db28ed0f946372ba16f6a0", "templateName": "drainable-studio", "source": { "kind": "url", "url": "http://127.0.0.1:9333/api/v1/product-templates/by-sha/97fa3005e12843c95595a03745c5c2d7ed4be46c32db28ed0f946372ba16f6a0/tar?token=…" } }, "productTemplateParameters": { "INSTANCE_NAME": "drainable-show-01" } }, "history": [ { "event": "running", "timestamp": "2026-11-21T11:15:44.150Z", "role": "primary@3eb5d94c", "nodeMetadata": { "nodeId": "cluster-v5tVQgRFsyDmqJh9", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:24.648Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-v5tVQgRFsyDmqJh9" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "stopped", "timestamp": "2026-11-21T11:15:44.013Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "hold": "cordoned", "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "stopping", "timestamp": "2026-11-21T11:15:33.689Z", "role": "primary", "reason": "migration", "additionalReason": "3eb5d94c-cc89-4a39-8fc8-e521847acbeb", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "hold": "cordoned", "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "prepared", "timestamp": "2026-11-21T11:15:33.686Z", "role": "primary@3eb5d94c", "nodeMetadata": { "nodeId": "cluster-v5tVQgRFsyDmqJh9", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:24.648Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-v5tVQgRFsyDmqJh9" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "provisioned", "timestamp": "2026-11-21T11:15:29.952Z", "role": "primary@3eb5d94c", "nodeMetadata": { "nodeId": "cluster-v5tVQgRFsyDmqJh9", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:24.648Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-v5tVQgRFsyDmqJh9" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "running", "timestamp": "2026-11-21T11:15:29.640Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "provisioned", "timestamp": "2026-11-21T11:15:25.792Z", "role": "primary", "nodeMetadata": { "nodeId": "cluster-TFUlo0gxGzs1CKME", "tags": { "pool": "local", "versionSkew": "none", "workerProtocolVersion": "2.3", "workerVersion": "0.1.0-2026-11-21-7114c45" }, "createdAt": "2026-11-21T11:15:20.959Z", "providerMetadata": { "provider": "cluster" } }, "runningNodeMetadata": { "publicDnsName": "", "privateDnsName": "127.0.0.1", "privateIpAddress": "127.0.0.1", "publicIpAddress": "127.0.0.1", "providerMetadata": { "provider": "cluster", "instanceId": "cluster-TFUlo0gxGzs1CKME" }, "proxyUrl": "https://127.0.0.1" } }, { "event": "created", "timestamp": "2026-11-21T11:15:25.747Z" } ], "dropped": false, "dormant": false, "nodeId": "cluster-v5tVQgRFsyDmqJh9", "nodeAddress": "127.0.0.1", "migration": { "declaredStrategy": "stopThenStart" }}Captured 2026-11-21 against norsk-mgr 0.1.0-2026-11-21-7114c45, Norsk Manager 1.4.2-2026-11-19-3758b1eb — every command and screenshot on this page is from that run.