k8s-helper-cli 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

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.3.0
3
+ Version: 0.4.0
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
@@ -16,6 +16,7 @@ Requires-Dist: rich>=13.0.0
16
16
  Requires-Dist: pyyaml>=6.0
17
17
  Requires-Dist: boto3>=1.26.0
18
18
  Requires-Dist: botocore>=1.29.0
19
+ Requires-Dist: requests>=2.20.0
19
20
  Provides-Extra: dev
20
21
  Requires-Dist: pytest>=7.0.0; extra == "dev"
21
22
  Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
@@ -33,12 +34,14 @@ A simplified Python wrapper for common Kubernetes operations that makes it easy
33
34
 
34
35
  - ✅ **Pod Management**: Create, delete, and list pods
35
36
  - ✅ **Deployment Management**: Create, delete, scale, and list deployments with init containers
37
+ - ✅ **Rolling Updates**: Seamless deployment updates with status monitoring
36
38
  - ✅ **Service Management**: Create, delete, list services with URL retrieval
37
39
  - ✅ **AWS EKS Integration**: Create and manage EKS clusters with automatic configuration
38
40
  - ✅ **Secrets Management**: Create, list, and delete Kubernetes secrets
39
41
  - ✅ **Persistent Volume Claims**: Create, list, and delete PVCs with multiple access modes
40
42
  - ✅ **Service URL Discovery**: Get service URLs including AWS ELB DNS names
41
43
  - ✅ **Advanced Deployments**: Support for init containers, volume mounts, and complex configurations
44
+ - ✅ **Monitoring Stack**: One-command setup of Prometheus and Grafana with dashboards
42
45
  - ✅ **Resource Monitoring**: Get logs, events, and resource descriptions
43
46
  - ✅ **Easy Configuration**: Simple configuration management
44
47
  - ✅ **Formatted Output**: Beautiful table, YAML, and JSON output formats
@@ -214,6 +217,60 @@ services = client.list_services()
214
217
  print(format_service_list(services))
215
218
  ```
216
219
 
220
+ ### Monitoring Stack Setup
221
+
222
+ ```python
223
+ # Deploy complete monitoring stack
224
+ result = client.setup_monitoring(
225
+ namespace="monitoring",
226
+ grafana_service_type="NodePort",
227
+ import_dashboard=True,
228
+ wait_for_ready=True
229
+ )
230
+
231
+ if result['success']:
232
+ print("✅ Monitoring stack deployed successfully!")
233
+ print(f"🔑 Grafana credentials: {result['grafana']['admin_user']}/{result['grafana']['admin_password']}")
234
+ else:
235
+ print(f"❌ Deployment failed: {result['error']}")
236
+
237
+ # Get monitoring stack information
238
+ info = client.get_monitoring_info("monitoring")
239
+ print(f"Prometheus running: {info['prometheus']['running']}")
240
+ print(f"Grafana running: {info['grafana']['running']}")
241
+ if info['grafana']['url']:
242
+ print(f"Grafana URL: {info['grafana']['url']}")
243
+ ```
244
+
245
+ ### Prometheus Target Management
246
+
247
+ ```python
248
+ # Add a new monitoring target
249
+ success = client.add_prometheus_target(
250
+ job_name="my-app-metrics",
251
+ targets=["my-app-service:8080", "10.0.1.100:9090"],
252
+ namespace="monitoring",
253
+ metrics_path="/metrics",
254
+ scrape_interval="30s"
255
+ )
256
+
257
+ # List all monitoring targets
258
+ targets_info = client.list_prometheus_targets("monitoring")
259
+ for target in targets_info['targets']:
260
+ print(f"Job: {target['job_name']}, Targets: {target['targets']}")
261
+
262
+ # Update existing target
263
+ client.update_prometheus_target(
264
+ job_name="my-app-metrics",
265
+ targets=["my-app-service:8080", "my-app-service:9090"],
266
+ namespace="monitoring",
267
+ scrape_interval="15s"
268
+ )
269
+
270
+ # Remove monitoring target
271
+ client.remove_prometheus_target("my-app-metrics", "monitoring")
272
+ ```
273
+
217
274
  ### Logs and Events
218
275
 
219
276
  ```python
@@ -604,6 +661,54 @@ k8s-helper list-services --namespace my-namespace
604
661
  k8s-helper list-services --output yaml
