related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks
Kubernetes in Cloud-Native Engineering
Category: cncf
Status: Active
Stars: 121,832
Last Updated: 2026-04-22
Primary Language: Go
Documentation: https://kubernetes.io/docs/
Purpose and Use Cases
Kubernetes is a core component of the cloud-native ecosystem, serving as a container orchestration platform that automates the deployment, scaling, and management of containerized applications.
What Problem Does It Solve?
Manual container orchestration at scale, including scheduling, networking, storage, self-healing, and service discovery. It eliminates the need to manually manage container lifecycles across multiple hosts.
When to Use This Project
Use Kubernetes when you need to manage containerized applications at scale, require self-healing capabilities, need advanced scheduling, or want to leverage the broader cloud-native ecosystem. Not ideal for simple single-service deployments or when you need complete control over the underlying infrastructure.
Key Use Cases
- Microservices orchestration and management
- Batch job scheduling and execution
- Hybrid and multi-cloud deployments
- CI/CD pipeline orchestration
- Machine learning workflow management
- Edge computing deployments
Architecture Design Patterns
Core Components
- API Server: Central REST interface for all cluster communication
- etcd: Distributed key-value store for cluster state
- Scheduler: Assigns pods to nodes based on resource requirements
- Controller Manager: Runs controller processes (node, replication, endpoints, etc.)
- Kubelet: Agent on each node that manages containers
- Kube Proxy: Network proxy and load balancer for service access
- Cloud Controller Manager: Cloud-provider-specific controllers
Component Interactions
- User/Tool → API Server: All operations go through the API server
- Scheduler watches API Server: For unscheduled pods
- Controller Manager watches API Server: For state reconciliation
- Kubelet watches API Server: For pods assigned to its node
- Kubelet → Container Runtime: Creates/manages containers
- API Server → etcd: Persists cluster state
- Kube Proxy → iptables/ipvs: Configures network rules
Data Flow Patterns
- Pod Creation: API Server stores pod spec → Scheduler selects node → Kubelet creates pod
- Service Discovery: Service object created → Kube Proxy updates iptables → DNS updated
- Scaling: ReplicaSet detects mismatch → Creates new pods → Scheduler assigns nodes
- Health Checks: Kubelet performs probes → API Server stores status → Controller-manager responds
- Networking: Pod created → CNI plugin configures network → Pod gets IP → Service endpoint updated
Design Principles
- Declarative API: Resources defined by desired state
- Reconciliation: Controllers continuously reconcile state
- RESTful Interface: All operations through HTTP API
- Extensibility: Custom resources, controllers, and admission webhooks
- Decentralized: No single point of failure in control plane
- Self-Healing: Automatic recovery from failures
Integration Approaches
Integration with Other CNCF Projects
- Containerd: Default container runtime (CRI implementation)
- CNI: Standard for pod networking
- Prometheus: Metrics collection and monitoring
- etcd: Backend store for cluster state
- Helm: Application deployment tool
- Istio/Envoy: Service mesh integration
- Tekton: CI/CD pipeline execution
- CoreDNS: Default DNS server
API Patterns
- RESTful API: HTTP-based operations
- CRUD Operations: Create, Read, Update, Delete
- Watch API: Real-time event streaming
- Subresources: Nested resource operations
- CRDs: Custom Resource Definitions for extensions
- Webhooks: Admission control and configuration
- API Groups: Versioned APIs (v1, apps/v1, etc.)
Configuration Patterns
- YAML Manifests: Resource definitions
- ConfigMaps: Non-sensitive configuration
- Secrets: Sensitive data storage
- Helm Values: Chart configuration
- kubeconfig: Client configuration
- Kubelet Config: Node-level configuration
Extension Mechanisms
- CRDs: Define custom resources
- Admission Webhooks: Validate/modify requests
- Custom Controllers: Operator pattern
- CNI Plugins: Network implementations
- CRI Implementations: Container runtimes
- CSI Drivers: Storage providers
- cloud-controller-manager: Cloud-specific controllers
Common Pitfalls and How to Avoid Them
Misconfigurations
- Resource Limits: Not setting CPU/memory limits
- Security Context: Running as root
- Image Tags: Using :latest or mutable tags
- RBAC: Overly permissive roles
- Network Policies: Not enforcing network isolation
- Secrets: Storing secrets in ConfigMaps
- Persistent Volumes: Not setting access modes correctly
- Health Checks: Missing or incorrect probes
Performance Issues
- API Server Load: Too many watch connections
- etcd Performance: High latency or throughput issues
- Scheduler Bottlenecks: Complex scheduling requirements
- Kubelet CPU Usage: High resource consumption
- Network Overhead: CNI plugin performance
- Pod Startup Time: Slow image pulls or resource constraints
- Controller Manager: High reconciliation overhead
Operational Challenges
- Version Upgrades: In-place upgrades and compatibility
- Backup and Recovery: etcd backup strategies
- Cluster Federation: Multi-cluster management
- Scaling: Controlling cluster growth
- Monitoring: Comprehensive observability
- Cost Management: Resource optimization
- Security Hardening: CIS benchmarks compliance
- Migration: Legacy application migration
Security Pitfalls
- RBAC: Overly permissive cluster-admin roles
- Network Policies: Missing network isolation
- Pod Security: Running as root or privileged
- Secrets Management: Secrets in environment variables
- Image Security: Using untrusted images
- API Server Exposure: Unauthenticated access
- Control Plane Security: Missing authentication
- Service Account Tokens: Overly broad permissions
Coding Practices
Idiomatic Configuration
- Declarative YAML: Desired state configuration
- Immutable Resources: Create, update, delete
- Labels and Annotations: Metadata for organization
- Namespaces: Resource isolation
- Kustomize: Config overlays
- Helm: Template-based configuration
- Validating Webhooks: Config validation
API Usage Patterns
- Kubectl: Command-line interface
- Client Libraries: Official and community clients
- Kustomize: Configuration management
- CRD Operations: Custom resource management
- Watch API: Real-time updates
- Subresource Operations: Specialized operations
Observability Best Practices
- Metrics: Kubelet, API server, etcd metrics
- Logging: Container logs to centralized systems
- Tracing: OpenTelemetry integration
- Audit Logging: K8s audit log
- Events: Resource events monitoring
- Dashboard: Grafana and Kubernetes Dashboard
Testing Strategies
- Unit Tests: Component-level tests
- Integration Tests: API and controller tests
- End-to-End Tests: Full cluster tests
- Conformance Tests: Kubernetes compatibility
- Load Tests: Cluster scalability
- Security Tests: Vulnerability scanning
Development Workflow
- Development: minikube, kind, k3s for local
- Testing: kubectl apply, debug pods
- Debugging: kubectl exec, logs, describe
- Deployment: Helm, kustomize, GitOps
- CI/CD: Tekton, GitLab CI, GitHub Actions
- Tools: kustomize, kubectl, k9s, Lens
Fundamentals
Essential Concepts
- Cluster: Set of nodes running containerized applications
- Node: Worker machine in the cluster
- Pod: Smallest deployable unit, one or more containers
- Namespace: Logical partition of cluster resources
- Deployment: Manages ReplicaSets for pod updates
- Service: Abstraction for pod networking
- ConfigMap/Secret: Configuration and sensitive data
- Volume: Storage attachment to pods
- StatefulSet: Manages stateful applications
- DaemonSet: Runs pods on all nodes
- Job/CronJob: Batch processing
- Ingress: HTTP routing to services
Terminology Glossary
- APIServer: Kubernetes API server
- Controller Manager: Runs controllers for cluster state
- Scheduler: Assigns pods to nodes
- Kubelet: Node agent managing containers
- Kube Proxy: Network proxy on nodes
- etcd: Distributed key-value store
- kubeconfig: Client configuration file
- Kubelet Config: Node-level configuration
- CRD: Custom Resource Definition
- Webhook: Admission control endpoint
Data Models and Types
- Object Meta: Metadata for resources
- Object Spec: Desired state specification
- Object Status: Current state
- Pod Spec: Container configuration
- Service Spec: Service configuration
- Deployment Spec: Deployment configuration
- Volume: Storage configuration
- Container: Container definition
- Env: Environment variables
- Resource Requirements: CPU/memory limits
Lifecycle Management
- Pod Lifecycle: Pending → Running → Succeeded/Failed
- Container Lifecycle: PreStart → Running → PreStop
- Resource Lifecycle: Create → Update → Delete
- Controller Lifecycle: Reconcile loop
- Health Check Lifecycle: Startup → Liveness → Readiness
- Upgrade Lifecycle: Rolling update, rollback
- Scale Lifecycle: Horizontal pod autoscaler
- Cordon and Drain: Node maintenance lifecycle
State Management
- etcd: Cluster state persistence
- Object Status: Current state in API
- Replica Management: Desired vs actual replicas
- Volume State: Persistent volume claims
- ConfigMap/Secret: Configuration state
- Network State: Service endpoints
- Controller State: Resource reconciliation
Scaling and Deployment Patterns
Horizontal Scaling
- Pod Scaling: Horizontal Pod Autoscaler (HPA)
- Cluster Scaling: Node pool scaling
- Control Plane: API server replicas
- Controller Scaling: Replica count for controllers
- Load Balancing: Service load balancing
- Ingress Scaling: Ingress controller scaling
- Stateful Workloads: StatefulSet scaling considerations
High Availability
- Control Plane HA: Multiple API servers, etcd cluster
- etcd Cluster: Odd number of nodes (3, 5, 7)
- Node Redundancy: Multiple worker nodes
- Pod Disruption Budgets: Controlled disruptions
- Multi-Zone Deployments: Spread across availability zones
- Storage HA: Persistent volumes with replication
- Network HA: CNI plugin HA configuration
Production Deployments
- Cluster Setup: kubeadm, kops, EKS, GKE, AKS
- Node Configuration: Hardened OS, secure boot
- Control Plane Security: RBAC, authentication, admission controllers
- Network Policy: Enforced network isolation
- Storage Class: Appropriate storage provisioners
- Ingress Controller: Production-grade ingress
- Logging and Monitoring: Centralized logging and metrics
- Backup and Restore: etcd backup strategies
- Security Scanning: Container image scanning
Upgrade Strategies
- Control Plane Upgrade: api-server, scheduler, controller-manager
- Node Upgrade: Rolling node upgrade with cordon/drain
- etcd Upgrade: Cluster member replacement
- Kubernetes Versions: Version skew policy
- Backup Before Upgrade: etcd snapshot
- Rollback Strategy: Version rollback procedure
- Canary Upgrade: Gradual rollout to new version
Resource Management
- CPU/Memory Limits: Appropriate resource requests and limits
- Resource Quotas: Namespace-level resource limits
- Vertical Pod Autoscaler: VPA for automatic resource tuning
- Horizontal Pod Autoscaler: HPA for scaling
- Pod Disruption Budgets: PDB for availability
- Priority Classes: Pod priority and preemption
- Resource Limits Range: Default and maximum limits
Additional Resources
Troubleshooting
Common Issues
Deployment Failures
- Check pod logs for errors
- Verify configuration values
- Ensure network connectivity
Performance Issues
- Monitor resource usage
- Adjust resource limits
- Check for bottlenecks
Configuration Errors
- Validate YAML syntax
- Check required fields
- Verify environment-specific settings
Integration Problems
- Verify API compatibility
- Check dependency versions
- Review integration documentation
Getting Help
- Check official documentation
- Search GitHub issues
- Join community channels
- Review logs and metrics
Content generated automatically. Verify against official documentation before production use.
Examples
StatefulSet with Persistent Volume Claims
# StatefulSet for stateful applications like databases
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql
spec:
serviceName: postgresql
replicas: 3
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: postgres:14
ports:
- containerPort: 5432
name: postgres
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secrets
key: password
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
resources:
requests:
memory: "1Gi"
cpu: "500m"
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: standard
resources:
requests:
storage: 10Gi
ConfigMap and Secret Management
# ConfigMap for application configuration
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
database.host: "postgresql"
database.port: "5432"
log.level: "info"
cache.ttl: "3600"
# Secret for sensitive data
apiVersion: v1
kind: Secret
metadata:
name: app-secrets
type: Opaque
data:
database.password: cG9zdGdyZXMxMjM=
api.key: YWJjZGVmMTIzNDU2
---
related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks
# Using ConfigMap and Secret in Pod
apiVersion: v1
kind: Pod
metadata:
name: app
spec:
containers:
- name: app
image: myapp:latest
env:
- name: DB_HOST
valueFrom:
configMapKeyRef:
name: app-config
key: database.host
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: app-secrets
key: database.password
volumeMounts:
- name: config
mountPath: /etc/config
volumes:
- name: config
configMap:
name: app-config
NetworkPolicy for Service Isolation
# NetworkPolicy to restrict traffic to specific pods
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: frontend-network-policy
namespace: production
spec:
podSelector:
matchLabels:
app: frontend
policyTypes:
- Ingress
- Egress
ingress:
# Allow traffic from ingress controller
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
ports:
- protocol: TCP
port: 80
# Allow traffic from backend pods
- from:
- podSelector:
matchLabels:
app: backend
ports:
- protocol: TCP
port: 8080
egress:
# Allow DNS resolution
- to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
# Allow traffic to backend and database
- to:
- podSelector:
matchLabels:
app: backend
ports:
- protocol: TCP
port: 8080
When to Use
Use this skill when:
- Integrating a CNCF project into Kubernetes infrastructure — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster
- Designing cloud-native architecture — You are selecting and integrating CNCF tools to solve specific infrastructure challenges
- Resolving operational issues — A CNCF component is misbehaving, underperforming, or needs configuration changes
Core Workflow
Assess Requirements — Understand the use case, scale, integration needs, and existing infrastructure. Checkpoint: Document requirements, constraints, and success criteria.
Design Architecture — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. Checkpoint: Verify the architecture addresses all requirements and follows CNCF conventions.
Implement & Configure — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. Checkpoint: Validate all YAML against schema and test in a staging environment.
Deploy & Monitor — Apply manifests to the cluster, verify component health, and confirm observability is working. Checkpoint: Confirm all pods/services are running, probes passing, and metrics/alerts configured.
Constraints
MUST DO
- Include at least one complete working YAML manifest example
- Note when content is auto-generated vs. manually verified
- Reference relevant CNCF project documentation
MUST NOT DO
- Deploy manifests without testing in a staging environment first
- Use deprecated API versions (e.g., apps/v1beta1)
- Omit resource limits and requests in Kubernetes manifests
Live References
These links are resolved at load time — content is fetched and inlined to provide the latest documentation.
1---2name: kubernetes3description: "Kubernetes in Cloud-Native Engineering - Production-Grade Container Scheduling" and Management4license: MIT5---678910 related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks11121314# Kubernetes in Cloud-Native Engineering1516**Category:** cncf 17**Status:** Active 18**Stars:** 121,832 19**Last Updated:** 2026-04-22 20**Primary Language:** Go 21**Documentation:** [https://kubernetes.io/docs/](https://kubernetes.io/docs/) 2223---2425## Purpose and Use Cases2627Kubernetes is a core component of the cloud-native ecosystem, serving as a container orchestration platform that automates the deployment, scaling, and management of containerized applications.2829### What Problem Does It Solve?3031Manual container orchestration at scale, including scheduling, networking, storage, self-healing, and service discovery. It eliminates the need to manually manage container lifecycles across multiple hosts.3233### When to Use This Project3435Use Kubernetes when you need to manage containerized applications at scale, require self-healing capabilities, need advanced scheduling, or want to leverage the broader cloud-native ecosystem. Not ideal for simple single-service deployments or when you need complete control over the underlying infrastructure.3637### Key Use Cases383940- Microservices orchestration and management41- Batch job scheduling and execution42- Hybrid and multi-cloud deployments43- CI/CD pipeline orchestration44- Machine learning workflow management45- Edge computing deployments464748---4950## Architecture Design Patterns5152### Core Components535455- **API Server**: Central REST interface for all cluster communication56- **etcd**: Distributed key-value store for cluster state57- **Scheduler**: Assigns pods to nodes based on resource requirements58- **Controller Manager**: Runs controller processes (node, replication, endpoints, etc.)59- **Kubelet**: Agent on each node that manages containers60- **Kube Proxy**: Network proxy and load balancer for service access61- **Cloud Controller Manager**: Cloud-provider-specific controllers626364### Component Interactions6566671. **User/Tool → API Server**: All operations go through the API server682. **Scheduler watches API Server**: For unscheduled pods693. **Controller Manager watches API Server**: For state reconciliation704. **Kubelet watches API Server**: For pods assigned to its node715. **Kubelet → Container Runtime**: Creates/manages containers726. **API Server → etcd**: Persists cluster state737. **Kube Proxy → iptables/ipvs**: Configures network rules747576### Data Flow Patterns7778791. **Pod Creation**: API Server stores pod spec → Scheduler selects node → Kubelet creates pod802. **Service Discovery**: Service object created → Kube Proxy updates iptables → DNS updated813. **Scaling**: ReplicaSet detects mismatch → Creates new pods → Scheduler assigns nodes824. **Health Checks**: Kubelet performs probes → API Server stores status → Controller-manager responds835. **Networking**: Pod created → CNI plugin configures network → Pod gets IP → Service endpoint updated848586### Design Principles878889- **Declarative API**: Resources defined by desired state90- **Reconciliation**: Controllers continuously reconcile state91- **RESTful Interface**: All operations through HTTP API92- **Extensibility**: Custom resources, controllers, and admission webhooks93- **Decentralized**: No single point of failure in control plane94- **Self-Healing**: Automatic recovery from failures959697---9899## Integration Approaches100101### Integration with Other CNCF Projects102103104- **Containerd**: Default container runtime (CRI implementation)105- **CNI**: Standard for pod networking106- **Prometheus**: Metrics collection and monitoring107- **etcd**: Backend store for cluster state108- **Helm**: Application deployment tool109- **Istio/Envoy**: Service mesh integration110- **Tekton**: CI/CD pipeline execution111- **CoreDNS**: Default DNS server112113114### API Patterns115116117- **RESTful API**: HTTP-based operations118- **CRUD Operations**: Create, Read, Update, Delete119- **Watch API**: Real-time event streaming120- **Subresources**: Nested resource operations121- **CRDs**: Custom Resource Definitions for extensions122- **Webhooks**: Admission control and configuration123- **API Groups**: Versioned APIs (v1, apps/v1, etc.)124125126### Configuration Patterns127128129- **YAML Manifests**: Resource definitions130- **ConfigMaps**: Non-sensitive configuration131- **Secrets**: Sensitive data storage132- **Helm Values**: Chart configuration133- **kubeconfig**: Client configuration134- **Kubelet Config**: Node-level configuration135136137### Extension Mechanisms138139140- **CRDs**: Define custom resources141- **Admission Webhooks**: Validate/modify requests142- **Custom Controllers**: Operator pattern143- **CNI Plugins**: Network implementations144- **CRI Implementations**: Container runtimes145- **CSI Drivers**: Storage providers146- **cloud-controller-manager**: Cloud-specific controllers147148149---150151## Common Pitfalls and How to Avoid Them152153### Misconfigurations154155156- **Resource Limits**: Not setting CPU/memory limits157- **Security Context**: Running as root158- **Image Tags**: Using :latest or mutable tags159- **RBAC**: Overly permissive roles160- **Network Policies**: Not enforcing network isolation161- **Secrets**: Storing secrets in ConfigMaps162- **Persistent Volumes**: Not setting access modes correctly163- **Health Checks**: Missing or incorrect probes164165166### Performance Issues167168169- **API Server Load**: Too many watch connections170- **etcd Performance**: High latency or throughput issues171- **Scheduler Bottlenecks**: Complex scheduling requirements172- **Kubelet CPU Usage**: High resource consumption173- **Network Overhead**: CNI plugin performance174- **Pod Startup Time**: Slow image pulls or resource constraints175- **Controller Manager**: High reconciliation overhead176177178### Operational Challenges179180181- **Version Upgrades**: In-place upgrades and compatibility182- **Backup and Recovery**: etcd backup strategies183- **Cluster Federation**: Multi-cluster management184- **Scaling**: Controlling cluster growth185- **Monitoring**: Comprehensive observability186- **Cost Management**: Resource optimization187- **Security Hardening**: CIS benchmarks compliance188- **Migration**: Legacy application migration189190191### Security Pitfalls192193194- **RBAC**: Overly permissive cluster-admin roles195- **Network Policies**: Missing network isolation196- **Pod Security**: Running as root or privileged197- **Secrets Management**: Secrets in environment variables198- **Image Security**: Using untrusted images199- **API Server Exposure**: Unauthenticated access200- **Control Plane Security**: Missing authentication201- **Service Account Tokens**: Overly broad permissions202203204---205206## Coding Practices207208### Idiomatic Configuration209210211- **Declarative YAML**: Desired state configuration212- **Immutable Resources**: Create, update, delete213- **Labels and Annotations**: Metadata for organization214- **Namespaces**: Resource isolation215- **Kustomize**: Config overlays216- **Helm**: Template-based configuration217- **Validating Webhooks**: Config validation218219220### API Usage Patterns221222223- **Kubectl**: Command-line interface224- **Client Libraries**: Official and community clients225- **Kustomize**: Configuration management226- **CRD Operations**: Custom resource management227- **Watch API**: Real-time updates228- **Subresource Operations**: Specialized operations229230231### Observability Best Practices232233234- **Metrics**: Kubelet, API server, etcd metrics235- **Logging**: Container logs to centralized systems236- **Tracing**: OpenTelemetry integration237- **Audit Logging**: K8s audit log238- **Events**: Resource events monitoring239- **Dashboard**: Grafana and Kubernetes Dashboard240241242### Testing Strategies243244245- **Unit Tests**: Component-level tests246- **Integration Tests**: API and controller tests247- **End-to-End Tests**: Full cluster tests248- **Conformance Tests**: Kubernetes compatibility249- **Load Tests**: Cluster scalability250- **Security Tests**: Vulnerability scanning251252253### Development Workflow254255256- **Development**: minikube, kind, k3s for local257- **Testing**: kubectl apply, debug pods258- **Debugging**: kubectl exec, logs, describe259- **Deployment**: Helm, kustomize, GitOps260- **CI/CD**: Tekton, GitLab CI, GitHub Actions261- **Tools**: kustomize, kubectl, k9s, Lens262263264---265266## Fundamentals267268### Essential Concepts269270271- **Cluster**: Set of nodes running containerized applications272- **Node**: Worker machine in the cluster273- **Pod**: Smallest deployable unit, one or more containers274- **Namespace**: Logical partition of cluster resources275- **Deployment**: Manages ReplicaSets for pod updates276- **Service**: Abstraction for pod networking277- **ConfigMap/Secret**: Configuration and sensitive data278- **Volume**: Storage attachment to pods279- **StatefulSet**: Manages stateful applications280- **DaemonSet**: Runs pods on all nodes281- **Job/CronJob**: Batch processing282- **Ingress**: HTTP routing to services283284285### Terminology Glossary286287288- **APIServer**: Kubernetes API server289- **Controller Manager**: Runs controllers for cluster state290- **Scheduler**: Assigns pods to nodes291- **Kubelet**: Node agent managing containers292- **Kube Proxy**: Network proxy on nodes293- **etcd**: Distributed key-value store294- **kubeconfig**: Client configuration file295- **Kubelet Config**: Node-level configuration296- **CRD**: Custom Resource Definition297- **Webhook**: Admission control endpoint298299300### Data Models and Types301302303- **Object Meta**: Metadata for resources304- **Object Spec**: Desired state specification305- **Object Status**: Current state306- **Pod Spec**: Container configuration307- **Service Spec**: Service configuration308- **Deployment Spec**: Deployment configuration309- **Volume**: Storage configuration310- **Container**: Container definition311- **Env**: Environment variables312- **Resource Requirements**: CPU/memory limits313314315### Lifecycle Management316317318- **Pod Lifecycle**: Pending → Running → Succeeded/Failed319- **Container Lifecycle**: PreStart → Running → PreStop320- **Resource Lifecycle**: Create → Update → Delete321- **Controller Lifecycle**: Reconcile loop322- **Health Check Lifecycle**: Startup → Liveness → Readiness323- **Upgrade Lifecycle**: Rolling update, rollback324- **Scale Lifecycle**: Horizontal pod autoscaler325- **Cordon and Drain**: Node maintenance lifecycle326327328### State Management329330331- **etcd**: Cluster state persistence332- **Object Status**: Current state in API333- **Replica Management**: Desired vs actual replicas334- **Volume State**: Persistent volume claims335- **ConfigMap/Secret**: Configuration state336- **Network State**: Service endpoints337- **Controller State**: Resource reconciliation338339340---341342## Scaling and Deployment Patterns343344### Horizontal Scaling345346347- **Pod Scaling**: Horizontal Pod Autoscaler (HPA)348- **Cluster Scaling**: Node pool scaling349- **Control Plane**: API server replicas350- **Controller Scaling**: Replica count for controllers351- **Load Balancing**: Service load balancing352- **Ingress Scaling**: Ingress controller scaling353- **Stateful Workloads**: StatefulSet scaling considerations354355356### High Availability357358359- **Control Plane HA**: Multiple API servers, etcd cluster360- **etcd Cluster**: Odd number of nodes (3, 5, 7)361- **Node Redundancy**: Multiple worker nodes362- **Pod Disruption Budgets**: Controlled disruptions363- **Multi-Zone Deployments**: Spread across availability zones364- **Storage HA**: Persistent volumes with replication365- **Network HA**: CNI plugin HA configuration366367368### Production Deployments369370371- **Cluster Setup**: kubeadm, kops, EKS, GKE, AKS372- **Node Configuration**: Hardened OS, secure boot373- **Control Plane Security**: RBAC, authentication, admission controllers374- **Network Policy**: Enforced network isolation375- **Storage Class**: Appropriate storage provisioners376- **Ingress Controller**: Production-grade ingress377- **Logging and Monitoring**: Centralized logging and metrics378- **Backup and Restore**: etcd backup strategies379- **Security Scanning**: Container image scanning380381382### Upgrade Strategies383384385- **Control Plane Upgrade**: api-server, scheduler, controller-manager386- **Node Upgrade**: Rolling node upgrade with cordon/drain387- **etcd Upgrade**: Cluster member replacement388- **Kubernetes Versions**: Version skew policy389- **Backup Before Upgrade**: etcd snapshot390- **Rollback Strategy**: Version rollback procedure391- **Canary Upgrade**: Gradual rollout to new version392393394### Resource Management395396397- **CPU/Memory Limits**: Appropriate resource requests and limits398- **Resource Quotas**: Namespace-level resource limits399- **Vertical Pod Autoscaler**: VPA for automatic resource tuning400- **Horizontal Pod Autoscaler**: HPA for scaling401- **Pod Disruption Budgets**: PDB for availability402- **Priority Classes**: Pod priority and preemption403- **Resource Limits Range**: Default and maximum limits404405406---407408## Additional Resources409410- **Official Documentation:** [https://kubernetes.io/docs/](https://kubernetes.io/docs/)411- **GitHub Repository:** [github.com/kubernetes/kubernetes](https://github.com/kubernetes/kubernetes)412- **CNCF Project Page:** [cncf.io/projects/kubernetes/](https://www.cncf.io/projects/kubernetes/)413- **Community:** Check the GitHub repository for community channels414- **Versioning:** Refer to project's release notes for version-specific features415416---417418## Troubleshooting419420### Common Issues4214221. **Deployment Failures**423 - Check pod logs for errors424 - Verify configuration values425 - Ensure network connectivity4264272. **Performance Issues**428 - Monitor resource usage429 - Adjust resource limits430 - Check for bottlenecks4314323. **Configuration Errors**433 - Validate YAML syntax434 - Check required fields435 - Verify environment-specific settings4364374. **Integration Problems**438 - Verify API compatibility439 - Check dependency versions440 - Review integration documentation441442### Getting Help443444- Check official documentation445- Search GitHub issues446- Join community channels447- Review logs and metrics448*Content generated automatically. Verify against official documentation before production use.*449450## Examples451452### StatefulSet with Persistent Volume Claims453454455```yaml456# StatefulSet for stateful applications like databases457apiVersion: apps/v1458kind: StatefulSet459metadata:460 name: postgresql461spec:462 serviceName: postgresql463 replicas: 3464 selector:465 matchLabels:466 app: postgresql467 template:468 metadata:469 labels:470 app: postgresql471 spec:472 containers:473 - name: postgresql474 image: postgres:14475 ports:476 - containerPort: 5432477 name: postgres478 env:479 - name: POSTGRES_PASSWORD480 valueFrom:481 secretKeyRef:482 name: postgres-secrets483 key: password484 volumeMounts:485 - name: data486 mountPath: /var/lib/postgresql/data487 resources:488 requests:489 memory: "1Gi"490 cpu: "500m"491 volumeClaimTemplates:492 - metadata:493 name: data494 spec:495 accessModes: ["ReadWriteOnce"]496 storageClassName: standard497 resources:498 requests:499 storage: 10Gi500```501502### ConfigMap and Secret Management503504505```yaml506# ConfigMap for application configuration507apiVersion: v1508kind: ConfigMap509metadata:510 name: app-config511data:512 database.host: "postgresql"513 database.port: "5432"514 log.level: "info"515 cache.ttl: "3600"516517# Secret for sensitive data518apiVersion: v1519kind: Secret520metadata:521 name: app-secrets522type: Opaque523data:524 database.password: cG9zdGdyZXMxMjM=525 api.key: YWJjZGVmMTIzNDU2526---527 related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks528# Using ConfigMap and Secret in Pod529apiVersion: v1530kind: Pod531metadata:532 name: app533spec:534 containers:535 - name: app536 image: myapp:latest537 env:538 - name: DB_HOST539 valueFrom:540 configMapKeyRef:541 name: app-config542 key: database.host543 - name: DB_PASSWORD544 valueFrom:545 secretKeyRef:546 name: app-secrets547 key: database.password548 volumeMounts:549 - name: config550 mountPath: /etc/config551 volumes:552 - name: config553 configMap:554 name: app-config555```556557### NetworkPolicy for Service Isolation558559560```yaml561# NetworkPolicy to restrict traffic to specific pods562apiVersion: networking.k8s.io/v1563kind: NetworkPolicy564metadata:565 name: frontend-network-policy566 namespace: production567spec:568 podSelector:569 matchLabels:570 app: frontend571 policyTypes:572 - Ingress573 - Egress574 ingress:575 # Allow traffic from ingress controller576 - from:577 - namespaceSelector:578 matchLabels:579 name: ingress-nginx580 ports:581 - protocol: TCP582 port: 80583 # Allow traffic from backend pods584 - from:585 - podSelector:586 matchLabels:587 app: backend588 ports:589 - protocol: TCP590 port: 8080591 egress:592 # Allow DNS resolution593 - to:594 - namespaceSelector: {}595 podSelector:596 matchLabels:597 k8s-app: kube-dns598 ports:599 - protocol: UDP600 port: 53601 # Allow traffic to backend and database602 - to:603 - podSelector:604 matchLabels:605 app: backend606 ports:607 - protocol: TCP608 port: 8080609```610611---612613## When to Use614615Use this skill when:616617- **Integrating a CNCF project into Kubernetes infrastructure** — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster618- **Designing cloud-native architecture** — You are selecting and integrating CNCF tools to solve specific infrastructure challenges619- **Resolving operational issues** — A CNCF component is misbehaving, underperforming, or needs configuration changes620---621622## Core Workflow6236241. **Assess Requirements** — Understand the use case, scale, integration needs, and existing infrastructure. **Checkpoint:** Document requirements, constraints, and success criteria.6256262. **Design Architecture** — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. **Checkpoint:** Verify the architecture addresses all requirements and follows CNCF conventions.6276283. **Implement & Configure** — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. **Checkpoint:** Validate all YAML against schema and test in a staging environment.6296304. **Deploy & Monitor** — Apply manifests to the cluster, verify component health, and confirm observability is working. **Checkpoint:** Confirm all pods/services are running, probes passing, and metrics/alerts configured.631632---633634## Constraints635636### MUST DO637- Include at least one complete working YAML manifest example638- Note when content is auto-generated vs. manually verified639- Reference relevant CNCF project documentation640641### MUST NOT DO642- Deploy manifests without testing in a staging environment first643- Use deprecated API versions (e.g., apps/v1beta1)644- Omit resource limits and requests in Kubernetes manifests645646---647648## Live References649650> **These links are resolved at load time** — content is fetched and inlined to provide the latest documentation.651652- [Kubernetes API Reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/)653- [Kubernetes Concepts Overview](https://kubernetes.io/docs/concepts/)654- [Kubernetes Tasks - Debug](https://kubernetes.io/docs/tasks/debug/)655- [Kubernetes RBAC Reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)656- [Kubernetes Networking](https://kubernetes.io/docs/concepts/services-networking/)657- [Kubernetes Storage](https://kubernetes.io/docs/concepts/storage/)658- [Kubernetes Security Best Practices](https://kubernetes.io/docs/concepts/security/overview/)