k8s-helper-cli 0.2.4__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: k8s-helper-cli
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: A simplified Python wrapper for common Kubernetes operations
5
5
  Author-email: Harshit Chatterjee <harshitchatterjee50@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "k8s-helper-cli"
3
- version = "0.2.4"
3
+ version = "0.2.6"
4
4
  description = "A simplified Python wrapper for common Kubernetes operations"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -20,7 +20,7 @@ from .utils import (
20
20
  create_service_manifest
21
21
  )
22
22
 
23
- __version__ = "0.2.4"
23
+ __version__ = "0.2.6"
24
24
  __author__ = "Harshit Chatterjee"
25
25
  __email__ = "harshitchatterjee50@gmail.com"
26
26
 
@@ -779,16 +779,18 @@ def create_eks_cluster(
779
779
  ami_type=ami_type,
780
780
  capacity_type=capacity_type,
781
781
  scaling_config=scaling_config
782
+ # No SSH key for automatic creation
782
783
  )
783
784
  console.print(f"✅ Node group creation initiated: {nodegroup_name}")
784
785
  console.print(f"📋 Node group ARN: {nodegroup_info['nodegroup_arn']}")
785
786
 
786
787
  console.print(f"⏳ Waiting for node group to become active...")
787
- if eks_client.wait_for_nodegroup_active(name, nodegroup_name):
788
- console.print("✅ Node group is now active!")
789
- console.print("🎉 Cluster is ready with worker nodes!")
790
- else:
791
- console.print("❌ Timeout waiting for node group to become active")
788
+ with console.status("Waiting for node group to be ready..."):
789
+ if eks_client.wait_for_nodegroup_active(name, nodegroup_name):
790
+ console.print(" Node group is now active!")
791
+ console.print("🎉 Cluster is ready with worker nodes!")
792
+ else:
793
+ console.print("❌ Timeout waiting for node group to become active")
792
794
  except Exception as e:
793
795
  console.print(f"❌ Failed to create node group: {e}")
794
796
 
@@ -841,6 +843,7 @@ def create_nodegroup(
841
843
  desired_size: int = typer.Option(2, "--desired-size", help="Desired number of nodes"),
842
844
  ami_type: str = typer.Option("AL2_x86_64", "--ami-type", help="AMI type for nodes"),
843
845
  capacity_type: str = typer.Option("ON_DEMAND", "--capacity-type", help="Capacity type: ON_DEMAND or SPOT"),
846
+ ssh_key: Optional[str] = typer.Option(None, "--ssh-key", help="EC2 SSH key name for remote access"),
844
847
  wait: bool = typer.Option(True, "--wait/--no-wait", help="Wait for node group to be ready")
845
848
  ):
846
849
  """Create an EKS managed node group"""
@@ -892,7 +895,8 @@ def create_nodegroup(
892
895
  instance_types=instance_type_list,
893
896
  ami_type=ami_type,
894
897
  capacity_type=capacity_type,
895
- scaling_config=scaling_config
898
+ scaling_config=scaling_config,
899
+ ssh_key=ssh_key
896
900
  )
897
901
 
898
902
  console.print(f"✅ Node group creation initiated")
@@ -337,7 +337,8 @@ class EKSClient:
337
337
  def create_nodegroup(self, cluster_name: str, nodegroup_name: str,
338
338
  instance_types: List[str] = None, ami_type: str = "AL2_x86_64",
339
339
  capacity_type: str = "ON_DEMAND", scaling_config: Dict = None,
340
- subnets: List[str] = None, node_role_arn: str = None) -> Dict:
340
+ subnets: List[str] = None, node_role_arn: str = None,
341
+ ssh_key: str = None) -> Dict:
341
342
  """Create an EKS managed node group
342
343
 
343
344
  Args:
@@ -349,6 +350,7 @@ class EKSClient:
349
350
  scaling_config: Scaling configuration
350
351
  subnets: List of subnet IDs
351
352
  node_role_arn: IAM role ARN for nodes
353
+ ssh_key: EC2 SSH key name for remote access (optional)
352
354
 
353
355
  Returns:
354
356
  Dict containing node group information
@@ -374,20 +376,26 @@ class EKSClient:
374
376
  cluster_details = self.eks_client.describe_cluster(name=cluster_name)
375
377
  subnets = cluster_details['cluster']['resourcesVpcConfig']['subnetIds']
376
378
 
377
- # Create the node group
378
- response = self.eks_client.create_nodegroup(
379
- clusterName=cluster_name,
380
- nodegroupName=nodegroup_name,
381
- scalingConfig=scaling_config,
382
- instanceTypes=instance_types,
383
- amiType=ami_type,
384
- capacityType=capacity_type,
385
- nodeRole=node_role_arn,
386
- subnets=subnets,
387
- remoteAccess={
388
- 'ec2SshKey': None # SSH key is optional
379
+ # Prepare node group creation parameters
380
+ nodegroup_params = {
381
+ 'clusterName': cluster_name,
382
+ 'nodegroupName': nodegroup_name,
383
+ 'scalingConfig': scaling_config,
384
+ 'instanceTypes': instance_types,
385
+ 'amiType': ami_type,
386
+ 'capacityType': capacity_type,
387
+ 'nodeRole': node_role_arn,
388
+ 'subnets': subnets
389
+ }
390
+
391
+ # Only add remoteAccess if SSH key is provided
392
+ if ssh_key:
393
+ nodegroup_params['remoteAccess'] = {
394
+ 'ec2SshKey': ssh_key
389
395
  }
390
- )
396
+
397
+ # Create the node group
398
+ response = self.eks_client.create_nodegroup(**nodegroup_params)
391
399
 
392
400
  return {
393
401
  'nodegroup_name': nodegroup_name,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: k8s-helper-cli
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: A simplified Python wrapper for common Kubernetes operations
5
5
  Author-email: Harshit Chatterjee <harshitchatterjee50@gmail.com>
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes