oracle.oci.oci_container_engine_node_pool_facts – Fetches details about one or multiple NodePool resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.14.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_container_engine_node_pool_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about one or multiple NodePool resources in Oracle Cloud Infrastructure

  • List all the node pools in a compartment, and optionally filter by cluster.

  • If node_pool_id is specified, the details of a single NodePool will be returned.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
cluster_id
string
The OCID of the cluster.
compartment_id
string
The OCID of the compartment.
Required to list multiple node_pools.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
lifecycle_state
list / elements=string
    Choices:
  • DELETED
  • CREATING
  • ACTIVE
  • UPDATING
  • DELETING
  • FAILED
  • INACTIVE
  • NEEDS_ATTENTION
A list of nodepool lifecycle states on which to filter on, matching any of the list items (OR logic). eg. [ACTIVE, DELETING]
name
string
The name to filter on.
node_pool_id
string
The OCID of the node pool.
Required to get a specific node_pool.

aliases: id
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
sort_by
string
    Choices:
  • ID
  • NAME
  • TIME_CREATED
The optional field to sort the results by.
sort_order
string
    Choices:
  • ASC
  • DESC
The optional order in which to sort the results.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

- name: Get a specific node_pool
  oci_container_engine_node_pool_facts:
    # required
    node_pool_id: "ocid1.nodepool.oc1..xxxxxxEXAMPLExxxxxx"

- name: List node_pools
  oci_container_engine_node_pool_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    cluster_id: "ocid1.cluster.oc1..xxxxxxEXAMPLExxxxxx"
    name: name_example
    sort_order: ASC
    sort_by: ID
    lifecycle_state: [ "DELETED" ]

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
node_pools
complex
on success
List of NodePool resources

