Add a Node Pool

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: Adds a node pool.

Security: Requires admin credentials

Usage: POST api/v1/nodePools

Produces: application/json

Parameters:

Parameter

Data Type

Description

Required/Optional

projectId

Integer

Id of the Project.

Required

name

String

Name of the node pool.

Required

isOnDemand

Boolean

Set to true for dynamic node pool. Set to false for static node pool.

Required

architecture

String

Set the architecture. This is currently limited to x86_64.

Required

operatingSystem

String

Operating systems supported for the selected architecture.

For a list of supported OS and architecture combinations, refer to Runtime Images.

Required

nodeIdleIntervalInMins

Integer

Number of minutes a node can be idle before it is destroyed.

Required for dynamic node pools (if isOnDemand is set as true).

buildPlaneImageId

Integer

The build plane image Id. For more information, see Get Build Plane Image Ids.

Required for dynamic node pools.

projectIntegrationId

Integer

The project integration Id. For information about obtaining integration Id's, see Get All Integrations.

For more information, see Dynamic Node Integrations.

Required for dynamic node pools.

providerMetadataPropertyBag

Object

Object containing configuration for the cloud provider of on-demand nodePool.

You can set the following properties:

  • sshUser

  • sshPort

  • keyPairName

  • securityGroupId

  • subnetId

  • instanceSize

  • subnetName

  • networkTags

  • zone

  • assignPublicIp

  • publicSshKey

  • subscriptionId

  • resourceGroupName

  • securityGroupName

  • vnetName

  • adminUsername

  • adminPassword

  • cpu

  • memory

  • storageClass

  • labels

  • namespace

Required for dynamic node pools

project

String

An object containing a project name as an alternative to projectId.

You can set the following properties:

  • Name: Name of the Project.

  • Key: A unique Project Key to identify and group your Projects.

Optional

environments

String

An array of string environments to which the node pool is available in the project.

Optional

timeoutMS

Integer

The maximum time (in minutes) after which pipeline steps will timeout. This timeout is used when your step does not have any timeout specified.

Default value for timeout is 60 minutes.

Optional

maxDiskUsagePercentage

Integer

Limits the maximum disk usage. A build node that exceeds this maximum will be marked as failed.

Integer between 0 and 100

Optional

diskSizeinGB

Integer

Configure dynamic node disk size.

The minimum limit is:

  • AWS (Windows): 120 GB

  • Azure (Windows): 128 GB

  • Others: 60 GB

Note

  • This option is available for Pipelines on-premise versions only.

  • If the disk size is not specified, the node will use the image’s disk size by default.

Optional

isNatEnabled

Boolean

When set to true, enables NAT.

Optional

isCacheEnabled

Boolean

When set to true, enables node caching.Administering Dynamic Node Pools

Optional

cacheSettingsPropertyBag

Integer

Object containing cache settings if isCacheEnabled is set to true.

  • nodeStopSetting

  • nodeStopDayOfWeek: On the day of the week

  • nodeStopIntervalDays: By the number of days

Example

"cacheSettingsPropertyBag": {

"nodeStopSetting": "nodeStopIntervalDays",

"nodeStopDayOfWeek": "sunday";

"nodeStopIntervalDays": 1;

Optional

permissions

Object

Set permissions to restrict node pool use.

You can set the following properties:

  • allowAllPipelineSources: Add all the existing and future Pipeline Sources including to this permission target.

  • includePatterns: Specify an include pattern.

  • excludePatterns: Specify an exclude pattern.

Optional

allowAllPipelineSources

Boolean

When set as true, pipelines loaded from any pipeline source can use this node pool.

Set as false to restrict node pool use to a set of pipeline sources.Managing Pipelines Node Pools

Optional

initPropertyBag

Object

Contains configuration to be applied during node initialization.

The following property can be set:

insecureDockerRegistries: List of insecure docker registries to be allowed on the node.

Optional

Sample Request:

curl -L -X POST 'http://localhost:8082/pipelines/api/v1/nodepools' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-raw '{
    "providerMetadataPropertyBag": {
        "instanceSize": "n1-standard-1",
        "subnetName": "jfrog-usw1-dynamicnodes",
        "networkTags": [
            "behind-nat",
            "jenkins",
            "pipelines",
            "xray-app",
            "xray-apps"
        ],
        "zone": "us-west1-b"
    },
    "projectId": 1,
    "name": "NodePool2",
    "isOnDemand": true,
    "architecture": "x86_64",
    "operatingSystem": "Ubuntu_18.04",
    "projectIntegrationId": 11,
    "buildPlaneImageId": 17,
    "nodeIdleIntervalInMins": 20
}'

Sample Response:

{
    "providerMetadataPropertyBag": {
        "instanceSize": "n1-standard-1",
        "subnetName": "jfrog-usw1-dynamicnodes",
        "networkTags": [
            "behind-nat",
            "jenkins",
            "pipelines",
            "xray-app",
            "xray-apps"
        ],
        "zone": "us-west1-b"
    },
    "cacheSettingsPropertyBag": null,
    "initPropertyBag": null,
    "permissions": {
        "allowAllPipelineSources": true
    },
    "id": 10,
    "projectId": 1,
    "name": "NodePool2",
    "isOnDemand": true,
    "architecture": "x86_64",
    "operatingSystem": "Ubuntu_18.04",
    "buildPlaneImageId": 17,
    "nodeIdleIntervalInMins": 20,
    "projectIntegrationId": 11,
    "isCacheEnabled": false,
    "numberOfNodes": 1,
    "maxDiskUsagePercentage": 90,
    "updatedAt": "2021-04-30T12:26:37.540Z",
    "createdAt": "2021-04-30T12:26:37.540Z",
    "environments": null,
    "queueName": null,
    "timeoutMS": null,
    "isNatEnabled": null,
    "diskSizeinGB": null
}

Response Codes:

200: Success

400: If required fields are not included in the request body or if there are invalid parameters.