100% found this document useful (1 vote)
375 views

Kubernetes 101 Fundamentals

The document provides an overview of Kubernetes including what it is, why we should use it, its history and architecture. Kubernetes is an open-source tool for managing containerized applications across clusters of hosts. It provides capabilities for deployment, maintenance, and scaling of applications. The key components of a Kubernetes cluster are the master node, which manages the cluster, and worker nodes, which run the containerized applications.

Uploaded by

Ann Afamefuna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
375 views

Kubernetes 101 Fundamentals

The document provides an overview of Kubernetes including what it is, why we should use it, its history and architecture. Kubernetes is an open-source tool for managing containerized applications across clusters of hosts. It provides capabilities for deployment, maintenance, and scaling of applications. The key components of a Kubernetes cluster are the master node, which manages the cluster, and worker nodes, which run the containerized applications.

Uploaded by

Ann Afamefuna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Learn With Sandip

By Sandip Das
Learn With Sandip

About me
Sandip Das
Lead DevOps Engineer & Cloud Solutions Architect

AWS Container Hero

Connect
contact@sandipdas.in
What is Kubernetes?
Learn With Sandip

Kubernetes is a powerful open-source orchestration tool, designed to help us manage


microservices and containerized applications across a distributed cluster of computing
nodes.

Using Kubernetes we can automate many of the manual processes involved in deploying,
managing, and scaling containerized applications.

Kubernetes aims to hide the complexity of managing containers through the use of several
key capabilities, such as REST APIs and declarative templates that can manage the entire
lifecycle.
Learn With Sandip

Why We Should Use Kubernetes?


01 Scalability
Schedule, run, orchestrate containers on across several host machines
be it physical or virtual machines (VMs). Orchestrate your containers
across several hosts.

02 Production Ready
We can fully implement and utilize a container-based infrastructure in
our production environments using Kubernetes, also we can optimize
hardware usage to make the most of our computing resources.

03 Flexibility
We can declaratively manage services to ensure deployed applications
running as intended.
Dynamically mount and add storage to run stateful apps.
Do health checks and enable application self-healing. Automate and
control application deployments and updates
Birth of the Borg
System
From Borg to Omega 2003-2004
2013 Google Introduces

History of
Kubernetes
Kube v1.0 & CNCF
2014
Kubernetes 2015
Kubernetes Goes
Mainstream!
Enterprise Adoption &
Support 2016
2017 More Cloud Adoptions
- GKE, EKS, and AKS
become generally available

And the story continued....


2018
Learn With Sandip
Kubernetes Architecture
Learn With Sandip

Kubectl

UI
Learn With Sandip

Kubernetes What is Kubernetes Cluster?

Cluster
A Kubernetes cluster is a collection of nodes on which
workloads can run, these nodes can be physical (bare
metal) machines, or virtual machines (VMs), or serverless
compute systems like Amazon Fargate.

Kubernetes cluster enables us to schedule and run


containers across a collection of nodes
Kubernetes
Learn With Sandip
What is Kubernetes Nodes?

Kubernetes runs your workload by placing containers into

Nodes Pods to run on Nodes

A node may be a virtual or physical machine, depending


on the cluster. Each node is managed by the control plane
and contains the services necessary to run Pods.
Type of Nodes:
Master Node: The master node controls the state of the
cluster. It does Scheduling and scaling applications,
Maintaining a cluster’s state.

Worker Node: The worker nodes are the components that


run the applications. Worker nodes perform tasks

Tips
assigned by the master node.

There must be a minimum of one master node and one worker node for a Kubernetes cluster to be operational

Cluster name must be domain compliant


We can make any node as un-schedulable using the "cordon" command e.g. kubectl cordon $NODENAME
and to make node schedulable again, use the "uncordon" e.g. kubectl uncordon $NODENAME
Learn With Sandip

Master Node(s) What is Master Node(s)?


This node hosts the Kubernetes control plane and manages the cluster. It acts as
the “brains” of the cluster
Components
API Server: It's the entry point or gateway for REST / kubectl. It receives all REST requests for
modifications to pods, services, replication sets/controllers, and others i.e serving as a frontend to the
cluster. It's the only coponent communicates with the etcd

Scheduler: It schedules pods to worker nodes. It reads the service’s operational


requirements and schedules it on the best fit node.

Kube Controller Manager: It always evaluates the current vs the desired state and
checks for a change in configurations, if any change in the configuration occurs, it spots
the change, starts working to get the desired state.

Cloud Controller Manager: This is responsible for managing controller processes with
dependencies on the underlying cloud provider

etcd: a simple, distributed key value storage which is used to store the Kubernetes
cluster data (such as number of pods, their state, namespace, etc),
Learn With Sandip

