Learn Kubernetes Basics _ Kubernetes
Learn Kubernetes Basics _ Kubernetes
an learn to:
ation on a cluster.
Modules
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 1/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
(/docs/tutorials/kubernetes- (/docs/tutorials/kubernetes-
/) basics/deploy-app/deploy-intro/) basics/explore/explore-intro/)
2. Deploy an app 3. Explore your app
(/docs/tutorials/kubernetes- (/docs/tutorials/kubernetes-
/) basics/deploy-app/deploy-intro/) basics/explore/explore-intro/)
(/docs/tutorials/kubernetes- (/docs/tutorials/kubernetes-
basics/scale/scale-intro/) basics/update/update-intro/)
5. Scale up your app 6. Update your app
(/docs/tutorials/kubernetes- (/docs/tutorials/kubernetes-
basics/scale/scale-intro/) basics/update/update-intro/)
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 2/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
1 - Create a Cluster
1.1 - Using Minikube to Create a Cluster
s Clusters
rdinates a highly available cluster of computers that
Summary:
o work as a single unit. The abstractions in Kubernetes Kubernetes cluster
oy containerized applications to a cluster without tying Minikube
to individual machines. To make use of this new model of
lications need to be packaged in a way that decouples them
osts: they need to be containerized. Containerized
more exible and available than in past deployment Kubernetes is a production-
pplications were installed directly onto speci c machines as grade, open-source platform
integrated into the host. Kubernetes automates the that orchestrates the placement
d scheduling of application containers across a cluster (scheduling) and execution of
ent way. Kubernetes is an open-source platform and is application containers within
y. and across computer clusters.
Diagram
Node
Control Plane
Node Processes
bernetes Cluster
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 3/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 4/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
Kubernetes cluster
inutes
atulations on
eting the module
ear what you thought of the module
Kubernetes cluster
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 5/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
Kubernetes cluster
inutes
atulations on
eting the module
ear what you thought of the module
Kubernetes cluster
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 6/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
odule 2 › (/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/)
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 7/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
2 - Deploy an App
2.1 - Using kubectl to Create a
Deployment
t application Deployments.
r rst app on Kubernetes with kubectl.
s Deployments
running Kubernetes cluster, you can deploy your
Summary:
plications on top of it. To do so, you create a Kubernetes Deployments
n guration. The Deployment instructs Kubernetes how to Kubectl
te instances of your application. Once you've created a
Kubernetes control plane schedules the application
ed in that Deployment to run on individual Nodes in the
A Deployment is responsible for
creating and updating instances
tion instances are created, a Kubernetes Deployment
of your application
uously monitors those instances. If the Node hosting an
wn or is deleted, the Deployment controller replaces the
instance on another Node in the cluster. This provides a
chanism to address machine failure or maintenance.
Node
containerized app
Deployment
Control Plane
node processes
rnetes Cluster
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 8/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 9/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 10/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
n app
inutes
atulations on
eting the module
ear what you thought of the module
n app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 11/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
odule 3 › (/docs/tutorials/kubernetes-basics/explore/explore-intro/)
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 12/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
t Kubernetes Pods.
t Kubernetes Nodes.
ot deployed applications.
age, as Volumes
, as a unique cluster IP address A Pod is a group of one or more
n about how to run each container, such as the container application containers (such as
on or speci c ports to use Docker) and includes shared
storage (volumes), IP address
application-speci c "logical host" and can contain di erent
and information about how to
ainers which are relatively tightly coupled. For example, a
run them.
e both the container with your Node.js app as well as a
er that feeds the data to be published by the Node.js
ontainers in a Pod share an IP Address and port space, are
d and co-scheduled, and run in a shared context on the
rview
erview
t - list resources
scribe - show detailed information about a resource
gs - print the logs from a container in a pod
ec - execute a command on a container in a pod
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 14/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
our app
inutes
atulations on
eting the module
ear what you thought of the module
our app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 15/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
our app
inutes
atulations on
eting the module
ear what you thought of the module
our app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 16/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
odule 4 › (/docs/tutorials/kubernetes-basics/expose/expose-intro/)
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 17/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
t a Service in Kubernetes
d how labels and LabelSelector objects relate to a Service
application outside a Kubernetes cluster using a Service
f Kubernetes Services
(/docs/concepts/workloads/pods/) are mortal. Pods in fact
Summary
docs/concepts/workloads/pods/pod-lifecycle/). When a Exposing Pods to
s, the Pods running on the Node are also lost. A ReplicaSet external tra c
workloads/controllers/replicaset/) might then dynamically Load balancing tra c
back to desired state via creation of new Pods to keep your across multiple Pods
ng. As another example, consider an image-processing Using labels
eplicas. Those replicas are exchangeable; the front-end
ot care about backend replicas or even if a Pod is lost and
aid, each Pod in a Kubernetes cluster has a unique IP
ds on the same Node, so there needs to be a way of A Kubernetes Service is an
conciling changes among Pods so that your applications abstraction layer which de nes
tion. a logical set of Pods and enables
external tra c exposure, load
ernetes is an abstraction which de nes a logical set of Pods
balancing and service discovery
which to access them. Services enable a loose coupling
for those Pods.
ent Pods. A Service is de ned using YAML (preferred)
con guration/overview/#general-con guration-tips) or
ernetes objects. The set of Pods targeted by a Service is
ed by a LabelSelector (see below for why you might want a
ncluding selector in the spec).
e that there are some use cases with Services that involve
ector in the spec. A Service created without selector will
he corresponding Endpoints object. This allows users to
Service to speci c endpoints. Another possibility why there
or is you are strictly using type: ExternalName .
d Labels
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 18/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 19/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
inutes
atulations on
eting the module
ear what you thought of the module
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 20/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
inutes
atulations on
eting the module
ear what you thought of the module
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 21/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
odule 5 › (/docs/tutorials/kubernetes-basics/scale/scale-intro/)
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 22/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
p using kubectl.
application
modules we created a Deployment
Summary:
workloads/controllers/deployment/), and then exposed it Scaling a Deployment
vice (/docs/concepts/services-networking/service/). The
ted only one Pod for running our application. When tra c
l need to scale the application to keep up with user
You can create from the start a
Deployment with multiple
plished by changing the number of replicas in a
instances using the --replicas
parameter for the kubectl create
deployment command
verview
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 23/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 24/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
your app
inutes
atulations on
eting the module
ear what you thought of the module
your app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 25/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
your app
inutes
atulations on
eting the module
ear what you thought of the module
your app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 26/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
odule 6 › (/docs/tutorials/kubernetes-basics/update/update-intro/)
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 27/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
n application
plications to be available all the time and developers are
Summary:
oy new versions of them several times a day. In Kubernetes Updating an app
rolling updates. Rolling updates allow Deployments'
ace with zero downtime by incrementally updating Pods
ew ones. The new Pods will be scheduled on Nodes with
es. Rolling updates allow
Deployments' update to take
module we scaled our application to run multiple instances.
place with zero downtime by
ment for performing updates without a ecting application
incrementally updating Pods
efault, the maximum number of Pods that can be
instances with new ones.
ng the update and the maximum number of new Pods that
s one. Both options can be con gured to either numbers or
Pods). In Kubernetes, updates are versioned and any
ate can be reverted to a previous (stable) version.
pdates overview
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 28/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 29/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
our app
inutes
atulations on
eting the module
ear what you thought of the module
our app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 30/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
our app
inutes
atulations on
eting the module
ear what you thought of the module
our app
inutes
atulations on
eting the module
ear what you thought of the module
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 31/32
5/25/2021 Learn Kubernetes Basics | Kubernetes
https://kubernetes.io/docs/tutorials/kubernetes-basics/_print/ 32/32