Kubernetes & GKE Flashcards

1
Q

What is a Pod?

A

A pod is a scheduling unit that contains one or more containers guaranteed to be co-located on the same node.

Pods have an unique IP address within their cluster that allows applications to connection with them.

Within a pod, all containers can reference each other.

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

What is a service?

A

A service is a collection of pods that work together.

The pods used in the service are defined by a label selector.

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

What are the two modes of service discovery?

A

Kubernetes DNS and environment variables.

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

What is service discovery?

A

The process of automatically detecting devices and services on a network.

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

How does service discovery work in Kubernetes?

A

It assigns a service an unchanging IP and DNS name, and loads balances traffic across the service pods using round robin.

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

What is a volume?

A

A volume is a persistent filesystem for pods.

It lasts as long as the pod does and can be accessed by the containers in a pod.

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

What is a label?

A

A label is key/tag used to identify an API object (Nodes, pods, etc).

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

What is a label selector?

A

A label selector is a query against labels to find matchings objects.

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

What is a workload?

A

A workload is a high-level abstraction to make managing pods simpler.

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

What is a ReplicaSet?

A

A ReplicaSet is a workload that manages a stable set of replica pods.

It is defined using a label selector which, when evaluated, will identify all the pods related to it.

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

What is a ReplicationController?

A

A ReplicationController is the predecessor of a ReplicaSet. It works in the same way, but has been deprecated to make use of label selectors.

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

What is a Deployment?

A

A Deployment is a higher-level management tool for ReplicaSets.

It controls what happens to a ReplicaSet (whether it needs to updated or rolled bac, etc).

When a Deployment scales vertically, the declaration of the ReplicaSet changes and this change is managed by the ReplicaSet.

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

What is an Ingress object?

A

An Ingress object is an API object that exposes and manages access to a service (within a cluster) to outside the cluster, typically via HTTP/S.

Ingress may provide load balancing, SSL termination and name-based virtual hosting.

Ingress requires an Ingress Controller to work. Just creating one won’t do anything.

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

What are the two ways of handling configuration information in Kubernetes?

A

ConfigMaps and Secrets.

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

What is a ConfigMap?

A

A ConfigMap is an API object used to store non-confidential config data in a key/value pair.

They can be used as environment variables, command-line arguments, or configuration files in a Volume.

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

What is a Secret?

A

A Secret is an API object that contains sensitive data (e.g., password, OAuth token, etc).

They are meant for holding sensitive data, but are not encrypted at rest. In addition, anyone with API access or access to etcd are view the Secret’s value.

17
Q

How do you protect a Secret?

A

By
1) Enabling Encryption at Rest for Secrets
2) Enabling/Configuring RBAC rules with least-privilege access to Secrets
3) Restrict Secret access to specific containers
4) Using external Secret store Providers

18
Q

What is GKE Application-layer Secrets Encryption?

A

Application-layer Secrets Encryption is an GKE offering that uses Keys from Cloud KMS to encrypt sensitive data stored in etcd.

19
Q

What is etcd?

A

A consistent and highly-available key-value store used as a backing store for cluster data.

You will need a data backup plan for the etcd data.

20
Q

What is a network policy?

A

An construct that specifies how a pod communicates with various network entities(endpoints, services, etc) over a network.

Network policies apply to connections with pods at either end only.

21
Q

What are the three identifiers used to define the entities a NetworkPolicy permits connection to?

A

Other pods
Namespaces
IP blocks

22
Q

What are the selectors to define the allowed pods in a NetworkPolicy?

A

Label Selectors for pod and namespace based policies.

IP ranges for IP-Block based policies.

23
Q

What are the pre-requisites of NetworkPolicies?

A

A network plugin thst supports NetworkPolicy.
Otherwise, creating a policy has no effect.

24
Q

What GKE Ingress?

A

GKE Ingress is a built-in and managed Ingress controller. This controller implements Ingress resources as Google Cloud load balancers for HTTP(S) workloads in GKE.

25
Q

What is GKE workload identity?

A

Workload identity is an offering that allows a Kubernetes service account pose as a IAM service account.

Pods that use the Kubernetes service account will automatically authenticate as the IAM service account when accessing GC APIs.

26
Q

What are the pre-requisites to use Workload Identity?

A
  1. Enable Google Kubernetes Engine API
  2. Ensure the IAM Service Account
    Credentials API is enabled.
  3. Ensure you have the roles needed for this (roles/container.main & roles/iam.serviceAccountAdmin)
  4. Enable Workload identity on the clusters
27
Q

What is a Node in Kuberbetes?

A

A node is a physical or virtual machine. They’re controlled by the control plane and contain services to run Pods.

Nodes make up a cluster.

28
Q

What is a control plane in Kubernetes?

A

The container orchestration layer that exposes the API and interfaces to define, deploy, and manage the lifecycle of containers.

Src - https://kubernetes.io/docs/reference/glossary/?all=true#term-control-plane

29
Q

What is a data plane in Kubernetes?

A

The layer that provides capacity such as CPU, memory, network, and storage so that the containers can run and connect to a network.

Src - https://kubernetes.io/docs/reference/glossary/?all=true#term-data-plane

30
Q

What is a DaemonSet?

A

A DaemonSet is a workload resource that ensures some or all Nodes are running a copy of a Pod.

Deleting a DaemonSet will clean up the Pods it created.

31
Q

What is a ResourceQuota?

A

An object that limits how many resources a namespace can use.

32
Q

What is a LimitRange?

A

An Object that limits how much resources objects within a Namespace can use.

33
Q

What is a Namespace?

A

A mechanism to isolate groups of resources in a cluster.

Names in a Namespace need to be unique within the Namespace only.

34
Q

What is a StatefulSet?

A

StatefulSet is the workload API object used to manage stateful applications.

Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.

Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of its Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.

If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.

35
Q

What is a VPC-Native Cluster?

A

A cluster that uses alias IP address ranges.

Source - https://cloud.google.com/kubernetes-engine/docs/concepts/alias-ips

36
Q

What is a Routes-Based Cluster?

A

A cluster that uses custom static routes in a VPC network.

Source - https://cloud.google.com/kubernetes-engine/docs/concepts/alias-ips