openstack.container_infrastructure_management.v1.cluster

The Cluster Class

The Cluster class inherits from Resource.

class openstack.container_infrastructure_management.v1.cluster.Cluster(_synchronized=False, connection=None, **attrs)

The base resource

Parameters:
  • _synchronized (bool) – This is not intended to be used directly. See new() and existing().

  • connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of self._connection in Resource code should protect itself with a check for None.

resources_key = 'clusters'

Plural form of key for resource.

base_path = '/clusters'

The base part of the URI for this resource.

allow_create = True

Allow create operation for this resource.

allow_fetch = True

Allow get operation for this resource.

allow_commit = True

Allow update operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_list = True

Allow list operation for this resource.

allow_patch = True

Allow patch operation for this resource.

commit_method = 'PATCH'

Method for committing a resource (PUT, PATCH, POST)

commit_jsonpatch = True

Whether commit uses JSON patch format.

api_address

The endpoint URL of COE API exposed to end-users.

cluster_template_id

The UUID of the cluster template.

coe_version

Version info of chosen COE in bay/cluster for helping client in picking the right version of client.

create_timeout

The timeout for cluster creation in minutes. The value expected is a positive integer. If the timeout is reached during cluster creation process, the operation will be aborted and the cluster status will be set to CREATE_FAILED. Defaults to 60.

created_at

The date and time when the resource was created. The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC.

discovery_url

The custom discovery url for node discovery. This is used by the COE to discover the servers that have been created to host the containers. The actual discovery mechanism varies with the COE. In some cases, the service fills in the server info in the discovery service. In other cases,if the discovery_url is not specified, the service will use the public discovery service at https://discovery.etcd.io. In this case, the service will generate a unique url here for each bay and store the info for the servers.

fixed_network

The name or ID of the network to provide connectivity to the internal network for the bay/cluster.

fixed_subnet

The fixed subnet to use when allocating network addresses for nodes in bay/cluster.

flavor_id

The flavor name or ID to use when booting the node servers. Defaults to m1.small.

is_floating_ip_enabled

Whether to enable using the floating IP of cloud provider. Some cloud providers use floating IPs while some use public IPs. When set to true, floating IPs will be used. If this value is not provided, the value of floating_ip_enabled provided in the template will be used.

is_master_lb_enabled

Whether to enable the master load balancer. Since multiple masters may exist in a bay/cluster, a Neutron load balancer is created to provide the API endpoint for the bay/cluster and to direct requests to the masters. In some cases, such as when the LBaaS service is not available, this option can be set to false to create a bay/cluster without the load balancer. In this case, one of the masters will serve as the API endpoint. The default is true, i.e. to create the load balancer for the bay.

keypair

The name of the SSH keypair to configure in the bay/cluster servers for SSH access. Users will need the key to be able to ssh to the servers in the bay/cluster. The login name is specific to the bay/cluster driver. For example, with fedora-atomic image the default login name is fedora.

labels

Arbitrary labels. The accepted keys and valid values are defined in the bay/cluster drivers. They are used as a way to pass additional parameters that are specific to a bay/cluster driver.

master_addresses

A list of floating IPs of all master nodes.

master_count

The number of servers that will serve as master for the bay/cluster. Set to more than 1 master to enable High Availability. If the option master-lb-enabled is specified in the baymodel/cluster template, the master servers will be placed in a load balancer pool. Defaults to 1.

master_flavor_id

The flavor of the master node for this baymodel/cluster template.

name

Name of the resource.

node_count

The number of servers that will serve as node in the bay/cluster. Defaults to 1.

node_addresses

A list of floating IPs of all servers that serve as nodes.

stack_id

The reference UUID of orchestration stack from Heat orchestration service.

status

The current state of the bay/cluster.

status_reason

The reason of bay/cluster current status.

updated_at

The date and time when the resource was updated. The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. If the updated_at date and time stamp is not set, its value is null.

uuid

The UUID of the cluster.

resize(session, *, node_count, nodes_to_remove=None)

Resize the cluster.

Parameters:
  • node_count – The number of servers that will serve as node in the bay/cluster. The default is 1.

  • nodes_to_remove – The server ID list will be removed if downsizing the cluster.

Returns:

The UUID of the resized cluster.

Raises:

ResourceNotFound if the resource was not found.

upgrade(session, *, cluster_template, max_batch_size=None)

Upgrade the cluster.

Parameters:
  • cluster_template – The UUID of the cluster template.

  • max_batch_size – The max batch size each time when doing upgrade. The default is 1

Returns:

The UUID of the updated cluster.

Raises:

ResourceNotFound if the resource was not found.