k8s-helper-cli 0.1.2__tar.gz → 0.2.1__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.
Files changed (20) hide show
  1. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/PKG-INFO +126 -3
  2. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/README.md +123 -2
  3. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/pyproject.toml +4 -2
  4. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper/__init__.py +1 -1
  5. k8s_helper_cli-0.2.1/src/k8s_helper/cli.py +977 -0
  6. k8s_helper_cli-0.2.1/src/k8s_helper/core.py +1099 -0
  7. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper_cli.egg-info/PKG-INFO +126 -3
  8. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper_cli.egg-info/requires.txt +2 -0
  9. k8s_helper_cli-0.1.2/src/k8s_helper/cli.py +0 -526
  10. k8s_helper_cli-0.1.2/src/k8s_helper/core.py +0 -511
  11. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/LICENSE +0 -0
  12. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/setup.cfg +0 -0
  13. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper/config.py +0 -0
  14. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper/utils.py +0 -0
  15. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper_cli.egg-info/SOURCES.txt +0 -0
  16. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper_cli.egg-info/dependency_links.txt +0 -0
  17. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper_cli.egg-info/entry_points.txt +0 -0
  18. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/src/k8s_helper_cli.egg-info/top_level.txt +0 -0
  19. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/tests/test_core.py +0 -0
  20. {k8s_helper_cli-0.1.2 → k8s_helper_cli-0.2.1}/tests/test_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: k8s-helper-cli
3
- Version: 0.1.2
3
+ Version: 0.2.1
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
@@ -14,6 +14,8 @@ Requires-Dist: kubernetes>=26.1.0
14
14
  Requires-Dist: typer>=0.9.0
15
15
  Requires-Dist: rich>=13.0.0
16
16
  Requires-Dist: pyyaml>=6.0
17
+ Requires-Dist: boto3>=1.26.0
18
+ Requires-Dist: botocore>=1.29.0
17
19
  Provides-Extra: dev
18
20
  Requires-Dist: pytest>=7.0.0; extra == "dev"
19
21
  Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
@@ -30,8 +32,13 @@ A simplified Python wrapper for common Kubernetes operations that makes it easy
30
32
  ## Features
31
33
 
32
34
  - ✅ **Pod Management**: Create, delete, and list pods
33
- - ✅ **Deployment Management**: Create, delete, scale, and list deployments
34
- - ✅ **Service Management**: Create, delete, and list services
35
+ - ✅ **Deployment Management**: Create, delete, scale, and list deployments with init containers
36
+ - ✅ **Service Management**: Create, delete, list services with URL retrieval
37
+ - ✅ **AWS EKS Integration**: Create and manage EKS clusters with automatic configuration
38
+ - ✅ **Secrets Management**: Create, list, and delete Kubernetes secrets
39
+ - ✅ **Persistent Volume Claims**: Create, list, and delete PVCs with multiple access modes
40
+ - ✅ **Service URL Discovery**: Get service URLs including AWS ELB DNS names
41
+ - ✅ **Advanced Deployments**: Support for init containers, volume mounts, and complex configurations
35
42
  - ✅ **Resource Monitoring**: Get logs, events, and resource descriptions
36
43
  - ✅ **Easy Configuration**: Simple configuration management
37
44
  - ✅ **Formatted Output**: Beautiful table, YAML, and JSON output formats
@@ -60,6 +67,13 @@ pip install -e .
60
67
 
61
68
  **Important**: k8s-helper requires an active Kubernetes cluster connection. Without a properly configured kubectl and accessible cluster, the commands will fail with configuration errors.
62
69
 
70
+ ### AWS EKS Features Prerequisites
71
+
72
+ For AWS EKS integration features:
73
+ - AWS CLI configured with appropriate credentials (`aws configure`)
74
+ - AWS IAM permissions for EKS, EC2, and IAM operations
75
+ - boto3 package (automatically installed with k8s-helper-cli)
76
+
63
77
  ### Setting up Kubernetes (Choose one):
64
78
 
65
79
  1. **Local Development**:
@@ -523,6 +537,9 @@ k8s-helper provides a command-line interface for Kubernetes operations. After in
523
537
  # Show help
524
538
  k8s-helper --help
525
539
 
540
+ # Show version
541
+ k8s-helper --version
542
+
526
543
  # Configure settings
527
544
  k8s-helper config --namespace my-namespace
528
545
  k8s-helper config --output-format yaml
@@ -699,6 +716,112 @@ k8s-helper --install-completion zsh
699
716
  k8s-helper --show-completion bash
700
717
  ```
701
718
 
719
+ ### AWS EKS Integration
720
+
721
+ ```bash
722
+ # Create an EKS cluster
723
+ k8s-helper create-eks-cluster my-cluster --region us-west-2 --version 1.29
724
+
725
+ # Create EKS cluster with custom settings
726
+ k8s-helper create-eks-cluster my-cluster \
727
+ --region us-east-1 \
728
+ --instance-types t3.medium,t3.large \
729
+ --min-size 2 \
730
+ --max-size 10 \
731
+ --desired-size 3 \
732
+ --node-group my-nodes \
733
+ --wait
734
+
735
+ # Note: Requires AWS credentials configured (aws configure)
736
+ ```
737
+
738
+ ### Secrets Management
739
+
740
+ ```bash
741
+ # Create a secret
742
+ k8s-helper create-secret my-secret --data "username=admin,password=secret123"
743
+
744
+ # Create a TLS secret
745
+ k8s-helper create-secret tls-secret --data "tls.crt=cert_content,tls.key=key_content" --type kubernetes.io/tls
746
+
747
+ # List secrets
748
+ k8s-helper list-secrets --namespace my-namespace
749
+
750
+ # Delete a secret
751
+ k8s-helper delete-secret my-secret --namespace my-namespace
752
+ ```
753
+
754
+ ### Persistent Volume Claims (PVC)
755
+
756
+ ```bash
757
+ # Create a PVC
758
+ k8s-helper create-pvc my-storage 10Gi --access-modes ReadWriteOnce
759
+
760
+ # Create PVC with specific storage class
761
+ k8s-helper create-pvc my-storage 50Gi --storage-class fast-ssd --access-modes ReadWriteMany
762
+
763
+ # List PVCs
764
+ k8s-helper list-pvcs --namespace my-namespace
765
+
766
+ # Delete a PVC
767
+ k8s-helper delete-pvc my-storage --namespace my-namespace
768
+ ```
769
+
770
+ ### Service URL Retrieval
771
+
772
+ ```bash
773
+ # Get service URL (including AWS ELB URLs)
774
+ k8s-helper service-url my-service --namespace my-namespace
775
+
776
+ # Watch for URL changes (useful for LoadBalancer provisioning)
777
+ k8s-helper service-url my-service --watch --namespace my-namespace
778
+
779
+ # Shows:
780
+ # - ClusterIP access information
781
+ # - NodePort URLs
782
+ # - AWS ELB DNS names for LoadBalancer services
783
+ # - External IPs and hostnames
784
+ ```
785
+
786
+ ### Enhanced Application Deployment
787
+
788
+ ```bash
789
+ # Deploy with init container
790
+ k8s-helper apply my-app nginx:latest \
791
+ --init-container "init-db:postgres:13:pg_isready -h db" \
792
+ --init-env "PGHOST=db,PGPORT=5432"
793
+
794
+ # Deploy with PVC mount
795
+ k8s-helper apply my-app nginx:latest \
796
+ --pvc "my-storage:/data" \
797
+ --replicas 2
798
+
799
+ # Deploy with secret mount
800
+ k8s-helper apply my-app nginx:latest \
801
+ --secret "my-secret:/etc/secrets" \
802
+ --port 8080
803
+
804
+ # Deploy with LoadBalancer and show URL
805
+ k8s-helper apply my-app nginx:latest \
806
+ --service-type LoadBalancer \
807
+ --wait \
808
+ --show-url
809
+
810
+ # Complex deployment with multiple features
811
+ k8s-helper apply my-app nginx:latest \
812
+ --replicas 3 \
813
+ --port 8080 \
814
+ --service-type LoadBalancer \
815
+ --env "ENV=production,DEBUG=false" \
816
+ --labels "app=my-app,version=v1.0" \
817
+ --init-container "migrate:migrate-tool:latest:migrate up" \
818
+ --init-env "DB_HOST=postgres,DB_PORT=5432" \
819
+ --secret "db-secret:/etc/db" \
820
+ --pvc "app-storage:/var/data" \
821
+ --wait \
822
+ --show-url
823
+ ```
824
+
702
825
  ## Real-World Examples
703
826
 
704
827
  ### 1. Simple Web Application
@@ -5,8 +5,13 @@ A simplified Python wrapper for common Kubernetes operations that makes it easy
5
5
  ## Features
6
6
 
7
7
  - ✅ **Pod Management**: Create, delete, and list pods
8
- - ✅ **Deployment Management**: Create, delete, scale, and list deployments
9
- - ✅ **Service Management**: Create, delete, and list services
8
+ - ✅ **Deployment Management**: Create, delete, scale, and list deployments with init containers
9
+ - ✅ **Service Management**: Create, delete, list services with URL retrieval
10
+ - ✅ **AWS EKS Integration**: Create and manage EKS clusters with automatic configuration
11
+ - ✅ **Secrets Management**: Create, list, and delete Kubernetes secrets
12
+ - ✅ **Persistent Volume Claims**: Create, list, and delete PVCs with multiple access modes
13
+ - ✅ **Service URL Discovery**: Get service URLs including AWS ELB DNS names
14
+ - ✅ **Advanced Deployments**: Support for init containers, volume mounts, and complex configurations
10
15
  - ✅ **Resource Monitoring**: Get logs, events, and resource descriptions
11
16
  - ✅ **Easy Configuration**: Simple configuration management
12
17
  - ✅ **Formatted Output**: Beautiful table, YAML, and JSON output formats
@@ -35,6 +40,13 @@ pip install -e .
35
40
 
36
41
  **Important**: k8s-helper requires an active Kubernetes cluster connection. Without a properly configured kubectl and accessible cluster, the commands will fail with configuration errors.
37
42
 
43
+ ### AWS EKS Features Prerequisites
44
+
45
+ For AWS EKS integration features:
46
+ - AWS CLI configured with appropriate credentials (`aws configure`)
47
+ - AWS IAM permissions for EKS, EC2, and IAM operations
48
+ - boto3 package (automatically installed with k8s-helper-cli)
49
+
38
50
  ### Setting up Kubernetes (Choose one):
39
51
 
40
52
  1. **Local Development**:
@@ -498,6 +510,9 @@ k8s-helper provides a command-line interface for Kubernetes operations. After in
498
510
  # Show help
499
511
  k8s-helper --help
500
512
 
513
+ # Show version
514
+ k8s-helper --version
515
+
501
516
  # Configure settings
502
517
  k8s-helper config --namespace my-namespace
503
518
  k8s-helper config --output-format yaml
@@ -674,6 +689,112 @@ k8s-helper --install-completion zsh
674
689
  k8s-helper --show-completion bash
675
690
  ```
676
691
 
692
+ ### AWS EKS Integration
693
+
694
+ ```bash
695
+ # Create an EKS cluster
696
+ k8s-helper create-eks-cluster my-cluster --region us-west-2 --version 1.29
697
+
698
+ # Create EKS cluster with custom settings
699
+ k8s-helper create-eks-cluster my-cluster \
700
+ --region us-east-1 \
701
+ --instance-types t3.medium,t3.large \
702
+ --min-size 2 \
703
+ --max-size 10 \
704
+ --desired-size 3 \
705
+ --node-group my-nodes \
706
+ --wait
707
+
708
+ # Note: Requires AWS credentials configured (aws configure)
709
+ ```
710
+
711
+ ### Secrets Management
712
+
713
+ ```bash
714
+ # Create a secret
715
+ k8s-helper create-secret my-secret --data "username=admin,password=secret123"
716
+
717
+ # Create a TLS secret
718
+ k8s-helper create-secret tls-secret --data "tls.crt=cert_content,tls.key=key_content" --type kubernetes.io/tls
719
+
720
+ # List secrets
721
+ k8s-helper list-secrets --namespace my-namespace
722
+
723
+ # Delete a secret
724
+ k8s-helper delete-secret my-secret --namespace my-namespace
725
+ ```
726
+
727
+ ### Persistent Volume Claims (PVC)
728
+
729
+ ```bash
730
+ # Create a PVC
731
+ k8s-helper create-pvc my-storage 10Gi --access-modes ReadWriteOnce
732
+
733
+ # Create PVC with specific storage class
734
+ k8s-helper create-pvc my-storage 50Gi --storage-class fast-ssd --access-modes ReadWriteMany
735
+
736
+ # List PVCs
737
+ k8s-helper list-pvcs --namespace my-namespace
738
+
739
+ # Delete a PVC
740
+ k8s-helper delete-pvc my-storage --namespace my-namespace
741
+ ```
742
+
743
+ ### Service URL Retrieval
744
+
745
+ ```bash
746
+ # Get service URL (including AWS ELB URLs)
747
+ k8s-helper service-url my-service --namespace my-namespace
748
+
749
+ # Watch for URL changes (useful for LoadBalancer provisioning)
750
+ k8s-helper service-url my-service --watch --namespace my-namespace
751
+
752
+ # Shows:
753
+ # - ClusterIP access information
754
+ # - NodePort URLs
755
+ # - AWS ELB DNS names for LoadBalancer services
756
+ # - External IPs and hostnames
757
+ ```
758
+
759
+ ### Enhanced Application Deployment
760
+
761
+ ```bash
762
+ # Deploy with init container
763
+ k8s-helper apply my-app nginx:latest \
764
+ --init-container "init-db:postgres:13:pg_isready -h db" \
765
+ --init-env "PGHOST=db,PGPORT=5432"
766
+
767
+ # Deploy with PVC mount
768
+ k8s-helper apply my-app nginx:latest \
769
+ --pvc "my-storage:/data" \
770
+ --replicas 2
771
+
772
+ # Deploy with secret mount
773
+ k8s-helper apply my-app nginx:latest \
774
+ --secret "my-secret:/etc/secrets" \
775
+ --port 8080
776
+
777
+ # Deploy with LoadBalancer and show URL
778
+ k8s-helper apply my-app nginx:latest \
779
+ --service-type LoadBalancer \
780
+ --wait \
781
+ --show-url
782
+
783
+ # Complex deployment with multiple features
784
+ k8s-helper apply my-app nginx:latest \
785
+ --replicas 3 \
786
+ --port 8080 \
787
+ --service-type LoadBalancer \
788
+ --env "ENV=production,DEBUG=false" \
789
+ --labels "app=my-app,version=v1.0" \
790
+ --init-container "migrate:migrate-tool:latest:migrate up" \
791
+ --init-env "DB_HOST=postgres,DB_PORT=5432" \
792
+ --secret "db-secret:/etc/db" \
793
+ --pvc "app-storage:/var/data" \
794
+ --wait \
795
+ --show-url
796
+ ```
797
+
677
798
  ## Real-World Examples
678
799
 
679
800
  ### 1. Simple Web Application
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "k8s-helper-cli"
3
- version = "0.1.2"
3
+ version = "0.2.1"
4
4
  description = "A simplified Python wrapper for common Kubernetes operations"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -12,7 +12,9 @@ dependencies = [
12
12
  "kubernetes>=26.1.0",
13
13
  "typer>=0.9.0", # CLI support
14
14
  "rich>=13.0.0", # Pretty terminal output
15
- "pyyaml>=6.0" # YAML handling
15
+ "pyyaml>=6.0", # YAML handling
16
+ "boto3>=1.26.0", # AWS SDK
17
+ "botocore>=1.29.0" # AWS core
16
18
  ]
17
19
 
18
20
  [project.optional-dependencies]
@@ -20,7 +20,7 @@ from .utils import (
20
20
  create_service_manifest
21
21
  )
22
22
 
23
- __version__ = "0.1.0"
23
+ __version__ = "0.2.1"
24
24
  __author__ = "Harshit Chatterjee"
25
25
  __email__ = "harshitchatterjee50@gmail.com"
26
26