Overview Flashcards

1
Q

What is Kubernetes? (3)

A

is a portable, extensible, open-source platform

for managing containerized workloads and services

that facilitates both declarative configuration and automation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

History

A

Traditional > Virtualized > Container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Container Benefits (10)

A

increased ease and efficiency of container image creation compared to VM image

reliable and frequent container image build and deployment with quick and easy rollbacks

create application container images at build/release time rather than deployment time, thereby decoupling applications from infrastructure

Observability not only surfaces OS-level information and metrics, but also application health and other signals

Runs the same on a laptop as it does in the cloud

Runs on Ubuntu, RHEL, CoreOS, on-premises, on major public clouds, and anywhere else

Raises the level of abstraction from running an OS on virtual hardware to running an application on an OS using logical resources

applications are broken into smaller, independent pieces and can be deployed and managed dynamically – not a monolithic stack running on one big single-purpose machine

predictable application performance

high efficiency and density

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why Kubernetes? (6)

A

Service discovery and load balancing (expose a container using the DNS name or IP)

Storage orchestration (automatically mount a storage system)

Automated rollouts and rollbacks:
create new containers
remove existing containers
adopt all their resources to the new one

Automatic bin packing (How much CPU and memory (RAM) each container needs)

Self-healing:
restarts containers that fail
replaces containers
kills containers that don’t respond

Secret and configuration management (lets you store and manage sensitive information, such as passwords, OAuth tokens, and SSH keys)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What Kubernetes is not (7)

A

Does not limit the types of applications supported (If an application can run in a container, it should run great on Kubernetes)

Does not deploy source code and does not build your application

Does not provide application-level services, such as middleware

Does not dictate logging, monitoring, or alerting solutions (It provides some integrations as proof of concept, and mechanisms to collect and export metrics)

Does not provide nor mandate a configuration language/system (for example, Jsonnet)

Does not provide nor adopt any comprehensive machine configuration, maintenance, management, or self-healing systems.

Additionally, Kubernetes is not a mere orchestration system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Components (3)

A

Node:
worker machines, that run containerized applications

Pod:
The worker node(s) host the Pods that are the components of the application workload
Set of running containers in your cluster

Control plane:
Manages the worker nodes and the Pods in the cluster
The container orchestration layer that exposes the API and interfaces to define, deploy, and manage the lifecycle of containers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Control Plane (2)

A

make global decisions about the cluster

detecting and responding to cluster events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Control Plane Components (4)

A

kube-apiserver:
is the front end for the Kubernetes control plane
is designed to scale horizontally—that is, it scales by deploying more instances

etcd:
Consistent and highly-available key value store
backing store for all cluster data
make sure you have a back up plan for those data

kube-scheduler:
watches for newly created Pods with no assigned node, and selects a node for them to run on
Factors
individual and collective resource requirements
hardware/software/policy constraints
affinity and anti-affinity specifications
data locality
inter-workload interference
deadlines

kube-controller-manager:
runs controller processes
Logically, each controller is a separate process, but to reduce complexity, they are all compiled into a single binary and run in a single process
controllers
Node controller
Responsible for noticing and responding when nodes go down
Replication controller
maintaining the correct number of pods for every object
Endpoints controller
Populates the Endpoints object (that is, joins Services & Pods)
Service Account & Token controllers
Create default accounts and API access tokens for new namespaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

kube-scheduler Factors (6)

A

individual and collective resource requirements

hardware/software/policy constraints

affinity and anti-affinity specifications

data locality

inter-workload interference

deadlines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

kube-controller-manager controllers (4)

A

Node controller:
Responsible for noticing and responding when nodes go down

Replication controller:
maintaining the correct number of pods for every object

Endpoints controller:
Populates the Endpoints object (that is, joins Services & Pods)

Service Account & Token controllers:
Create default accounts and API access tokens for new namespaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Node Components

A

run on every node

maintaining running pods

providing the Kubernetes runtime environment
Components

