Comprehensive Kubernetes: Architecture, Building Blocks, and Deployment Guide

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/107

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

108 Terms

1
New cards

What is Kubernetes?

An open-source container management solution for deploying, running, and orchestrating containers.

2
New cards

What is a Kubernetes cluster?

A group of one or more nodes managed by Kubernetes.

3
New cards

What components are found in every Kubernetes node?

A container runtime (e.g., Docker), kubelet, and kube-proxy.

4
New cards

What is the function of the Kubernetes control plane?

It manages the cluster and includes components like the API server, scheduler, and controller manager.

5
New cards

What is a pod in Kubernetes?

The smallest deployable unit that can be managed, representing a logical group of one or more containers.

6
New cards

What happens to a pod if the node it runs on fails?

The pod is deleted and can be replaced by an identical pod.

7
New cards

What is a label in Kubernetes?

A key/value pair attached to Kubernetes resources for organizing and selecting them.

8
New cards

What is the purpose of a label selector?

To define a set of resources based on their labels.

9
New cards

What does a replication controller do?

It manages a specified number of pod replicas and ensures they are running as intended.

10
New cards

What is the difference between a deployment controller and a replica set?

A deployment controller defines desired states for pods and can manage updates, while a replica set supports set-based selectors.

11
New cards

What is the function of a service in Kubernetes?

  • Provides stable networking for pods (IP, DNS)

  • Responsible to allow network access to a set of pods.

  • Services sit in front of the pods and distributes requests to them.

12
New cards

What are the types of services in Kubernetes?

ClusterIP, NodePort, and LoadBalancer.

13
New cards

What is the role of kubectl in Kubernetes?

A command line tool used to manage Kubernetes clusters.

14
New cards

What is the purpose of using declarative primitives in Kubernetes?

To maintain the desired state of applications and automate transitions from current to requested states.

15
New cards

What is the significance of the Kubernetes Dashboard?

A web UI for managing Kubernetes clusters running on the master node.

<p>A web UI for managing Kubernetes clusters running on the master node.</p>
16
New cards

What is the role of etcd in the Kubernetes control plane?

Key-value database used as backing store for all cluster config data

17
New cards

How can Kubernetes be installed?

On various public and private clouds or bare metal servers.

18
New cards

What is the main purpose of container orchestration in Kubernetes?

To coordinate containers in clusters for complex applications.

19
New cards

What are the basic building blocks of Kubernetes?

Pods, labels, selectors, replication controllers, and services.

20
New cards

What is the difference between imperative and declarative orchestration?

Imperative orchestration involves direct commands, while declarative orchestration defines the desired state.

21
New cards

What does a NodePort service do?

Exposes pods to external traffic by forwarding traffic from a port on each node.

22
New cards

What is a ClusterIP service?

Exposes pods to connections from inside the cluster. Resource to resource communication

Virtual IP in cluster

23
New cards

What is a LoadBalancer service?

  • Exposes pods to external traffic and provides a load balancer.

  • Distributes traffic to different pods.

  • External traffic from the load balancer is directed to backend pods.

24
New cards

What does the environment variable 'environment' indicate in Kubernetes?

It indicates the deployment environment, such as 'dev' or 'live'.

25
New cards

What is the purpose of the 'release' selector in Kubernetes?

It specifies the release version, such as 'stable', in conjunction with the environment.

26
New cards

How does Kubernetes support service discovery?

Through environment variables and DNS.

27
New cards

What information do Kubernetes environment variables provide for services?

They include the service host and port, e.g., MYSQL_SERVICE_HOST and MYSQL_SERVICE_PORT.

28
New cards

What is a volume in Kubernetes?

A volume is defined at the pod level and is used to preserve data across container crashes.

29
New cards

What is the lifecycle of a volume in Kubernetes?

It has the same lifecycle as the pod that encloses it; when the pod is deleted, the volume is deleted.

30
New cards

What is a persistent volume in Kubernetes?

A persistent volume represents a real networked storage unit with a lifecycle independent of any individual pod.

31
New cards

What access modes does a persistent volume support?

It supports

  • ReadWriteOnce (RWO) by a single node

    • DB or apps that need exclusive write access

  • ReadOnlyMany (ROX) by many nodes simultaneously

    • config files, logs

  • ReadWriteMany (RWX) by many nodes simultaneously

    • shared storage, collaborative apps

