Kubernetes Series - Part 1: Core Fundamentals
/ 3 min read
Series Navigation
- Part 1: Core Fundamentals (Current)
- Part 2: Workload Management
- Part 3: Networking Essentials
- Part 4: Storage and Persistence
- Part 5: Configuration and Secrets
- Part 6: Security and Access Control
- Part 7: Observability
- Part 8: Advanced Patterns
- Part 9: Production Best Practices
Introduction
After spending five years managing production Kubernetes clusters across different cloud providers, I’ve learned that mastering the fundamentals is crucial for success. In this first part of our series, I’ll share the essential concepts and practical insights I’ve gained from real-world experience.
Core Architecture
Control Plane Components
In my experience managing multiple production clusters, these components form the brain of Kubernetes:
apiVersion: v1kind: ComponentStatusitems:- conditions: - status: "True" type: Healthy metadata: name: kube-apiserver- conditions: - status: "True" type: Healthy metadata: name: etcd-0-
API Server: The gateway for all cluster operations
- Pro tip: Always use
kubectl proxyfor local development to avoid certificate issues - Set proper resource limits to prevent API server overload
- Pro tip: Always use
-
etcd: The cluster’s source of truth
- Real-world lesson: Always maintain etcd backups
- I once saved a production cluster thanks to our regular etcd snapshots
-
Controller Manager: Ensures desired state
- Monitor its CPU usage - high utilization often indicates cluster issues
- Set appropriate QPS and burst limits based on cluster size
-
Scheduler: Places workloads intelligently
- Custom scheduling policies can significantly improve resource utilization
- We reduced costs by 30% with proper node affinity rules
Node Architecture
Each node in your cluster runs these essential components:
apiVersion: v1kind: Nodemetadata: name: worker-1status: conditions: - type: Ready status: "True" capacity: cpu: "4" memory: "8Gi"-
kubelet: The node agent
- Monitor its logs for troubleshooting node issues
- Set appropriate garbage collection thresholds
-
Container Runtime: Usually containerd
- Pro tip: Use crictl for debugging container issues
- Regular garbage collection prevents disk space issues
-
kube-proxy: Network rules manager
- IPVS mode offers better performance at scale
- Monitor iptables rules count in large clusters
Basic Operations
Here are some essential commands I use daily:
# Get cluster health statuskubectl get componentstatuses
# Check node resourceskubectl describe node <node-name>
# View system podskubectl get pods -n kube-system
# Check eventskubectl get events --sort-by='.lastTimestamp'Pro Tips from Production
-
Resource Management
- Always set resource requests and limits
- Use namespace resource quotas
apiVersion: v1kind: ResourceQuotametadata:name: compute-quotaspec:hard:requests.cpu: "4"requests.memory: 8Gilimits.cpu: "8"limits.memory: 16Gi -
Namespace Organization
- Use namespaces for logical separation
- Implement network policies per namespace
apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: default-denyspec:podSelector: {}policyTypes:- Ingress- Egress -
Monitoring Basics
- Set up proper logging from day one
- Monitor kubelet and container runtime metrics
Terminal window # Check kubelet metricscurl -k https://localhost:10250/metrics
Common Pitfalls
Through my experience, here are issues I frequently encounter and their solutions:
-
Resource Exhaustion
- Always monitor node resources
- Set up cluster autoscaling
- Use pod disruption budgets
-
Network Issues
- Check kube-proxy logs
- Verify CoreDNS functionality
- Monitor CNI plugin health
-
Certificate Problems
- Regularly rotate certificates
- Monitor certificate expiration
- Use cert-manager for automation
Production Readiness Checklist
✅ Basic Setup
- Multiple master nodes
- Proper network plugin configuration
- Resource quotas per namespace
- Node labels and taints
✅ Security
- RBAC policies
- Network policies
- Pod security policies
- Regular certificate rotation
✅ Monitoring
- Node metrics
- Control plane metrics
- Logging solution
- Alerting rules
Conclusion
Understanding Kubernetes fundamentals is crucial for running production workloads successfully. Through my experience managing clusters at scale, I’ve learned that a solid foundation in these concepts prevents many issues down the line.
Remember:
- Start with proper resource management
- Implement security from day one
- Monitor everything
- Keep your control plane healthy
- Document your configurations
In the next part of this series, we’ll dive into workload management, where I’ll share practical tips for deploying and managing applications in Kubernetes.