oracle.oci.oci_container_engine_cluster_actions – Perform actions on a Cluster resource 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_cluster_actions.

New in version 2.9.0: of oracle.oci

Synopsis

  • Perform actions on a Cluster resource in Oracle Cloud Infrastructure

  • For action=cluster_migrate_to_native_vcn, initiates cluster migration to use native VCN.

  • For action=update_cluster_endpoint_config, update the details of the cluster endpoint configuration.

Requirements

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

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • cluster_migrate_to_native_vcn
  • update_cluster_endpoint_config
The action to perform on the Cluster.
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 / required
The OCID of the cluster.

aliases: id
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.
decommission_delay_duration
string
The optional override of the non-native endpoint decommission time after migration is complete. Defaults to 30 days.
Applicable only for action=cluster_migrate_to_native_vcn.
endpoint_config
dictionary
The network configuration for access to the Cluster control plane.
Required for action=cluster_migrate_to_native_vcn.
is_public_ip_enabled
boolean
    Choices:
  • no
  • yes
Whether the cluster should be assigned a public IP address. Defaults to false. If set to true on a private subnet, the cluster provisioning will fail.
nsg_ids
list / elements=string
A list of the OCIDs of the network security groups (NSGs) to apply to the cluster endpoint. For more information about NSGs, see NetworkSecurityGroup.
subnet_id
string
The OCID of the regional subnet in which to place the Cluster endpoint.
is_public_ip_enabled
boolean
    Choices:
  • no
  • yes
Whether the cluster should be assigned a public IP address. Defaults to false. If set to true on a private subnet, the cluster update will fail.
Applicable only for action=update_cluster_endpoint_config.
nsg_ids
list / elements=string
A list of the OCIDs of the network security groups (NSGs) to apply to the cluster endpoint. For more information about NSGs, see NetworkSecurityGroup.
Applicable only for action=update_cluster_endpoint_config.
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.
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
wait
boolean
    Choices:
  • no
  • yes ←
Whether to wait for create or delete operation to complete.
wait_timeout
integer
Time, in seconds, to wait when wait=yes. Defaults to 1200 for most of the services but some services might have a longer wait timeout.

Examples

- name: Perform action cluster_migrate_to_native_vcn on cluster
  oci_container_engine_cluster_actions:
    # required
    endpoint_config:
      # optional
      subnet_id: "ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx"
      nsg_ids: [ "nsg_ids_example" ]
      is_public_ip_enabled: true
    cluster_id: "ocid1.cluster.oc1..xxxxxxEXAMPLExxxxxx"
    action: cluster_migrate_to_native_vcn

    # optional
    decommission_delay_duration: decommission_delay_duration_example

- name: Perform action update_cluster_endpoint_config on cluster
  oci_container_engine_cluster_actions:
    # required
    cluster_id: "ocid1.cluster.oc1..xxxxxxEXAMPLExxxxxx"
    action: update_cluster_endpoint_config

    # optional
    nsg_ids: [ "nsg_ids_example" ]
    is_public_ip_enabled: true

Return Values

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

Key Returned Description
cluster
complex
on success
Details of the Cluster resource acted upon by the current operation

