L8 - Platform as a Service (PaaS) - Kubernetes 2/2 Flashcards

1
Q

What are web containers supported by?

A

A helper container that pulls the latest content.

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

How do pods create the environment for containers?

A
  • unique IP address, shared memory etcs.
  • containers inside a Pod use ports on the Pods’ localhost interface
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do pods have their own network namespace

A

Single IP address, single range of TCP ports and a routing table

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

How does external access to a container in a Pod take place?

A
  • Pod IP address combined with the port of the container
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does container-to-container communication in a Pod work?

A

localhost adapter and port number

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

4 characteristics of pods

A
  1. Units of scheduling (scaling through adding or removing pods)
  2. Atomic units (starting or stopping pods will start and stop all containers)
  3. Mortal (a replacement Pod will have a new ID and IP and might run on another node)
  4. Managed by higher-level controllers (deployment, daemonSet, StatefulSet)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does daemonSet do?

A

Ensures a Pod is running on each node

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

What does StatefulSet do?

A

StatefulSet is a Kubernetes object that manages a set of replicated pods, ensuring that each pod has a unique, persistent network identity and that the pods are deployed in a predictable order. StatefulSets are used for applications that require stable, unique network identities and persistent storage, such as databases, message brokers, and caches.

Adds guarantees and ordering and uniqueness of Pods

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

What is a Pod Network?

A
  • for Pod-to-Pod communication
  • K8s sets up bridge networks and routing tables such that Pods can reach other Pods via their IP address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are examples of Pod Networks?

A

AWS VPC Container Network Interface (CNI), Calico

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

How are a Pod’s resources limited?

A

Through cgroups.

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

What do cgroups do?

A
  • specify the resource limits for CPU, RAM, IOPS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the resource limits of Pods?

A

The aggregated limits of the containers plus possibly some Pod overhead

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

How is a pod created?

A
  1. Define a Pod in a manifest
  2. POST manifest to API server
  3. Schedule a Pod on a cluster
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

4 characteristics of Pod deployment

A
  1. Self-healing: failed Pods are replaced
  2. Scaling: # of replicas in ReplicaSet can be adapted as required & current state is adapted to match desired one
  3. Rolling update
  4. Versioned rolling update
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does a rolling update take place?

A
  • POST a new version of the deployment YAML file with a new version of a container image
  • K8s creates a new ReplicaSet
  • When a new Pod is created in the ReplicaSet then an old Pod from the previous ReplicaSet is deleted –> zero downtime
17
Q

What is a versioned rolling update?

A
  • The old ReplicaSet still exists with the old configuration
  • Rolling back simply winds up the old ReplicaSet
18
Q

What do “Services” do for Pods?

A
  • provide a reliable networking for a set of Pods
  • stable DNS name, IP address and port
  • service discovery through K8s DNS service
  • LB across Pods
  • Pods are connected to a service via labels and selector
19
Q

What does the Endpoints object in a service do?

A

It is a dynamic list of Pods that match the label selector and balances requests over the Pods in the Endpoints.

20
Q

4 types of Services

A
  1. ClusterIP Service
  2. NodePort Service
  3. LB Service
  4. ExternalName Service
21
Q

What does the clusterIP Service do?

A
  • IP address and port are only accessible inside of the cluster

A ClusterIP Service in Kubernetes is a type of service that exposes a set of pods to other parts of the cluster. A ClusterIP service provides a stable IP address and ports that are accessible only within the cluster.

22
Q

What does the NodePort Service do?

A
  • service has an additional port called the NodePort
  • can be reached by sending a request to the IP address of any cluster node on the NodePort
  • kube-proxy listens to that port and replaces target by the cluster IP of the service and its port. Then it is a cluster local request

The NodePort Service in Kubernetes is a type of service that exposes a application running on a cluster to external network traffic by assigning a static port on each node of the cluster. The traffic to this static port is then forwarded to the corresponding pod serving the application. NodePort is the simplest and most primitive way of exposing a service, it is useful for testing or simple use cases where load balancing is not needed.

23
Q

LB Service

A
  • extension of NodePort Service
  • allows clients to reach Pods via LBs
24
Q

ExternalName Service

A
  • allows to route traffic to systems outside of your K8s cluster
  • the service is implemented outside of the cluster and accessible through a domain name which is specified in the service YAML
25
Q

How does Service Discovery work?

A

a service request is handled on the node by rewriting the service IP address obtained from Cluster DNS into the IP address of a Pod in the Endpoints object of the service. This rewriting is setup by the kube-proxy process.

26
Q

How is Kubernetes Storage built up?

A
  1. Persistent Volume
  2. Persistent volume (PV) subsystem
  3. Container Storage Interface (CSI)
27
Q

What does PV subsystem allow?

A
  • persistent volume (PV) object allows to map external storage onto the cluster
28
Q

Two autoscalers

A
  • Horizontal Pod autoscaler
  • Vertical Pod autoscaler
29
Q

What is the horizontal Pod autoscaler?

A
  • controller for ReplicaSet
  • modifies the desired # of replicas within declared bounds
  • resource metrics are typically collected through the metrics-server and accessible from the APIserver through the Metrics API
30
Q

What is Vertical Pod Autoscaler?

A

Vertical Pod Autoscaler (VPA) is a Kubernetes extension that provides automatic scaling for the resources (such as CPU and memory) used by individual pods. VPA works by analyzing the resource utilization of pods over time, and adjusting the resource requests and limits specified in the pod definitions to ensure that the pods receive the resources they need to operate optimally.

VPA operates at the pod level, which allows it to provide more fine-grained control over resource allocation compared to traditional horizontal pod autoscalers, which scale the number of replicas of a pod based on demand. With VPA, the resources requested by a pod can be increased or decreased based on actual utilization, which helps to optimize resource utilization and minimize waste.

Calculates the resource requests for Pods based on usage.
Specification of the Vertical Pod Autoscaler includes:
- deployment or StatefulSet
- Update Policy
- ResourcePolicy
- Recommendations based on historic and current usage

31
Q

What is the Update Policy in vertical Pod autoscaling?

A

How the changes in resources are applied to the pods
- off: resources are not modified
- initial: assign the resources only at the start of the Pod
- Recreate: deletion and recreation of a Pod
- Auto: can use any method

32
Q

What is the ResourcePolicy in vertical Pod autoscaling?

A

Computes resource requirements for a container in the Pod. Different policies can be used for different containers.
Limited by min and max allowed resources
Recommendations are given as interval of recommended resources.

33
Q

What is the cluster autoscaler?

A
  • adapts the number of nodes of the K8s cluster and runs the Master Node
  • scaling through the cloud provider interface
  • if Pods cannot be scheduled due to a shortage of resources, the number of nodes is increased.