How xorps/kube2iam works
Main Components Identification
a. Core Components:
• kube2iam DaemonSet (runs on each worker node)
• Kubernetes API Server
• AWS EC2 Metadata API
• AWS STS (Security Token Service)
• AWS IAM Roles
b. Supporting Components:
• iptables rules
• Pod annotations
• Namespace restrictions
• Metrics endpoint
• Health checks
Specific Elements
┌─ Worker Node ──────────────────┐
• ┌─ kube2iam pod ─────────────┐ │
• Host Network Mode │ │
• iptables rules │ │
• Metrics endpoint │ │
• ┘ │
• ┌─ Application Pods ──────────┐ │
• IAM Role Annotations │ │
• ┘ │
• ┘
b. Authentication Flow Section:
┌─ Authentication Flow ───────────┐
• 1. Pod requests credentials │
• 2. kube2iam intercepts request │
• 3. Validates annotations │
• 4. Assumes IAM role │
• 5. Returns temp credentials │
• ┘
Important Interactions
• iptables redirection of metadata API requests (169.254.169.254)
• Role assumption process through AWS STS
• Namespace restriction validation
• Metrics collection path
Technical Details
• Port numbers (8181 for main service)
• Network interfaces (docker0, etc.)
• Annotation formats
• IAM role ARN patterns
Implementation Notes
• Rectangles for services
• Hexagons for AWS services
• Circles for endpoints
• Diamonds for decision points
• AWS components (orange)
• Kubernetes components (blue)
• Network components (green)
• Security components (red)