Kubernetes Engine Flashcards

1
Q

What is Kubernetes Engine?

A

It is GCP’s managed Kubernetes service.

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

What are some key points of Kubernetes Engine?

A
  1. can create and maintain clusters without having to manage the Kubernetes platform
  2. Kubernetes runs containers on a cluster of VMs
  3. Similar to instance groups except Kubernetes can run different images and it uses containers
  4. Allows the user to describe the compute, storage and memory resources needed to run their services
  5. In between App Engine and Compute Engine in terms of deployment speed and management requirements.
  6. Only supports Docker
  7. Automatic load balancing and scaling.
  8. Automatic software updates with no downtime
  9. Automatic health checks & logging (Stack Driver)
  10. All traffic orchestrated by the master Kubernetes controller
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a container?

A

Highly-portable, light weight way of distributing and scaling apps and workloads without replicating the quest OS. It starts and stops more quickly and uses less resources (than a VM?)

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

What are some key points of Kubernetes Engine Cluster Architecture?

A
  1. A Kubernetes cluster consists of a cluster master and one or more nodes
  2. The cluster master can be replicated and distributed for high availability and fault tolerance
  3. The Cluster master manages services provided by Kubernetes.
  4. Nodes execute the workloads run on the cluster
  5. Specify machine type when creating a cluster. Some of the memory and CPU is reserved for Kubernetes, so not all is available for the node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does cluster master manage and how can users issue commands to it?

A
  1. Kubernetes API, controllers and schedulers
  2. All interaction with nodes goes through master
  3. Master issues commands that perform an action on a node

Users can issue commands via kubectl command

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

What is a node and what are some key points?

A
  1. Nodes are VMs that run containers configured to run an application.
  2. They are primarily controlled by cluster manager but some commands can be run manually.
  3. Nodes run an agent called kubelet which is a service that communicates with the cluster manager.
  4. The vm created runs specialized OS optimized to run containers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List 6 Kubernetes objects

A
  1. Pods
  2. Services
  3. Replica Set
  4. Deployment
  5. Stateful Sets
  6. Jobs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a pod and what are some key points?

A

A pod is a single instance of a running process in a cluster

  1. They contain at least one container. usually one, but can run multiple
  2. Use shared networking and shared storage across containers
    - Each pod gets a unique IP and set of ports
    - Containers connect to a port
    - multiple containers within a pod connect to different ports and can talk via localhost
  3. A pod allows its containers to behave as if they were running on an isolated VM, sharing common storage, one IP and a set of ports. This allows deploying multiple instances of the same application or different instances of the same application on the same node without having to change their configuration
  4. the pod treats multiple containers as a single entity for management purposes
  5. They are usually created in group.
  6. Pods support auto-scaling
  7. Ephemeral - they are expected to terminate
  8. A controller manages health monitoring and scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are services (Kubernetes Engine)?

A

A service provides API end points with a stable IP address and allows applications to discover pods running a particular application. Services update when changes are made to a pod, in order to maintain an up to date list of pods running an application. Services that depend on pods should not be tightly coupled to particular pods.

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

Why should services that depend on pods not be tightly coupled to particular pods?

A

Pods are ephemeral and their IP may change

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

What is a Replica Set?

A

A controller used by deployment to ensure the correct number of identical pods is running. If a pod is unhealthy, it will be terminated. If not enough pods are running, one will be created.

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

What is a Deployment (Kubernetes Engine)?

A

A deployment is set of identical pods that are created using a pod template. A pod template is a definition of how to run a pod. The description of how to define the pod is a pod specification. Kubernetes uses this definition to keep the pod in the state defined by the template (e.g add pods to ensure a minimum set in the template)

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

What states can a Kubernetes Deployment be in?

A
  1. Progressing - in the process of performing a task
  2. Completed - roll out of containers is complete and all pods are running the latest version of containers
  3. Failed - deployment process encountered a problem it could not recover from
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a Stateful Set (Kubernetes Engine)?

A

Most deployments are stateless. Stateful sets are like deployments, but a unique id is assigned to the pods. This allows Kubernetes to track which pod is used by which client, It is used when an application needs a unique network identifier or stable persistent storage

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

What is a Job (Kubernetes Engine)?

A

A job is an abstraction about a workload. Jobs create pods and run them until the application completes a workload. Job Specs are in a config file and include specs about the container to use and the command to run.

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

What is Kubernetes engine good for?

A
  1. Good option for running applications that depend on multiple micro services
  2. Good choice for large scale applications that require high availability and high reliability
17
Q

What are key points of Container Orchestration?

A
  1. Provides load balancing across Compute Engine VMs that are deployed in a Kubernetes cluster
  2. Automatic scaling of nodes in the cluster
  3. Automatic upgrade of cluster software as needed
  4. Node monitoring and health repair
  5. Logging
  6. Support for node pools ( collections of nodes with the same configuration)
  7. Supports eviction policies which sets threshold for resources and shuts down pods when threshold is surpassed
18
Q

Compare Kubernetes Engine and Compute Engine.

A
  1. KE is similar to running VMs, but rather than using hypervisor to separate the computing resources, a container manager is used.
  2. No additional guest OSes run on top of the container manager
  3. Containers make use of host OS functionality
  4. OS and container manager ensure isolation between running containers
19
Q

How do you deploy a Kubernetes Cluster? (console and shell)

A

Create a cluster under KE -> Clusters : select zone/region/ machine template/ number node pools. KE runs a number of workloads to manage the cluster. You can view them in the workloads page

gcloud container clusters create [NAME]

Parameters include project, zone, machine type, image disk type, disk size, number of nodes

Command to create a cluster can be very long. It’s better to select a template from the console and it will give you the necessary command

20
Q

How do you deploy an Application Pod ? (console and shell)

A

From Cluster page of KE, select Create a Deployment. Specify container image, environment variables, initial command, application name, labels, namespace and cluster to deploy to.

Once deployed you can display the corresponding YAML specification of the deployment which can be saved and used to create deployments from the command line.

kubectl run [DEPLOMENT NAME] –image=[DOCKER IMAGE NAME] –port=[PORT]