Kubernetes (k8s)¶
Kubernetes (often abbreviated as k8s) is a portable, extensible, open-source platform used to manage containerized workloads and services.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md] It facilitates declarative configuration and automation for distributed systems, providing a framework that supports scaling, failover, deployment, and monitoring.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md]
The name originates from the Greek word for "helmsman" or "pilot".^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md] It was originally designed by Google engineers and announced in 2014; v1.0 was released on July 21, 2015.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md] The abbreviation k8s is derived from the count of eight letters between the 'k' and the 's'.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md] It is currently maintained by the Cloud Native Computing Foundation (CNCF), which Google helped form in collaboration with the Linux Foundation.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md]
Evolution of Deployment¶
To understand the necessity of Kubernetes, it is helpful to look at the evolution of application deployment strategies:
- Traditional Era: Applications ran directly on physical servers. This led to resource allocation issues where one application could consume most resources, starving others. To solve this, companies ran applications on separate physical servers, leading to high maintenance costs and underutilized resources.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md]
- Virtualization Era: Virtual Machines (VMs) allowed multiple isolated systems on a single physical server. While this improved resource utilization and scalability, VMs are heavy as each requires a full operating system.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md]
- Container Era: Containers are similar to VMs but have looser isolation properties, sharing the host OS while maintaining separate user spaces. This lightweight approach allows for rapid startup, high resource density, and consistency across development, testing, and production environments.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md]
Core Capabilities¶
Kubernetes addresses the complexity of managing containerized applications at scale. It provides a framework for running distributed systems resiliently, including:
- Service Discovery and Load Balancing: Kubernetes can expose a container using the DNS name or their own IP address.
- Storage Orchestration: Automatically mounts the storage system of your choice.
- Automated Rollouts and Rollbacks: Progressively rolls out changes to your application or its configuration while monitoring application health to ensure it doesn't kill all your instances at the same time.^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md]
- Self-Healing: Restarts containers that fail, replaces and reschedules containers when nodes die, kills containers that don't respond to user-defined health checks, and doesn't advertise them to clients until they are ready to serve.
Key Concepts¶
Pods¶
A Pod is the smallest executable unit of a Kubernetes application.^[400-devops-06-kubernetes-k8s-paas-readme.md] Pods contain one or more containers (such as Docker containers).
Services¶
A Service is an abstraction which defines a logical set of Pods and a policy by which to access them.^[400-devops__06-Kubernetes__k8s.md] Services can be exposed via different types: * ClusterIP: Exposes the Service on a cluster-internal IP. * NodePort: Exposes the Service on each Node’s IP at a static port. * LoadBalancer: Exposes the Service externally using a cloud provider's load balancer.^[400-devops__06-Kubernetes__k8s.md]
Ingress¶
Ingress manages external access to the services in a cluster, typically via HTTP.^[400-devops__06-Kubernetes__k8s.md] Popular implementations include [[NGINX Ingress]].
Networking¶
Kubernetes requires a flat network hierarchy to allow Pods to communicate with each other regardless of the node they are deployed on. Tools like Istio (Service mesh) and [[Kiali]] (visualization) are often used to manage and observe this network complexity.^[400-devops__06-Kubernetes__k8s.md]
Storage¶
Persistent storage in Kubernetes is often managed through PersistentVolumeClaims (PVC).^[400-devops__06-Kubernetes__k8s.md]
Ecosystem and Tools¶
The ecosystem around Kubernetes is vast and supports various operational needs:
- Development & Deployment: Minikube is often used for local development, while Skaffold facilitates the development workflow. For continuous deployment, ArgoCD can automate deployments from Git repositories.^[400-devops__06-Kubernetes__k8s.md]
- Monitoring & Logging: Prometheus is a standard for monitoring, often paired with a Metrics Server.^[400-devops-06-kubernetes-k8s-paas-readme.md] For logging, EFK stacks (Elasticsearch, Fluentd/Fluent-Bit, Kibana) are common.^[400-devops__06-Kubernetes__k8s.md]
- Image Management: Kaniko and [[Buildah]] are tools for building container images, particularly within Kubernetes environments (CI/CD), while [[Skopeo]] helps manage images across registries.^[400-devops__06-Kubernetes__k8s.md]
Related Concepts¶
- [[Docker]]
- DevOps
- [[Infrastructure as Code]]
Sources¶
^[400-devops-06-kubernetes-k8s-ithelp-day2-readme.md] ^[400-devops-06-kubernetes-k8s-paas-readme.md] ^[400-devops__06-Kubernetes__k8s.md]