Sample:
{'available_kubernetes_upgrades': [], 'cluster_pod_network_options': [{'cni_type': 'OCI_VCN_IP_NATIVE'}], 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'endpoint_config': {'is_public_ip_enabled': True, 'nsg_ids': [], 'subnet_id': 'ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx'}, 'endpoints': {'kubernetes': 'kubernetes_example', 'private_endpoint': 'private_endpoint_example', 'public_endpoint': 'public_endpoint_example', 'vcn_hostname_endpoint': 'vcn_hostname_endpoint_example'}, 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'image_policy_config': {'is_policy_enabled': True, 'key_details': [{'kms_key_id': 'ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx'}]}, 'kms_key_id': 'ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx', 'kubernetes_version': 'kubernetes_version_example', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'CREATING', 'metadata': {'created_by_user_id': 'ocid1.createdbyuser.oc1..xxxxxxEXAMPLExxxxxx', 'created_by_work_request_id': 'ocid1.createdbyworkrequest.oc1..xxxxxxEXAMPLExxxxxx', 'deleted_by_user_id': 'ocid1.deletedbyuser.oc1..xxxxxxEXAMPLExxxxxx', 'deleted_by_work_request_id': 'ocid1.deletedbyworkrequest.oc1..xxxxxxEXAMPLExxxxxx', 'time_created': '2013-10-20T19:20:30+01:00', 'time_deleted': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00', 'updated_by_user_id': 'ocid1.updatedbyuser.oc1..xxxxxxEXAMPLExxxxxx', 'updated_by_work_request_id': 'ocid1.updatedbyworkrequest.oc1..xxxxxxEXAMPLExxxxxx'}, 'name': 'name_example', 'options': {'add_ons': {'is_kubernetes_dashboard_enabled': True, 'is_tiller_enabled': True}, 'admission_controller_options': {'is_pod_security_policy_enabled': True}, 'kubernetes_network_config': {'pods_cidr': 'pods_cidr_example', 'services_cidr': 'services_cidr_example'}, 'persistent_volume_config': {'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'freeform_tags': {'Department': 'Finance'}}, 'service_lb_config': {'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'freeform_tags': {'Department': 'Finance'}}, 'service_lb_subnet_ids': []}, 'system_tags': {}, 'vcn_id': 'ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx'}
 
available_kubernetes_upgrades
list / elements=string
on success
Available Kubernetes versions to which the clusters masters may be upgraded.

 
cluster_pod_network_options
complex
on success
Available CNIs and network options for existing and new node pools of the cluster

   
cni_type
string
on success
The CNI used by the node pools of this cluster

Sample:
OCI_VCN_IP_NATIVE
 
compartment_id
string
on success
The OCID of the compartment in which the cluster 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'}}
 
endpoint_config
complex
on success
The network configuration for access to the Cluster control plane.

   
is_public_ip_enabled
boolean
on success
Whether the cluster should be assigned a public IP address. Defaults to false. If set to true on a private subnet, the cluster provisioning will fail.

Sample:
True
   
nsg_ids
list / elements=string
on success
A list of the OCIDs of the network security groups (NSGs) to apply to the cluster endpoint. For more information about NSGs, see NetworkSecurityGroup.

   
subnet_id
string
on success
The OCID of the regional subnet in which to place the Cluster endpoint.

Sample:
ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx
 
endpoints
complex
on success
Endpoints served up by the cluster masters.

   
kubernetes
string
on success
The non-native networking Kubernetes API server endpoint.

Sample:
kubernetes_example
   
private_endpoint
string
on success
The private native networking Kubernetes API server endpoint.

Sample:
private_endpoint_example
   
public_endpoint
string
on success
The public native networking Kubernetes API server endpoint, if one was requested.

Sample:
public_endpoint_example
   
vcn_hostname_endpoint
string
on success
The FQDN assigned to the Kubernetes API private endpoint. Example: 'https://yourVcnHostnameEndpoint'

Sample:
vcn_hostname_endpoint_example
 
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 cluster.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
image_policy_config
complex
on success
The image verification policy for signature validation.

   
is_policy_enabled
boolean
on success
Whether the image verification policy is enabled. Defaults to false. If set to true, the images will be verified against the policy at runtime.

Sample:
True
   
key_details
complex
on success
A list of KMS key details.

     
kms_key_id
string
on success
The OCIDs of the KMS key that will be used to verify whether the images are signed by an approved source.

Sample:
ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx
 
kms_key_id
string
on success
The OCID of the KMS key to be used as the master encryption key for Kubernetes secret encryption.

Sample:
ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx
 
kubernetes_version
string
on success
The version of Kubernetes running on the cluster masters.

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

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

Sample:
CREATING
 
metadata
complex
on success
Metadata about the cluster.

   
created_by_user_id
string
on success
The user who created the cluster.

Sample:
ocid1.createdbyuser.oc1..xxxxxxEXAMPLExxxxxx
   
created_by_work_request_id
string
on success
The OCID of the work request which created the cluster.

Sample:
ocid1.createdbyworkrequest.oc1..xxxxxxEXAMPLExxxxxx
   
deleted_by_user_id
string
on success
The user who deleted the cluster.

Sample:
ocid1.deletedbyuser.oc1..xxxxxxEXAMPLExxxxxx
   
deleted_by_work_request_id
string
on success
The OCID of the work request which deleted the cluster.

Sample:
ocid1.deletedbyworkrequest.oc1..xxxxxxEXAMPLExxxxxx
   
time_created
string
on success
The time the cluster was created.

Sample:
2013-10-20T19:20:30+01:00
   
time_deleted
string
on success
The time the cluster was deleted.

Sample:
2013-10-20T19:20:30+01:00
   
time_updated
string
on success
The time the cluster was updated.

Sample:
2013-10-20T19:20:30+01:00
   
updated_by_user_id
string
on success
The user who updated the cluster.

Sample:
ocid1.updatedbyuser.oc1..xxxxxxEXAMPLExxxxxx
   
updated_by_work_request_id
string
on success
The OCID of the work request which updated the cluster.

Sample:
ocid1.updatedbyworkrequest.oc1..xxxxxxEXAMPLExxxxxx
 
name
string
on success
The name of the cluster.

Sample:
name_example
 
options
complex
on success
Optional attributes for the cluster.

   
add_ons
complex
on success
Configurable cluster add-ons

     
is_kubernetes_dashboard_enabled
boolean
on success
Whether or not to enable the Kubernetes Dashboard add-on.

Sample:
True
     
is_tiller_enabled
boolean
on success
Whether or not to enable the Tiller add-on.

Sample:
True
   
admission_controller_options
complex
on success
Configurable cluster admission controllers

     
is_pod_security_policy_enabled
boolean
on success
Whether or not to enable the Pod Security Policy admission controller.

Sample:
True
   
kubernetes_network_config
complex
on success
Network configuration for Kubernetes.

     
pods_cidr
string
on success
The CIDR block for Kubernetes pods. Optional, defaults to 10.244.0.0/16.

Sample:
pods_cidr_example
     
services_cidr
string
on success
The CIDR block for Kubernetes services. Optional, defaults to 10.96.0.0/16.

Sample:
services_cidr_example
   
persistent_volume_config
complex
on success

     
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'}
   
service_lb_config
complex
on success

     
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'}
   
service_lb_subnet_ids
list / elements=string
on success
The OCIDs of the subnets used for Kubernetes services load balancers.

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

 
vcn_id
string
on success
The OCID of the virtual cloud network (VCN) in which the cluster exists.

Sample:
ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx


Authors

  • Oracle (@oracle)