L8 - Platform as a Service (PaaS) - Kubernetes 1/2 Flashcards
container orchestration
The management and deployment of multiple containers
container execution platform services
- container placement
- resource and usage monitoring
- health checks
- container scaling
- access to services
- networking of containers
- persistent storage management
container placement
selects a specific host for a specific container or a set of containers using different rules
access to services in container execution platform services
- IP management and load balancing (LB)
What does networking of containers refer to?
- efficient implementation of microservices communication
Examples of container orchestration tools
AWS container service (Amazon ECS)
Azure Container Service
Docker SWARM
MESOS
kubernetes
What is Kubernetes?
- OS for deploying cloud-native applications
- a cluster for running applications
- an orchestration of cloud cloud-native microservices apps
Key features of Kubernetes
- automated deployment and replication of containers
- online scale-out and scale-in of container clusters
- LB over groups of containers
- rolling upgrades of application containers
- automated rescheduling of failed containers
What is a cloud-native application?
Software architecture that solves business problems that can typically only be achieved at the scale of cloud computing.
Cloud Native Maturity Model
- Cloud Native Services
- Application Design
- Automation
Cloud Native Services
- storage, compute
- databases, analytics
- container service, FaaS
Application Design
- general guidelines for scalable, robust cloud applications
- microservices: considered to be most mature cloud application model
Automation in Cloud Native Maturity Model
- deployment, monitoring, predictive analytics
The Twelve Factors of (Cloud Native Services?)
- Codebase (one codebase tracked revision control)
- Dependencies (declare and isolate dependencies)
- Config (store config in the environment)
- Backing services (treat backing services)
- Build, release, run (separate build and run stages)
- Processes (execute the app as one or more stateless processes)
- Port binding (export services via port binding)
- Concurrency (scale out via process model)
- Disposability (fast startup and graceful shutdown)
- Dev/prod parity (keep development, staging and production as similar as possible)
- Logs (treat logs as event streams)
- Admin processes (run admin tasks as one-off processes)
What is a cluster?
- consists of a bunch of nodes and a control plane
- control-plane provides API, scheduler to assign work to nodes, and persistent storage for the cluster state
What is orchestration?
Services to run and coordinate microservices applications
How to run a microservices application?
- Write microservices
- Package each service in a container
- Wrap each container in its own Pod
- Deploy pods to the cluster via workload resources that configure controllers: Deployments, DaemonSets, StatefulSets, CronJobs
Does K8s support different container runtimes?
Yes. Different nodes of a cluster can have a different container runtime
What is the CRI?
Container Runtime Interface, which is an abstraction layer for 3rd party container runtimes
internet:
The Container Runtime Interface (CRI) is an API that allows a container orchestration system, such as Kubernetes, to communicate with the container runtime, such as Docker or containerd, on a host machine.
What is Declarative Management in K8s?
Here applications are managed declaratively
- you describe how the application should run in YAML files
- POST the descriptions to K8s
- follow how Kubernetes manages the application to match the descriptions
Advantages of declarative management in K8s
- the implementation is entirely on K8s
- it oversees the applications during runtime to always match the requiremens
What is REST?
Representational State Transfer (REST) is a software architecture that imposes conditions on how an API should work
3 Master Node Components
- Kube-API server
- Cluster store
- Controller manager
Kube-API Server
- provides REST interface for K8s control plane and datastore.
- acts as the gatekeeper to the cluster by handling authentication and authorization
- all clients and other apps interact with K8s through API server
What is cluster store?
- etcd (distributed key-value store) is currently K8sā backing store. All data cluster data is stored here
- prefers consistency over availability ā> If etcd is unavailable the applications can continue but not be updated
Controller manager in master node
- controls independent control loops (for nodes, endpoints, replicasets)
- obtains desired state, observes current state, determines differences, reconciles differences
What does the Kube-scheduler do?
Selects a node for newly created pods to run on
- Determines nodes that are capable of running the pod
- Ranks the capable nodes depending on (resources available, # pods running)
Node Components
WHAT IS Kubelet
- the node-level manager in K8s
- manages the lifecycle of every pod
- receives new pod assignments from API-server
What is Container Runtime?
- performs container-related tasks like pulling images, starting, stopping
- is a plugin model called the Container Runtime Interface (CRI)
Example: cri-containerd (CNCF)