605
662
  ```
606
663
 
664
+ ### Monitoring Stack
665
+
666
+ ```bash
667
+ # Deploy complete monitoring stack (Prometheus + Grafana)
668
+ k8s-helper setup-monitoring
669
+
670
+ # Deploy to custom namespace with LoadBalancer service
671
+ k8s-helper setup-monitoring --namespace monitoring --service-type LoadBalancer
672
+
673
+ # Deploy without importing default dashboard
674
+ k8s-helper setup-monitoring --no-dashboard
675
+
676
+ # Check monitoring stack status
677
+ k8s-helper monitoring-status --namespace monitoring
678
+
679
+ # Remove monitoring stack
680
+ k8s-helper delete-monitoring --namespace monitoring
681
+ ```
682
+
683
+ ### Prometheus Target Management
684
+
685
+ ```bash
686
+ # Add a new monitoring target
687
+ k8s-helper add-prometheus-target my-app-metrics "my-app-service:8080,10.0.1.100:9090" --namespace monitoring
688
+
689
+ # Add target with custom configuration
690
+ k8s-helper add-prometheus-target custom-metrics "service:9090" --metrics-path "/custom/metrics" --scrape-interval "30s"
691
+
692
+ # List all monitoring targets
693
+ k8s-helper list-prometheus-targets --namespace monitoring
694
+
695
+ # List targets in different output formats
696
+ k8s-helper list-prometheus-targets --output json
697
+ k8s-helper list-prometheus-targets --output yaml
698
+
699
+ # Update existing target
700
+ k8s-helper update-prometheus-target my-app-metrics "new-service:8080,updated-service:9090" --namespace monitoring
701
+
702
+ # Update target with new configuration
703
+ k8s-helper update-prometheus-target my-app-metrics "service:8080" --metrics-path "/v2/metrics" --scrape-interval "15s"
704
+
705
+ # Remove monitoring target
706
+ k8s-helper remove-prometheus-target my-app-metrics --namespace monitoring
707
+
708
+ # Remove target without confirmation
709
+ k8s-helper remove-prometheus-target my-app-metrics --force
710
+ ```
711
+
607
712
  ### Monitoring and Events
608
713
 
609
714
  ```bash
@@ -0,0 +1,11 @@
1
+ k8s_helper/__init__.py,sha256=XDUF1icyJlQZbTC8B1N4sI8nxUs9X9nJO2EOHzVVq4E,2666
2
+ k8s_helper/cli.py,sha256=ngXnZ-6EaTm9hCViLPOLZya4HtFDsqpPbLYnOBEfQmA,79400
3
+ k8s_helper/config.py,sha256=P7YdfyvCHprrNs2J9DRb3RrClylfTTh5hfTtDzLug0A,6867
4
+ k8s_helper/core.py,sha256=Zhpcpo_CSzYtBAkQyaHxkRETIbZbE2Ll_E8tW2lUgZ8,109549
5
+ k8s_helper/utils.py,sha256=wYgTd5ktyuI-EiVcfW7FrxA7MzXY5odrEKQgmMVdueY,9496
6
+ k8s_helper_cli-0.4.0.dist-info/licenses/LICENSE,sha256=tXPvVl3gLVc6e0qCEoLH9KjeA7z4JVL78UybpvGtBCw,1096
7
+ k8s_helper_cli-0.4.0.dist-info/METADATA,sha256=CwdjQe6YLKK4cTqf1MKc-69Fxwo77p6-fNq2XVWM1gM,30789
8
+ k8s_helper_cli-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ k8s_helper_cli-0.4.0.dist-info/entry_points.txt,sha256=IoCMWUZ6mn90LwzQzEy5YkWOwvogDdZ6ycqUWAzCFTQ,50
10
+ k8s_helper_cli-0.4.0.dist-info/top_level.txt,sha256=x9A1jflyer-z2cFnkqk5B42juoH2q0fy5hkT9upsTG8,11
11
+ k8s_helper_cli-0.4.0.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- k8s_helper/__init__.py,sha256=DZK903fkZNiY8hFaPHgeufiLxUbdwKXGAMCOixqK_lU,2666
2
- k8s_helper/cli.py,sha256=sOEXL_JMyIyHzOTy0GTg2Qzqs7mUhRSBz6_d8nM9HCg,55992
3
- k8s_helper/config.py,sha256=P7YdfyvCHprrNs2J9DRb3RrClylfTTh5hfTtDzLug0A,6867
4
- k8s_helper/core.py,sha256=-KA0GZeWWm0VDKX-Q3POr6H7kpM8swTUSDC71z-EniM,70406
5
- k8s_helper/utils.py,sha256=wYgTd5ktyuI-EiVcfW7FrxA7MzXY5odrEKQgmMVdueY,9496
6
- k8s_helper_cli-0.3.0.dist-info/licenses/LICENSE,sha256=tXPvVl3gLVc6e0qCEoLH9KjeA7z4JVL78UybpvGtBCw,1096
7
- k8s_helper_cli-0.3.0.dist-info/METADATA,sha256=Ln5tPM4HkYtD7Z44XuY0a_BKTABCdm6vhAMNU3-lge0,27349
8
- k8s_helper_cli-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- k8s_helper_cli-0.3.0.dist-info/entry_points.txt,sha256=IoCMWUZ6mn90LwzQzEy5YkWOwvogDdZ6ycqUWAzCFTQ,50
10
- k8s_helper_cli-0.3.0.dist-info/top_level.txt,sha256=x9A1jflyer-z2cFnkqk5B42juoH2q0fy5hkT9upsTG8,11
11
- k8s_helper_cli-0.3.0.dist-info/RECORD,,