Sample:
[{'cluster_id': 'ocid1.cluster.oc1..xxxxxxEXAMPLExxxxxx', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'initial_node_labels': [{'key': 'key_example', 'value': 'value_example'}], 'kubernetes_version': 'kubernetes_version_example', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'DELETED', 'name': 'name_example', 'node_config_details': {'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'freeform_tags': {'Department': 'Finance'}, 'is_pv_encryption_in_transit_enabled': True, 'kms_key_id': 'ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx', 'node_pool_pod_network_option_details': {'cni_type': 'OCI_VCN_IP_NATIVE', 'max_pods_per_node': 56, 'pod_nsg_ids': [], 'pod_subnet_ids': []}, 'nsg_ids': [], 'placement_configs': [{'availability_domain': 'Uocm:PHX-AD-1', 'capacity_reservation_id': 'ocid1.capacityreservation.oc1..xxxxxxEXAMPLExxxxxx', 'fault_domains': [], 'subnet_id': 'ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx'}], 'size': 56}, 'node_eviction_node_pool_settings': {'eviction_grace_duration': 'eviction_grace_duration_example', 'is_force_delete_after_grace_duration': True}, 'node_image_id': 'ocid1.nodeimage.oc1..xxxxxxEXAMPLExxxxxx', 'node_image_name': 'node_image_name_example', 'node_metadata': {}, 'node_shape': 'node_shape_example', 'node_shape_config': {'memory_in_gbs': 3.4, 'ocpus': 3.4}, 'node_source': {'image_id': 'ocid1.image.oc1..xxxxxxEXAMPLExxxxxx', 'source_name': 'source_name_example', 'source_type': 'IMAGE'}, 'node_source_details': {'boot_volume_size_in_gbs': 56, 'image_id': 'ocid1.image.oc1..xxxxxxEXAMPLExxxxxx', 'source_type': 'IMAGE'}, 'nodes': [{'availability_domain': 'Uocm:PHX-AD-1', 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'fault_domain': 'FAULT-DOMAIN-1', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'kubernetes_version': 'kubernetes_version_example', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'CREATING', 'name': 'name_example', 'node_error': {'code': 'code_example', 'message': 'message_example', 'opc_request_id': 'ocid1.opcrequest.oc1..xxxxxxEXAMPLExxxxxx', 'status': 'status_example'}, 'node_pool_id': 'ocid1.nodepool.oc1..xxxxxxEXAMPLExxxxxx', 'private_ip': 'private_ip_example', 'public_ip': 'public_ip_example', 'subnet_id': 'ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx', 'system_tags': {}}], 'quantity_per_subnet': 56, 'ssh_public_key': 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAz...', 'subnet_ids': [], 'system_tags': {}}]
 
cluster_id
string
on success
The OCID of the cluster to which this node pool is attached.

Sample:
ocid1.cluster.oc1..xxxxxxEXAMPLExxxxxx
 
compartment_id
string
on success
The OCID of the compartment in which the node pool exists.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"Operations": {"CostCenter": "42"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
 
freeform_tags
dictionary
on success
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: `{"Department": "Finance"}`

Sample:
{'Department': 'Finance'}
 
id
string
on success
The OCID of the node pool.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
initial_node_labels
complex
on success
A list of key/value pairs to add to nodes after they join the Kubernetes cluster.

   
key
string
on success
The key of the pair.

Sample:
key_example
   
value
string
on success
The value of the pair.

Sample:
value_example
 
kubernetes_version
string
on success
The version of Kubernetes running on the nodes in the node pool.

Sample:
kubernetes_version_example
 
lifecycle_details
string
on success
Details about the state of the nodepool.

Sample:
lifecycle_details_example
 
lifecycle_state
string
on success
The state of the nodepool.

Sample:
DELETED
 
name
string
on success
The name of the node pool.

Sample:
name_example
 
node_config_details
complex
on success
The configuration of nodes in the node pool.

   
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"Operations": {"CostCenter": "42"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
   
freeform_tags
dictionary
on success
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: `{"Department": "Finance"}`

Sample:
{'Department': 'Finance'}
   
is_pv_encryption_in_transit_enabled
boolean
on success
Whether to enable in-transit encryption for the data volume's paravirtualized attachment. This field applies to both block volumes and boot volumes. The default value is false.

Sample:
True
   
kms_key_id
string
on success
The OCID of the Key Management Service key assigned to the boot volume.

Sample:
ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx
   
node_pool_pod_network_option_details
complex
on success
The CNI related configuration of pods in the node pool.

     
cni_type
string
on success
The CNI plugin used by this node pool

Sample:
OCI_VCN_IP_NATIVE
     
max_pods_per_node
integer
on success
The max number of pods per node in the node pool. This value will be limited by the number of VNICs attachable to the node pool shape

Sample:
56
     
pod_nsg_ids
list / elements=string
on success
The OCIDs of the Network Security Group(s) to associate pods for this node pool with. For more information about NSGs, see NetworkSecurityGroup.

     
pod_subnet_ids
list / elements=string
on success
The OCIDs of the subnets in which to place pods for this node pool. This can be one of the node pool subnet IDs

   
nsg_ids
list / elements=string
on success
The OCIDs of the Network Security Group(s) to associate nodes for this node pool with. For more information about NSGs, see NetworkSecurityGroup.

   
placement_configs
complex
on success
The placement configurations for the node pool. Provide one placement configuration for each availability domain in which you intend to launch a node.
To use the node pool with a regional subnet, provide a placement configuration for each availability domain, and include the regional subnet in each placement configuration.

     
availability_domain
string
on success
The availability domain in which to place nodes. Example: `Uocm:PHX-AD-1`

Sample:
Uocm:PHX-AD-1
     
capacity_reservation_id
string
on success
The OCID of the compute capacity reservation in which to place the compute instance.

Sample:
ocid1.capacityreservation.oc1..xxxxxxEXAMPLExxxxxx
     
fault_domains
list / elements=string
on success
A list of fault domains in which to place nodes.

     
subnet_id
string
on success
The OCID of the subnet in which to place nodes.

Sample:
ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx
   
size
integer
on success
The number of nodes in the node pool.

Sample:
56
 
node_eviction_node_pool_settings
complex
on success

   
eviction_grace_duration
string
on success
Duration after which OKE will give up eviction of the pods on the node. PT0M will indicate you want to delete the node without cordon and drain. Default PT60M, Min PT0M, Max: PT60M. Format ISO 8601 e.g PT30M

Sample:
eviction_grace_duration_example
   
is_force_delete_after_grace_duration
boolean
on success
If the underlying compute instance should be deleted if you cannot evict all the pods in grace period

Sample:
True
 
node_image_id
string
on success
Deprecated. see `nodeSource`. The OCID of the image running on the nodes in the node pool.

Sample:
ocid1.nodeimage.oc1..xxxxxxEXAMPLExxxxxx
 
node_image_name
string
on success
Deprecated. see `nodeSource`. The name of the image running on the nodes in the node pool.

Sample:
node_image_name_example
 
node_metadata
dictionary
on success
A list of key/value pairs to add to each underlying OCI instance in the node pool on launch.
Returned for get operation

 
node_shape
string
on success
The name of the node shape of the nodes in the node pool.

Sample:
node_shape_example
 
node_shape_config
complex
on success
The shape configuration of the nodes.

   
memory_in_gbs
float
on success
The total amount of memory available to each node, in gigabytes.

Sample:
3.4
   
ocpus
float
on success
The total number of OCPUs available to each node in the node pool. See here for details.

Sample:
3.4
 
node_source
complex
on success
Deprecated. see `nodeSourceDetails`. Source running on the nodes in the node pool.

   
image_id
string
on success
The OCID of the image.

Sample:
ocid1.image.oc1..xxxxxxEXAMPLExxxxxx
   
source_name
string
on success
The user-friendly name of the entity corresponding to the OCID.

Sample:
source_name_example
   
source_type
string
on success
The source type of this option. `IMAGE` means the OCID is of an image.

Sample:
IMAGE
 
node_source_details
complex
on success
Source running on the nodes in the node pool.

   
boot_volume_size_in_gbs
integer
on success
The size of the boot volume in GBs. Minimum value is 50 GB. See here for max custom boot volume sizing and OS-specific requirements.

Sample:
56
   
image_id
string
on success
The OCID of the image used to boot the node.

Sample:
ocid1.image.oc1..xxxxxxEXAMPLExxxxxx
   
source_type
string
on success
The source type for the node. Use `IMAGE` when specifying an OCID of an image.

Sample:
IMAGE
 
nodes
complex
on success
The nodes in the node pool.
Returned for get operation

   
availability_domain
string
on success
The name of the availability domain in which this node is placed.

Sample:
Uocm:PHX-AD-1
   
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"Operations": {"CostCenter": "42"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
   
fault_domain
string
on success
The fault domain of this node.

Sample:
FAULT-DOMAIN-1
   
freeform_tags
dictionary
on success
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: `{"Department": "Finance"}`

Sample:
{'Department': 'Finance'}
   
id
string
on success
The OCID of the compute instance backing this node.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
   
kubernetes_version
string
on success
The version of Kubernetes this node is running.

Sample:
kubernetes_version_example
   
lifecycle_details
string
on success
Details about the state of the node.

Sample:
lifecycle_details_example
   
lifecycle_state
string
on success
The state of the node.

Sample:
CREATING
   
name
string
on success
The name of the node.

Sample:
name_example
   
node_error
complex
on success
An error that may be associated with the node.

     
code
string
on success
A short error code that defines the upstream error, meant for programmatic parsing. See API Errors.

Sample:
code_example
     
message
string
on success
A human-readable error string of the upstream error.

Sample:
message_example
     
opc_request_id
string
on success
Unique Oracle-assigned identifier for the upstream request. If you need to contact Oracle about a particular upstream request, please provide the request ID.

Sample:
ocid1.opcrequest.oc1..xxxxxxEXAMPLExxxxxx
     
status
string
on success
The status of the HTTP response encountered in the upstream error.

Sample:
status_example
   
node_pool_id
string
on success
The OCID of the node pool to which this node belongs.

Sample:
ocid1.nodepool.oc1..xxxxxxEXAMPLExxxxxx
   
private_ip
string
on success
The private IP address of this node.

Sample:
private_ip_example
   
public_ip
string
on success
The public IP address of this node.

Sample:
public_ip_example
   
subnet_id
string
on success
The OCID of the subnet in which this node is placed.

Sample:
ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx
   
system_tags
dictionary
on success
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`

 
quantity_per_subnet
integer
on success
The number of nodes in each subnet.

Sample:
56
 
ssh_public_key
string
on success
The SSH public key on each node in the node pool on launch.

Sample:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAz...
 
subnet_ids
list / elements=string
on success
The OCIDs of the subnets in which to place nodes for this node pool.

 
system_tags
dictionary
on success
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`



Authors

  • Oracle (@oracle)