# Kubernetes Analysis Examples

## Example 1: Deployment Configuration

**Input:**
```yaml
apiVersion: apps/v1
kind: Deployment
spec:
  replicas: 1
  template:
    spec:
      containers:
      - name: app
        image: myapp:latest
```

**Expected Output:**
Issues: single replica (no HA), :latest tag, no resource limits, no health checks. Improved manifest with 3 replicas, specific version, resource limits, probes.

## Example 2: Service Discovery

**Input:**
```
How does a frontend Pod communicate with a backend Service named 'api' in the same namespace?
```

**Expected Output:**
DNS resolution: `api.default.svc.cluster.local` or just `api`, service provides stable endpoint, load balancing across Pods, example client code.

## Example 3: Scaling Strategy

**Input:**
```
Design autoscaling for a web application with variable traffic patterns.
```

**Expected Output:**
HPA based on CPU/memory and custom metrics, min 2 replicas (HA), max based on capacity, cluster autoscaler, Pod Disruption Budget, monitoring setup.

## Common Use Cases

- Deployment configuration
- Service networking
- Scaling strategies
- Security hardening
- Migration from Docker Compose