32
New cards

What is a persistent volume claim?

It defines a specific amount of storage requested and specific access modes, binding to a matching persistent volume.

33
New cards

What happens if a persistent volume claim does not find a matching volume?

It remains unbound indefinitely until a matching volume becomes available.

34
New cards

What is the role of a job in Kubernetes?

  • A resource that allows you to create and manage a finite or batch process in your cluster.

  • Commonly used for tasks that need to be run once or a few times, such as data processing, backups, or migrations

35
New cards

What is a daemon set in Kubernetes?

  • Runs an identical pod in each node. Usually for monitoring, logging, network proxies.

  • A daemon set ensures that all or some nodes run a copy of a pod, tracking the addition and removal of nodes.

36
New cards

What is the purpose of a namespace in Kubernetes?

It provides a logical partition of the cluster's resources, allowing resources to have the same name in different namespaces.

37
New cards

What does a quota do in Kubernetes?

It sets resource limitations for a given namespace, such as CPU and memory, and forces users to request resource allotment.

38
New cards

What is the difference between imperative and declarative orchestration in Kubernetes?

Imperative orchestration involves manual steps, while declarative orchestration defines a target state for the system.

39
New cards

What is Minikube used for?

Minikube is used to run a single-node Kubernetes cluster on a local machine.

40
New cards

What types of jobs are available in Kubernetes?

Non-parallel jobs, parallel jobs with a fixed completion count, and parallel jobs with a work queue.

41
New cards

What is a config map in Kubernetes?

Key-value pairs to store config data

Can reference in deployment or mount to pod (env variables)

42
New cards

How can a Kubernetes secret be used?

It allows users to pass sensitive information to containers, such as passwords and authentication tokens.

43
New cards

What is the primary responsibility of a replication controller in Kubernetes?

To maintain the specified number of replicas of a pod.

44
New cards

What is a replica set in Kubernetes?

A replica set is an advanced version of a replication controller that supports selectors with set-based requirements.

45
New cards

What happens to pods created by a daemon set when it is deleted?

Deleting a daemon set will clean up the pods it created.

46
New cards

What is the significance of the 'notin' operator in Kubernetes selectors?

It specifies that a resource should not be in a defined set of values.

47
New cards

What does the 'in' operator do in Kubernetes selectors?

It specifies that a resource must be in a defined set of values.

Why it’s useful:

  • Group multiple environments, versions, or tiers

  • More flexible than equality-based selectors (key=value)

  • Essential for advanced scheduling and traffic routing patterns

48
New cards

What is the difference between a pod and a container in Kubernetes?

A pod is the smallest deployable unit that can contain one or more containers.

49
New cards

What is Minikube?

A tool that creates a local Kubernetes cluster by running a virtual machine.

50
New cards

What command is used to run a simple deployment in Kubernetes?

$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080

51
New cards

How can you expose a deployment in Kubernetes?

$ kubectl expose deployment hello-minikube --type=NodePort

52
New cards

What command checks the status of a pod in Kubernetes?

$ kubectl get pod

53
New cards

What is the default log rotation policy in Kubernetes?

Daily rotation or 10 MB, keeping up to five rotations.

54
New cards

How can you view logs for a specific container in a pod?

$ kubectl logs -c

55
New cards

What is a common logging agent used in Kubernetes?

Fluentd, often run as a DaemonSet.

56
New cards

How can you check available contexts in kubectl?

$ kubectl config get-contexts

57
New cards

What command confirms the current context and cluster in kubectl?

$ kubectl config view

58
New cards

What is the command to check if a pod is running?

Look for 'Running' in the STATUS field after executing $ kubectl get pod.

59
New cards

What should you do if a pod status shows 'ContainerCreating'?

Wait a few moments and repeat the last command.

60
New cards

What is a sidecar approach in logging?

Using a dedicated logging component in each pod to aggregate logs.

61
New cards

What is a disadvantage of direct logging from an application in Kubernetes?

It prevents the use of kubectl logs and can complicate log management.

62
New cards

What is the command to check logs of a crashed container?

$ kubectl logs --previous

63
New cards

What is the role of a dedicated agent running on every node for logging?

