// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
import * as containerengine from "oci-containerengine";
import common = require("oci-common");
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new containerengine.ContainerEngineClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createNodePoolDetails = {
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
clusterId: "ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value",
name: "EXAMPLE-name-Value",
kubernetesVersion: "EXAMPLE-kubernetesVersion-Value",
nodeMetadata: {
EXAMPLE_KEY_WRRMK :"EXAMPLE_VALUE_sdoIlJkG78vLNFsE0ejK"
},
nodeImageName: "EXAMPLE-nodeImageName-Value",
nodeSourceDetails: {
sourceType: "IMAGE", imageId: "ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value",
bootVolumeSizeInGBs: 272
}
,
nodeShape: "EXAMPLE-nodeShape-Value",
nodeShapeConfig: {
ocpus: 495.68533,
memoryInGBs: 949.0973,
}
,
initialNodeLabels: [{
key: "EXAMPLE-key-Value",
value: "EXAMPLE-value-Value",
}
],
sshPublicKey: "EXAMPLE-sshPublicKey-Value",
quantityPerSubnet: 307,
subnetIds: ["EXAMPLE--Value" ],
nodeConfigDetails: {
size: 403,
nsgIds: ["EXAMPLE--Value" ],
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
isPvEncryptionInTransitEnabled: false,
freeformTags: {
EXAMPLE_KEY_wPRZS :"EXAMPLE_VALUE_1iWMtgXjiPRd9947j3B2"
},
definedTags: {
EXAMPLE_KEY_xalnu :{
EXAMPLE_KEY_hn1E4 :"EXAMPLE--Value"
}
},
placementConfigs: [{
availabilityDomain: "EXAMPLE-availabilityDomain-Value",
subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
capacityReservationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
preemptibleNodeConfig: {
preemptionAction: {
type: "TERMINATE", isPreserveBootVolume: false
}
,
}
,
faultDomains: ["EXAMPLE--Value" ],
}
],
nodePoolPodNetworkOptionDetails: {
cniType: "FLANNEL_OVERLAY",
}
,
}
,
freeformTags: {
EXAMPLE_KEY_GO0jN :"EXAMPLE_VALUE_Z2HHUoJgmPPGaFdcrhcU"
},
definedTags: {
EXAMPLE_KEY_Sgnsb :{
EXAMPLE_KEY_w3ofy :"EXAMPLE--Value"
}
},
nodeEvictionNodePoolSettings: {
evictionGraceDuration: "EXAMPLE-evictionGraceDuration-Value",
isForceDeleteAfterGraceDuration: true,
isForceActionAfterGraceDuration: false,
}
,
nodePoolCyclingDetails: {
maximumUnavailable: "EXAMPLE-maximumUnavailable-Value",
maximumSurge: "EXAMPLE-maximumSurge-Value",
isNodeCyclingEnabled: true,
cycleModes: [containerengine.models.CycleMode.BootVolumeReplace,containerengine.models.CycleMode.InstanceReplace ],
}
,
secondaryVnics: [{
createVnicDetails: {
displayName: "EXAMPLE-displayName-Value",
assignIpv6Ip: true,
assignPublicIp: true,
definedTags: {
EXAMPLE_KEY_76Cu4 :{
EXAMPLE_KEY_yeNV0 :"EXAMPLE--Value"
}
},
freeformTags: {
EXAMPLE_KEY_E4KOr :"EXAMPLE_VALUE_jm2eGXdEpr3HBX3aRRQg"
},
ipCount: 7,
applicationResources: ["EXAMPLE--Value" ],
ipv6AddressIpv6SubnetCidrPairDetails: [{
ipv6Address: "EXAMPLE-ipv6Address-Value",
ipv6SubnetCidr: "EXAMPLE-ipv6SubnetCidr-Value",
}
],
nsgIds: ["EXAMPLE--Value" ],
skipSourceDestCheck: false,
subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
}
,
displayName: "EXAMPLE-displayName-Value",
nicIndex: 10,
}
],
networkLaunchType: containerengine.models.NetworkLaunchType.Vfio,
}
const createNodePoolRequest: containerengine.requests.CreateNodePoolRequest = {
createNodePoolDetails: createNodePoolDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "5MFFYW03EFA2LZKZAO6C<unique_ID>",
};
// Send request to the Client.
const createNodePoolResponse = await client.createNodePool(createNodePoolRequest);
}
catch (error) {
console.log("createNodePool Failed with error " + error);
}
})();