semvec/pypi-packages huggingface dataset:
gke-log-tools 1.0.9
[Protected] GKE Log Management Tools with GCS Archive Access
License: MIT
Requires Python: >=3.8
Keywords: gke, logs, gcs, archive, nfs

"""
# GKE Log Tools

Log management tools for GKE with GCS archive access and signed URL generation.

## Installation

```bash
pip install gke-log-tools
```

## Quick Start

```python
from gke_log_tools import generate_signed_url_for_log, list_archived_logs_for_deployment

# Generate signed URL for archived log
url_result = generate_signed_url_for_log(
    namespace="prod-app",
    deployment_name="app",
    environment="prod",
    log_date="2025-08-15",
    cluster="main-cluster",
    project="my-project"
)

print(f"Download URL: {url_result['signed_url']}")
print(f"Expires in: {url_result['expires_in']}")

# List available archived logs
logs_list = list_archived_logs_for_deployment(
    namespace="prod-app",
    deployment_name="app",
    environment="prod",
    cluster="main-cluster",
    project="my-project"
)

for log in logs_list['log_files']:
    print(f"{log['filename']} - {log['size_mb']} MB")
```

## Features

- Generate signed URLs for GCS archived logs
- List available files from GCS bucket
- Thread-safe credential management
- Automatic token refresh for signing
- Fixes SignatureDoesNotMatch errors

## Usage Examples

### Archived Logs from GCS

```python
from gke_log_tools import generate_signed_url_for_log

result = generate_signed_url_for_log(
    namespace="abcv",
    deployment_name="app",
    environment="prod",
    log_date="2025-08-15",
    cluster="cluster-1",
    project="project-1"
)

if result['success']:
    # Use signed URL to download log
    import requests
    response = requests.get(result['signed_url'])
    log_content = response.text
```

### Recent Logs from NFS

```python
from gke_log_tools import fetch_recent_log_from_nfs_sync

result = fetch_recent_log_from_nfs_sync(
    namespace="prod-app",
    deployment_name="app",
    log_date="2025-12-10",  # Within last 6 days
    cluster="main",
    project="my-project"
)

if result['success']:
    print(f"Log URL: {result['signed_url']}")
```

### List All Archived Logs

```python
from gke_log_tools import list_archived_logs_for_deployment

result = list_archived_logs_for_deployment(
    namespace="prod-app",
    deployment_name="app",
    environment="prod",
    cluster="main",
    project="my-project",
    max_results=100
)

for log in result['log_files']:
    print(f"{log['log_date']}: {log['filename']} ({log['size_mb']} MB)")
```

## Configuration

Environment setup for NFS access:

```bash
# For NFS mappings
export NFS_MAPPINGS_CSV=nfs_mappings.csv
```

NFS mappings CSV format:
```csv
host_url,vm_name,vm_zone,vm_project,nfs_path
www.example.com,nfs-vm-1,us-central1-a,my-project,/mnt/nfs/logs
```

## GCS Bucket Structure

Expected GCS log archive structure:
```
bucket_name/
├── {namespace}/
│   └── {deployment}/
│       └── {environment}/
│           └── logs/
│               ├── file_name.log.2025-08-15
│               ├── file_name.log.2025-08-14
│               └── ...
```

## Requirements

- google-cloud-storage>=2.10.0
- google-auth>=2.23.0

## License

MIT License
"""
gke-deployment-tools 1.0.9
[Protected] [Protected] GKE Deployment Management Tools with K8s Client Pooling
License: MIT
Requires Python: >=3.8
Keywords: gke, kubernetes, deployment, pod, logs

"""
# GKE Deployment Tools

Comprehensive deployment management tools for GKE with connection pooling and token caching.

## Installation

```bash
pip install gke-deployment-tools
```

## Quick Start

```python
from gke_deployment_tools import (
    get_deployment_usage_sync,
    get_deployment_images_sync,
    update_deployment_image_tag_sync
)

# Get deployment resource usage
usage = get_deployment_usage_sync(
    namespace="prod-app",
    cluster="main-cluster",
    project="my-project"
)

# Update deployment image tag
result = update_deployment_image_tag_sync(
    namespace="prod-app",
    deployment_name="ecommerce",
    new_tag="v1.2.3",
    cluster="main-cluster",
    project="my-project"
)
```

## Features

- Deployment resource monitoring (CPU/memory usage)
- Image management and updates with Artifact Registry validation
- Pod operations (logs, directory listing, file search)
- Log search with time range and keyword filtering
- Deployment rollback capabilities
- Connection pooling for performance
- Automatic token refresh
- Thread-safe operations

## Usage Examples

### Resource Monitoring

```python
from gke_deployment_tools import get_deployment_usage_sync

usage = get_deployment_usage_sync("prod-app", "cluster-1", "project-1")
print(f"Deployments: {usage['deployments']}")
```

### Log Operations

```python
from gke_deployment_tools import search_logs_by_timerange_and_keyword_sync

logs = search_logs_by_timerange_and_keyword_sync(
    namespace="prod-app",
    deployment_name="ecommerce",
    file_path="/var/log/server.log",
    from_time="10:00:00",
    to_time="11:00:00",
    keyword="ERROR",
    cluster="cluster-1",
    project="project-1"
)
```

### Deployment Updates

```python
from gke_deployment_tools import update_deployment_image_tag_sync

result = update_deployment_image_tag_sync(
    namespace="prod-app",
    deployment_name="api",
    new_tag="v2.0.0",
    cluster="main",
    project="my-project"
)
```

## Requirements

- kubernetes>=28.1.0
- google-cloud-container>=2.30.0

## License

MIT License
"""