@@ -6,6 +6,35 @@ class KubernetesClusterPlugin():
66 An abstract base class for custom Kubernetes cluster provider plugins.
77 It represents an interface class from which the api provider-specific
88 plugins must be derived as child classes
9+
10+ To implement fill the methods `create_cluster` and `delete_cluster` with
11+ api provider-specific functionalities for creating and deleting clusters.
12+
13+ - Implement `create_cluster` and `delete_cluster` methods
14+ - Create `__init__(self, config_file=None)` method to handle api specific
15+ configurations.
16+
17+ Example:
18+ .. code:: python
19+
20+ from interface import KubernetesClusterPlugin
21+ from apiX_library import cluster_api_class as ClusterAPI
22+
23+ class PluginX(KubernetesClusterPlugin):
24+
25+ def __init__(self, config_file=None):
26+ self.config = config_file
27+
28+ def create_cluster(self):
29+ self.cluster = ClusterAPI(name=cluster_name, image=cluster_image)
30+ self.cluster.create(self.config)
31+ kubeconfig_filepath = str(self.cluster.kubeconfig_path.resolve())
32+ return self.kubeconfig_filepath
33+
34+ def delete_cluster(self):
35+ self.cluster = ClusterAPI(cluster_name)
36+ self.cluster.delete()
37+ ..
938 """
1039
1140 @abstractmethod
@@ -22,5 +51,5 @@ def create_cluster(self, cluster_name="scs-cluster", version=None, kubeconfig_fi
2251 def delete_cluster (self , cluster_name = None ):
2352 """
2453 This method is to be called in order to unprovision a cluster
25- :param: cluster_uuid :
54+ :param: cluster_name :
2655 """
0 commit comments