Kubernetes Engine Flashcards
What is Kubernetes Engine?
It is GCP’s managed Kubernetes service.
What are some key points of Kubernetes Engine?
- can create and maintain clusters without having to manage the Kubernetes platform
- Kubernetes runs containers on a cluster of VMs
- Similar to instance groups except Kubernetes can run different images and it uses containers
- Allows the user to describe the compute, storage and memory resources needed to run their services
- In between App Engine and Compute Engine in terms of deployment speed and management requirements.
- Only supports Docker
- Automatic load balancing and scaling.
- Automatic software updates with no downtime
- Automatic health checks & logging (Stack Driver)
- All traffic orchestrated by the master Kubernetes controller
What is a container?
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?)
What are some key points of Kubernetes Engine Cluster Architecture?
- A Kubernetes cluster consists of a cluster master and one or more nodes
- The cluster master can be replicated and distributed for high availability and fault tolerance
- The Cluster master manages services provided by Kubernetes.
- Nodes execute the workloads run on the cluster
- 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
What does cluster master manage and how can users issue commands to it?
- Kubernetes API, controllers and schedulers
- All interaction with nodes goes through master
- Master issues commands that perform an action on a node
Users can issue commands via kubectl command
What is a node and what are some key points?
- Nodes are VMs that run containers configured to run an application.
- They are primarily controlled by cluster manager but some commands can be run manually.
- Nodes run an agent called kubelet which is a service that communicates with the cluster manager.
- The vm created runs specialized OS optimized to run containers
List 6 Kubernetes objects
- Pods
- Services
- Replica Set
- Deployment
- Stateful Sets
- Jobs
What is a pod and what are some key points?
A pod is a single instance of a running process in a cluster
- They contain at least one container. usually one, but can run multiple
- 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 - 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
- the pod treats multiple containers as a single entity for management purposes
- They are usually created in group.
- Pods support auto-scaling
- Ephemeral - they are expected to terminate
- A controller manages health monitoring and scaling
What are services (Kubernetes Engine)?
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.
Why should services that depend on pods not be tightly coupled to particular pods?
Pods are ephemeral and their IP may change
What is a Replica Set?
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.
What is a Deployment (Kubernetes Engine)?
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)
What states can a Kubernetes Deployment be in?
- Progressing - in the process of performing a task
- Completed - roll out of containers is complete and all pods are running the latest version of containers
- Failed - deployment process encountered a problem it could not recover from
What is a Stateful Set (Kubernetes Engine)?
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
What is a Job (Kubernetes Engine)?
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.