What is
Kubernetes?
▸ Also known as k8s
▸ Inspired by the Google Borg system
▸ V1.0 released in July 2015
▸ Google donated it to the Cloud
Native Computing Foundation
▸ It watches for pods that
have been assigned to its
node
▸ Runs the pod and mount
required volumes
▸ Downloads the pod’s
secrets
▸ Reports the status of the
node back to the rest of the
system
kubelet
Desired
State
▸ Very important concept in
the Kubernetes model
▸ It is Kubernetes’
responsibility to make sure
that the current state
matches the desired state
Pod
▸ It contains one or more
application containers,
tightly coupled
▸ Containers within a pod
share an IP address and port
space, and can find each
other via localhost
Pod
▸ Pods are considered to be
relatively ephemeral
▸ Normally used with
controllers
Readiness
probe
▸ The kubelet uses readiness
probes to know when a
Container is ready to start
accepting traffic
▸ A Pod is considered ready
when all of its Containers are
ready
▸ When a Pod is not ready, it is
removed from Service load
balancers
Readiness
/ liveness
probe
fields
▸ successThreshold: Minimum
consecutive successes for
the probe to be considered
successful after having
failed
▸ failureThreshold: Minimum
consecutive failures for the
probe to be considered
unhealthy
▸ Pods are mortal
▸ Each Pod has a unique IP
address, but those IPs are
not exposed outside the
cluster.
▸ A service defines a logical
set of Pods and a policy by
which to access them
Services
▸ ClusterIP (default): Exposes
the Service on an internal IP
in the cluster
▸ NodePort: Exposes the
Service on the same port of
each selected Node in the
cluster
Services
- Types
▸ LoadBalancer - Creates an
external load balancer in the
current cloud (if supported)
and assigns a fixed, external
IP to the Service
▸ ExternalName - Exposes the
Service using an arbitrary
name (e.g.
test.example.com)
Services
- Types
Replication
Controller
▸ Replication Controller
ensures that a specified
number of pod replicas are
running at any one time
▸ If there are too many pods,
the ReplicationController
terminates the extra pods. If
there are too few, the
ReplicationController starts
more pods.
Namespace
▸ Namespaces are intended
for use in environments with
many users spread across
multiple teams, or projects
▸ Names of resources need to
be unique within a
namespace, but not across
namespaces
Secrets
▸ Passwords, OAuth tokens,
and ssh keys
▸ A secret can be used with a
pod in two ways: as files in a
volume mounted on one or
more of its containers, or
used by kubelet when pulling
images for the pod
ConfigMap
▸ Key-value pairs of
configuration data that can
be consumed in pod
▸ ConfigMap is similar to
Secrets, but it do not contain
sensitive information