To collect and forward logs to a centralized logging backend.

64
New cards

Where is the config file used by kubectl stored?

~/.kube/config

65
New cards

What command shows the current contexts in kubectl?

kubectl config get-contexts

66
New cards

How do you switch context in kubectl?

Use the command kubectl config use-context followed by the context name.

67
New cards

What is the first step in deploying an application in Kubernetes?

Create a Kubernetes secret to store sensitive information.

68
New cards

What values are encoded in Base64 for the Kubernetes secret?

Database name (app-db), username (app-user), password (app-pass), root password (app-rootpass).

69
New cards

What command is used to create a Kubernetes secret from a YAML file?

kubectl create -f app-secret.yaml

70
New cards

What is the purpose of a Persistent Volume in Kubernetes?

To provide underlying storage for applications like MySQL.

71
New cards

What command verifies the creation of a Persistent Volume?

kubectl describe pv/app-pv

72
New cards

What is the purpose of the PersistentVolumeClaim?

To claim a previously created Persistent Volume for use by an application.

73
New cards

What command is used to create a PersistentVolumeClaim?

kubectl create -f app-pvc.yaml

74
New cards

What does the 'volumeMounts' section in the deployment YAML specify?

It specifies where the persistent volume will be mounted in the container.

75
New cards

What is the command to create a Persistent Volume?

kubectl create -f app-pv.yaml

76
New cards

What does the 'accessModes' field in PersistentVolumeClaim specify?

It specifies the access mode for the volume, such as ReadWriteOnce.

77
New cards

What is the type of the Kubernetes secret defined in the example?

Opaque delete

78
New cards

What is the purpose of the 'selector' field in PersistentVolumeClaim?

To match the Persistent Volume based on labels.

79
New cards

What command verifies the creation of a Kubernetes secret?

kubectl get secrets

80
New cards

What is the significance of the 'replicas' field in the deployment spec?

It specifies the number of pod replicas to run.

81
New cards

What does the 'kind' field in a Kubernetes YAML file indicate?

The type of Kubernetes resource being defined (e.g., Secret, PersistentVolume, Deployment).

82
New cards

What is the command to create a MySQL deployment from its YAML file?

kubectl create -f mysql-deployment.yaml

83
New cards

What command is used to create the MySQL deployment?

$ kubectl create -f mysql-deployment.yaml

84
New cards

What command verifies persistent volumes in Kubernetes?

$ kubectl get pv

85
New cards

What command verifies persistent volume claims in Kubernetes?

$ kubectl get pvc

86
New cards

What command checks the status of deployments in Kubernetes?

$ kubectl get deployments

87
New cards

What is the purpose of a Kubernetes Service?

To provide a stable IP address that decouples from pods, allowing applications to connect to services without needing to track changing pod IPs.

88
New cards

What command is used to create the MySQL service?

$ kubectl create -f mysql-service.yaml

89
New cards

What command checks the details of a specific service in Kubernetes?

$ kubectl describe svc/mysql-service

90
New cards

What command is used to list all created pods in Kubernetes?

$ kubectl get pods

91
New cards

What does the 'selector' field in the service definition do?

It defines which pods the service targets based on matching labels.

92
New cards

What are some considerations for deploying a production-ready Kubernetes cluster?

High availability, robust and scalable networking, and multi-site support.

93
New cards

What is the role of kubelet in a Kubernetes cluster?

To manage the pods and containers on a node.

94
New cards

What should be restricted to enhance security in a Kubernetes cluster?

Direct access to cluster nodes, either physical or through SSH.

95
New cards

How can Kubernetes handle node failures?

By using external load balancers to redirect traffic to healthy nodes.

96
New cards

What is the recommended way to monitor services on the master node?

Implement process watchers to monitor the health of services.

97
New cards

What does Kubernetes allow regarding node management?

Adding and removing nodes dynamically.

98
New cards

What is Stratoscale Symphony?

A cloud infrastructure solution providing Kubernetes-as-a-Service for easy cluster management.

99
New cards

What is the first step in creating a new Kubernetes cluster using KubeCtl?

Assign storage and network for the cluster.

100
New cards

What is the significance of the floating IP in a Kubernetes cluster?

It serves as the cluster's endpoint for network access.