Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

Kubernetes

Alex D. Garcia A.

Alvaro L. Daza Q.

Containers and Docker

Container

  • Containers usually contain an application and its dependencies(libraries and frameworks).
  • Multiple containers can run on a single host.
  • Container's a good infrastructure for building microservice applications which enable manageable application infrastructure and continuous application deliveries.
  • Containers decouple applications from operating systems.

Docker Containers

Docker is an open platform for developers and system administrators to build distributed applications.

Docker Components

Docker Engine

Docker Hub/Resgister

Docker commands

https://www.docker.com/sites/default/files/d8/2019-09/docker-cheat-sheet.pdf

Container orchestration and cluster architecture

Why container orchestration?

Container orchestration manages the deployment, placement, and life-cycle of containers.

Other responsibilities:

  • Cluster management federates hosts into one target.
  • Schedule management distributes containers across nodes through the scheduler.
  • Service discovery knows where containers are located and distributes client requests across them.
  • Replication ensures that the right number of nodes and containers are available for the requested workload.
  • Health management detects and replaces unhealthy containers and nodes.

KUBERNETES ARCHITECTURE

The client for the Api Server can be either kubectl (command line tool) or a Rest Api client.

The scheduler’s main job is to allocate what node the pods needs to be created. It registers with Api Server for any newly created object/resource.

Kubelet registers the node it is running with the API Server. Kubelet monitors the Api Server for Pods that are scheduled to the node, and then it will start the pod’s containers by instructing to docker runtime.

Kubelet monitors the status of running containers and reports to api server about status, events and resource consumption. Kubelet will also do health checks for the container and restart if needed.

K8s Api Server is the central place for all other components. Api Server will take care about validating the object before saving the information to etcd.

Kubernetes use etcd for storing the cluster status and metadata, which includes creation of any objects (pods, deployments, replication controllers, ingress etc…).

A Pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers. A Pod’s contents are always co-located and co-scheduled, and run in a shared context.

Controller Manager is responsible to make sure the actual state of the system converges towards the desired state, as specified in the resource specification.

This process forwards requests to the correct containers, balances the load, and makes sure that the isolated networking environment is predictable and accessible

Kubernetes fundamentals

Deployments, ReplicaSets, and pods

A Deployment provides declarative updates for Pods and ReplicaSets.

Describe a desired state in a Deployment

The smallest unit of deployment, a Pod, runs containers. Each Pod has its own IP address and shares a PID namespace, network, and host name.

YAML

Kubernetes uses YAML for configuration. YAML is a human-readable serialization language. You can use YAML to directly manipulate resources

like:

Replica set

Config

Deployment

Services

Required fields

  • ApiVersion
  • Kind
  • Metadata
  • Spec

Services

A Service is a collection of Pods that is exposed as an endpoint. The Service propagates state and networking information to all worker nodes.

That provide a single point of access from the outside world, into your pod(s) which run your application. That single point of access stays the same, no matter if your pods are moved to another node, changed or deleted entirely

VOLUMES

They arise from the need to save information generated by the App

Volume Types

  • EmptyDir
  • HostPath
  • Cloud Volume

By default Kubernetes create 3 Namespaces

  • Default :Objects without namespace
  • Kube-System:Resources created by System
  • Kube-Public :Resources that can be read by all users including unauthenticated, resources that are publicly visible throughout the cluster

Common kubectl commands

  • kubectl get all
  • kubectl create -f nginx.yaml
  • kubectl delete pod mypod
  • kubectl get nodes
  • watch kubectl get all
  • kubectl get pods
  • kubectl get all --all namespace -o wide
  • kubectl cluster info
  • kubectl get events

THE END....

Learn more about creating dynamic, engaging presentations with Prezi