Worker Node(s) What is Worker Node(s)?


These are the machines/nodes which host the data plane, where containers (workloads) are deployed.
Every node in the cluster must run a container runtime such as Docker, as well as the below-
mentioned components.
Components
Kubelet: This is responsible for the running state of each node,
regularly taking in new or modified pod specifications (primarily
through the kube-apiserver), and ensuring that pods and their
containers are healthy and running in the desired state. This
component also reports to the master on the health of the host where
it is running

Kube-proxy: It's a proxy service implementation that manages IP


translation and routing, such as network proxy and a load balancer,
that runs on each worker node to deal with individual host subnetting
and expose services to the external world. It performs request
forwarding to the correct pods/containers across the various isolated
networks in a cluster.

Container: This resides inside a pod. The container is the lowest level
of a micro-service, which holds the running application, libraries, and
their dependencies. Containers can be exposed to the world through
an external IP address. Kubernetes has supported Docker containers
since its first version. In July 2016 the rkt container engine was added
Kubernetes
Concepts
Learn With Sandip

kubectl
kubectl command is a line tool that interacts with kube-
apiserver and send commands to the master node. Each
command is converted into an API call.

Syntax
kubectl [command] [TYPE] [NAME] [flags]

Click to see Kubectl Cheatsheet


Examples

kubectl apply -f ./my-manifest.yaml # create resource(s)


kubectl get services # List all services in the namespace
kubectl get pods --all-namespaces # List all pods in all namespaces
kubectl get pods -o wide # List all pods in the current namespace, with more details
kubectl get deployment my-dep # List a particular deployment
kubectl get pods # List all pods in the namespace
kubectl get pod my-pod -o yaml # Get a pod's YAML
Pods
Learn With Sandip

What are Pods? simple-pod.yaml


Pods are the smallest deployable units of computing that you can
create and manage in Kubernetes.

It generally refers to one or more containers that should be controlled


as a single application.

A pod encapsulates application containers, storage resources, a


unique network ID, and other configurations on how to run the
containers.

To create a Pod, run the below command:


kubectl apply -f simple-pod.yaml

To know more about Pods, click here


Services
Learn With Sandip

What are Services? simple-service.yaml


It's an abstract way to expose an application running on a set of Pods
as a network service.

Pods are volatile, that is Kubernetes does not guarantee a given


physical pod will be kept alive forever. Instead, a service represents a
logical set of pods and acts as a gateway, allowing to send requests
to the service without needing to keep track of which physical pods
actually make up the service.

Kubernetes gives Pods their own IP addresses and a single DNS


name for a set of Pods, and can load-balance across them.

To create a Service, run the below command:


kubectl apply -f simple-service.yaml

To know more about services, Click here


Volume
Learn With Sandip

simple-volume.yaml
What are Volume?
Volume in a simple sense is a directory containing data, just similar to
a container volume in Docker, but a Kubernetes volume applies to a
whole pod and is mounted on all containers in the pod.
Using Volume Kubernetes guarantees data is preserved across
container restarts

There are many types of volumes: emptyDir, hostPath,


gcePersistentDisk, awsElasticBlockStore, nfs, iscsi, flocker, glusterfs,
rbd, cephfs, gitRepo, secret, persistentVolumeClaim, downwardAPI,
azureDiskVolume,

To create a Volume, run the below command:


kubectl apply -f simple-volume.yaml

To know more about Volume, click here


Deployment
Learn With Sandip

simple-deployment.yaml
What are Deployment?
A Deployment provides declarative updates for Pods and
ReplicaSets.

It describes the desired state of a pod or a replica set, in a yaml file.


The deployment controller then gradually updates the environment
(for example, creating or deleting replicas) until the current state
matches the desired state specified in the deployment file. For
example, if the yaml file defines 2 replicas for a pod but only one is
currently running, an extra one will get created. Note that replicas
managed via a deployment should not be manipulated directly, only
via new deployments.

To create a Deployment, run the below command:


kubectl apply -f simple-deployment.yaml

To know more about Deployment, click here


Namespace
Learn With Sandip

What are Namespace? simple-namespace.yaml


In Kubernetes, namespaces provides a mechanism for isolating
groups of resources within a single cluster.

A virtual cluster (a single physical cluster can run multiple virtual


ones) intended for environments with many users spread across
multiple teams or projects, for isolation of concerns. Resources inside
a namespace must be unique and cannot access resources in a
different namespace. Also, a namespace can be allocated a resource
quota to avoid consuming more than its share of the physical
cluster’s overall resources.

To create a Namespace, run the below command:


kubectl apply -f simple-namespace.yaml

To know more about Namespace, click here


Credits
Kubernetes Documentation
aquasec.com
Thanks for
watching!

See you all


soon in my
next session

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy