[TOC]
Here are three key DevOps KPIs:
- Deployment Frequency (DF)
- Mean Time to Recovery (MTTR)
- Change Failure Rate (CFR)
Infrastructure as Code(IaC) is a method of managing and provisioning IT infrastructure using code, rather than manual configuration.
Benefit:
- Consistency: Same configuration every time, reducing errors.
- Automation: Fast setup and tear-down of environments.
- Scalability: Easily scale infrastructure up or down with code.
- Versioning: Track and roll back changes using Git or other version control.
-
Horizontal Pod Autoscaling or HPA
Horizontal Pod Autoscaler automatically scales the number of Pods in a Deployment, ReplicaSet, or StatefulSet based on observed CPU utilization, memory usage, or custom metrics.
-
Vertical Pod Autoscaling or VPA
Based on application requirements, VPA adjusts the resources allocated to individual pods, such as CPU and memory. This approach dynamically changes pod resource settings based on workload metrics.
-
Cluster Auto Scaling
The Cluster Autoscaler automatically adjusts the number of nodes in a Kubernetes cluster. It interacts with the cloud provider to add or remove nodes based on requirements. This is important to maintain a balanced cluster.
-
Predictive Auto Scaling
Predictive Autoscaling uses machine learning to forecast future resource requirements. It helps Kubernetes adjust resources by anticipating workload demands.
By combining EBS volumes, PVCs, and a custom operator, Airbnb has found a way to safely run a distributed database on Kubernetes. This allows them to benefit from Kubernetes automation without sacrificing the consistency or availability that a database requires.
This setup brings several benefits:
- Fault isolation
- Reduced blast radius of deployments
- Canary deployments for safety
- Overprovisioning for resilience
-
Use official images
This ensures security, reliability, and regular updates.
-
Use a specific image version
The default latest tag is unpredictable and causes unexpected behavior.
-
Multi-Stage builds
Reduces final image size by excluding build tools and dependencies.
-
Use .dockerignore
Excludes unnecessary files, speeds up builds, and reduces image size.
-
Use the least privileged user
Enhances security by limiting container privileges.
-
Use environment variables
Increases flexibility and portability across different environments.
-
Order matters for caching
Order your steps from least to most frequently changing to optimize caching.
-
Label your images
It improves organization and helps with image management.
-
Scan images
Find security vulnerabilities before they become bigger problems.
[1] System Design CheatSheet for Interview
[2] A Crash Course in Kubernetes
[3] EP191: Virtualization vs. Containerization
[4] EP178: The Lifecycle of a Kubernetes Pod
[5] Top 8 must-know Docker concepts



