kubelet:
    runs on each node in the cluster
    makes sure that containers are running in a Pod
    takes a set of PodSpecs that are provided through various mechanisms
    ensures that the containers described in those PodSpecs are running and healthy
    doesn’t manage containers which were not created by Kubernetes

kube-proxy:
    network proxy that runs on each node in your cluster
    implementing part of the Kubernetes Service concept
    maintains network rules on nodes
    allow network communication to your Pods from network sessions inside or outside of your cluster
    uses the operating system packet filtering layer
    Otherwise, kube-proxy forwards the traffic itself

Container runtime:
    software that is responsible for running containers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Addons

A

use Kubernetes resources (DaemonSet, Deployment, etc) to implement cluster features

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

DNS Addon (3)

A

all Kubernetes clusters should have cluster DNS, as many examples rely on it

serves DNS records for Kubernetes services

Containers started by Kubernetes automatically include this DNS server in their DNS searches
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Web UI (Dashboard) Addon

A

It allows users to manage and troubleshoot applications running in the cluster, as well as the cluster itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Container Resource Monitoring Addon

A

records generic time-series metrics about containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Cluster-level Logging Addon

A

responsible for saving container logs to a central log store with search/browsing interface

17
Q

The Kubernetes API (3)

A

Lets you query and manipulate the state of objects in Kubernetes. (for example: Pods, Namespaces, ConfigMaps, and Events)

The core of Kubernetes’ control plane is the API server and the HTTP API that it exposes.

Users, the different parts of your cluster, and external components all communicate with one another through the API server.

18
Q

API changes

A

Any system that is successful needs to grow and change as new use cases emerge or existing ones change.

What constitutes a compatible change, and how to change the API, are detailed in API changes.
19
Q

OpenAPI specification (2)

A

a broadly adopted industry standard for describing modern APIs

The Kubernetes API server serves an OpenAPI spec via the /openapi/v2 endpoint.

20
Q

API versioning

A

The JSON and Protobuf serialization schemas follow the same guidelines for schema changes - all descriptions below cover both formats.

21
Q

API versioning summarized (3)

A

Alpha level:
The version names contain alpha (e.g. v1alpha1).

May be buggy. Enabling the feature may expose bugs. Disabled by default.

Support for feature may be dropped at any time without notice.

The API may change in incompatible ways in a later software release without notice.

Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.

Beta level:
The version names contain beta (e.g. v2beta3).

Code is well tested. Enabling the feature is considered safe. Enabled by default.

Support for the overall feature will not be dropped, though details may change.

The schema and/or semantics of objects may change in incompatible ways in a subsequent beta or stable release. When this happens, we will provide instructions for migrating to the next version. This may require deleting, editing, and re-creating API objects. The editing process may require some thought. This may require downtime for applications that rely on the feature.

Recommended for only non-business-critical uses because of potential for incompatible changes in subsequent releases. If you have multiple clusters which can be upgraded independently, you may be able to relax this restriction.

Stable level:
The version name is vX where X is an integer.

Stable versions of features will appear in released software for many subsequent versions.
22
Q

API groups (4)

A

To make it easier to extend its API, Kubernetes implements API groups.

The API group is specified in a REST path and in the apiVersion field of a serialized object.

There are several API groups in a cluster:

    The core group, also referred to as the legacy group, is at the REST path /api/v1 and uses apiVersion: v1.

    Named groups are at REST path /apis/$GROUP_NAME/$VERSION, and use apiVersion: $GROUP_NAME/$VERSION (e.g. apiVersion: batch/v1). The Kubernetes API reference has a full list of available API groups.

There are two paths to extending the API with custom resources:

    CustomResourceDefinition lets you declaratively define how the API server should provide your chosen resource API.

    You can also implement your own extension API server and use the aggregator to make it seamless for clients.
23
Q

Enabling or disabling API groups

A

Certain resources and API groups are enabled by default.

They can be enabled or disabled by setting --runtime-config as a command line option to the kube-apiserver.
24
Q

API Persistence

A

Kubernetes stores its serialized state in terms of the API resources by writing them into etcd.