cluster_kustomization_name = cluster_name
db_vim_account = content["vim_account"]
cloud_type = db_vim_account["vim_type"]
- nodepool_name = ""
+ nodegroup_name = ""
if cloud_type == "aws":
- nodepool_name = f"{cluster_name}-nodegroup"
+ nodegroup_name = f"{cluster_name}-nodegroup"
cluster_name = f"{cluster_name}-cluster"
elif cloud_type == "gcp":
- nodepool_name = f"nodepool-{cluster_name}"
+ nodegroup_name = f"nodepool-{cluster_name}"
bootstrap = op_params.get("bootstrap", True)
if cloud_type in ("azure", "gcp", "aws"):
checkings_list = [
]
else:
return False, "Not suitable VIM account to check cluster status"
- if nodepool_name:
- nodepool_check = {
- "item": f"nodepool_{cloud_type}",
- "name": nodepool_name,
+ if nodegroup_name:
+ nodegroup_check = {
+ "item": f"nodegroup_{cloud_type}",
+ "name": nodegroup_name,
"namespace": "",
"condition": {
"jsonpath_filter": "status.conditions[?(@.type=='Ready')].status",
},
"timeout": self._checkloop_resource_timeout,
"enable": True,
- "resourceState": "IN_PROGRESS.RESOURCE_READY.NODEPOOL",
+ "resourceState": "IN_PROGRESS.RESOURCE_READY.NODEGROUP",
}
- checkings_list.insert(3, nodepool_check)
+ checkings_list.insert(3, nodegroup_check)
return await self.common_check_list(
op_id, checkings_list, "clusters", db_cluster
)
return False, "Not suitable VIM account to check cluster status"
# Scale operation
if "node_count" in op_params:
- checkings_list.append(
- {
- "item": f"cluster_{cloud_type}",
- "name": cluster_name,
- "namespace": "",
- "condition": {
- "jsonpath_filter": "status.atProvider.defaultNodePool[0].nodeCount",
- "value": f"{op_params['node_count']}",
- },
- "timeout": self._checkloop_resource_timeout * 3,
- "enable": True,
- "resourceState": "IN_PROGRESS.RESOURCE_READY.NODE_COUNT.CLUSTER",
- }
- )
+ if cloud_type in ("azure", "gcp"):
+ checkings_list.append(
+ {
+ "item": f"cluster_{cloud_type}",
+ "name": cluster_name,
+ "namespace": "",
+ "condition": {
+ "jsonpath_filter": "status.atProvider.defaultNodePool[0].nodeCount",
+ "value": f"{op_params['node_count']}",
+ },
+ "timeout": self._checkloop_resource_timeout * 3,
+ "enable": True,
+ "resourceState": "IN_PROGRESS.RESOURCE_READY.NODE_COUNT.CLUSTER",
+ }
+ )
+ elif cloud_type == "aws":
+ checkings_list.append(
+ {
+ "item": f"nodegroup_{cloud_type}",
+ "name": f"{cluster_name}-nodegroup",
+ "namespace": "",
+ "condition": {
+ "jsonpath_filter": "status.atProvider.scalingConfig[0].desiredSize",
+ "value": f"{op_params['node_count']}",
+ },
+ "timeout": self._checkloop_resource_timeout * 3,
+ "enable": True,
+ "resourceState": "IN_PROGRESS.RESOURCE_READY.NODE_COUNT.CLUSTER",
+ }
+ )
+
# Upgrade operation
if "k8s_version" in op_params:
checkings_list.append(