# 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).
require 'oci'
# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config
# Initialize service client with default config file
container_engine_client =
OCI::ContainerEngine::ContainerEngineClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_node_pool_response =
container_engine_client.create_node_pool(
OCI::ContainerEngine::Models::CreateNodePoolDetails.new(
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
cluster_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value',
name: 'EXAMPLE-name-Value',
node_shape: 'EXAMPLE-nodeShape-Value',
kubernetes_version: 'EXAMPLE-kubernetesVersion-Value',
node_metadata: {
'EXAMPLE_KEY_SpHjf' => 'EXAMPLE_VALUE_MeLAlWV3LqOJ0FcSE5hf'
},
node_image_name: 'EXAMPLE-nodeImageName-Value',
node_source_details:
OCI::ContainerEngine::Models::NodeSourceViaImageDetails.new(
source_type: 'IMAGE',
image_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value',
boot_volume_size_in_gbs: 968
),
node_shape_config:
OCI::ContainerEngine::Models::CreateNodeShapeConfigDetails.new(
ocpus: 312.24786, memory_in_gbs: 5594.3667
),
initial_node_labels: [
OCI::ContainerEngine::Models::KeyValue.new(
key: 'EXAMPLE-key-Value', value: 'EXAMPLE-value-Value'
)
],
ssh_public_key: 'EXAMPLE-sshPublicKey-Value',
quantity_per_subnet: 260,
subnet_ids: %w[EXAMPLE--Value],
node_config_details:
OCI::ContainerEngine::Models::CreateNodePoolNodeConfigDetails.new(
size: 363,
placement_configs: [
OCI::ContainerEngine::Models::NodePoolPlacementConfigDetails.new(
availability_domain: 'EXAMPLE-availabilityDomain-Value',
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
capacity_reservation_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value',
preemptible_node_config:
OCI::ContainerEngine::Models::PreemptibleNodeConfigDetails.new(
preemption_action:
OCI::ContainerEngine::Models::TerminatePreemptionAction.new(
type: 'TERMINATE', is_preserve_boot_volume: false
)
),
fault_domains: %w[EXAMPLE--Value]
)
],
nsg_ids: %w[EXAMPLE--Value],
kms_key_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value',
is_pv_encryption_in_transit_enabled: false,
freeform_tags: {
'EXAMPLE_KEY_pdwLD' => 'EXAMPLE_VALUE_tsnqvlPNd9DgAllkiPoD'
},
defined_tags: {
'EXAMPLE_KEY_jj8ZU' => { 'EXAMPLE_KEY_hS2vC' => 'EXAMPLE--Value' }
},
node_pool_pod_network_option_details:
OCI::ContainerEngine::Models::OciVcnIpNativeNodePoolPodNetworkOptionDetails
.new(
cni_type: 'OCI_VCN_IP_NATIVE',
pod_subnet_ids: %w[EXAMPLE--Value],
max_pods_per_node: 42,
pod_nsg_ids: %w[EXAMPLE--Value]
)
),
freeform_tags: {
'EXAMPLE_KEY_YjWm7' => 'EXAMPLE_VALUE_yVMgkeEqbs3IxXosaMAO'
},
defined_tags: {
'EXAMPLE_KEY_6bVvM' => { 'EXAMPLE_KEY_8x05Y' => 'EXAMPLE--Value' }
},
node_eviction_node_pool_settings:
OCI::ContainerEngine::Models::NodeEvictionNodePoolSettings.new(
eviction_grace_duration: 'EXAMPLE-evictionGraceDuration-Value',
is_force_delete_after_grace_duration: false
),
node_pool_cycling_details:
OCI::ContainerEngine::Models::NodePoolCyclingDetails.new(
maximum_unavailable: 'EXAMPLE-maximumUnavailable-Value',
maximum_surge: 'EXAMPLE-maximumSurge-Value',
is_node_cycling_enabled: false
)
)
)
# Get the data from response
puts "#{create_node_pool_response.headers}"