Podcast
Questions and Answers
What is the primary function of Kubernetes?
What is the primary function of Kubernetes?
- Automating deployment, scaling, and management of containerized applications (correct)
- Designing new programming languages
- Managing network infrastructure
- Creating virtual machines
In Kubernetes, what is a node?
In Kubernetes, what is a node?
- A virtual network
- A single container instance
- A storage volume
- A physical or virtual machine (correct)
Which of the following best describes 'Orchestration' in the context of a multi-host environment?
Which of the following best describes 'Orchestration' in the context of a multi-host environment?
- The manual configuration of network settings
- The automated coordination, management, and organization of tasks and services (correct)
- The process of data encryption
- The physical layout of server racks
What is the function of 'Resource Management' in a Kubernetes environment?
What is the function of 'Resource Management' in a Kubernetes environment?
What is a 'container' in the context of Kubernetes?
What is a 'container' in the context of Kubernetes?
What underlying infrastructure does the docker provide for clusters?
What underlying infrastructure does the docker provide for clusters?
What is the purpose of grouping containers into logical units?
What is the purpose of grouping containers into logical units?
What does Native Computing Foundation manage?
What does Native Computing Foundation manage?
Which of the following is a key difference between Kubernetes and Docker Swarm Mode (DSM)?
Which of the following is a key difference between Kubernetes and Docker Swarm Mode (DSM)?
What does it mean for Kubernetes to have a 'broader community' compared to Docker Swarm Mode (DSM)?
What does it mean for Kubernetes to have a 'broader community' compared to Docker Swarm Mode (DSM)?
Which of the following is a declarative deployment?
Which of the following is a declarative deployment?
What is the purpose of the control plane?
What is the purpose of the control plane?
What Kubernetes component is responsible for managing and scheduling workloads?
What Kubernetes component is responsible for managing and scheduling workloads?
In Kubernetes architecture, what is the role of Worker Nodes?
In Kubernetes architecture, what is the role of Worker Nodes?
What is 'etcd'?
What is 'etcd'?
What is a primary function of the kube-scheduler
component in Kubernetes?
What is a primary function of the kube-scheduler
component in Kubernetes?
What is the role of a 'Node controller'?
What is the role of a 'Node controller'?
What is a 'replication controller' responsible for?
What is a 'replication controller' responsible for?
What is the primary role of the kubelet
in a Kubernetes node?
What is the primary role of the kubelet
in a Kubernetes node?
What is the primary function of kube-proxy
?
What is the primary function of kube-proxy
?
What is the main function of a Container runtime?
What is the main function of a Container runtime?
What is the meaning of 'Desired State'?
What is the meaning of 'Desired State'?
In Kubernetes, what is the role of 'Controllers'?
In Kubernetes, what is the role of 'Controllers'?
What is the function of a Kubernetes object?
What is the function of a Kubernetes object?
In Kubernetes, what do abstractions typically represent?
In Kubernetes, what do abstractions typically represent?
What is the purpose of Kubernetes labels?
What is the purpose of Kubernetes labels?
What is kubectl
used for?
What is kubectl
used for?
What are the State-Focused characteristics?
What are the State-Focused characteristics?
What is minikube
?
What is minikube
?
What is the function of addons?
What is the function of addons?
What is the main purpose of Kubernetes namespaces?
What is the main purpose of Kubernetes namespaces?
What objects need to be unique?
What objects need to be unique?
Which kubectl
command is use to check available namespace?
Which kubectl
command is use to check available namespace?
What objects can ConfigMap
inject data into?
What objects can ConfigMap
inject data into?
What is the main purpose of a ConfigMap in Kubernetes?
What is the main purpose of a ConfigMap in Kubernetes?
For what use cases are Kubernetes Services designed?
For what use cases are Kubernetes Services designed?
In Kubernetes, what is a Service selector used for?
In Kubernetes, what is a Service selector used for?
Which service assign a service inside your cluster that other apps can access?
Which service assign a service inside your cluster that other apps can access?
What is ExternalName
service for?
What is ExternalName
service for?
What's the domain form?
What's the domain form?
What is the main advantage of using Kubernetes for containerized applications?
What is the main advantage of using Kubernetes for containerized applications?
In Kubernetes, what is the role of a 'node'?
In Kubernetes, what is the role of a 'node'?
What is the purpose of 'orchestration' in the context of multi-host environments?
What is the purpose of 'orchestration' in the context of multi-host environments?
What does 'resource management' in Kubernetes primarily focus on?
What does 'resource management' in Kubernetes primarily focus on?
In Kubernetes, what does a 'container' typically encapsulate?
In Kubernetes, what does a 'container' typically encapsulate?
What is the main goal of grouping containers into 'logical units'?
What is the main goal of grouping containers into 'logical units'?
What is a 'declarative deployment' in Kubernetes?
What is a 'declarative deployment' in Kubernetes?
What is the function of the Kubernetes control plane?
What is the function of the Kubernetes control plane?
In Kubernetes architecture, what executes the actual workloads in the form of containers?
In Kubernetes architecture, what executes the actual workloads in the form of containers?
What is stored in etcd
?
What is stored in etcd
?
What is the kube-scheduler
responsible for?
What is the kube-scheduler
responsible for?
What is the primary role of kubelet
?
What is the primary role of kubelet
?
What is the role of a Container runtime?
What is the role of a Container runtime?
What does the term 'Desired State' refer to in Kubernetes?
What does the term 'Desired State' refer to in Kubernetes?
What is the role of 'Controllers' in maintaining the 'Desired State'?
What is the role of 'Controllers' in maintaining the 'Desired State'?
What is the general purpose of a Kubernetes object?
What is the general purpose of a Kubernetes object?
What do Kubernetes abstractions typically represent?
What do Kubernetes abstractions typically represent?
What is the use of labels in Kubernetes?
What is the use of labels in Kubernetes?
What is kubectl
?
What is kubectl
?
What is the general function of Kubernetes addons?
What is the general function of Kubernetes addons?
Why are Kubernetes namespaces used?
Why are Kubernetes namespaces used?
Within a single namespace, what needs to be unique?
Within a single namespace, what needs to be unique?
What command lists available namespaces?
What command lists available namespaces?
What is the main feature of ConfigMaps in Kubernetes?
What is the main feature of ConfigMaps in Kubernetes?
What can ConfigMaps be injected into?
What can ConfigMaps be injected into?
Kubernetes Services are primarily used by which entities to access your application?
Kubernetes Services are primarily used by which entities to access your application?
What do Kubernetes Service selectors primarily define?
What do Kubernetes Service selectors primarily define?
Which Kubernetes Service type assigns a service inside your cluster that other applications can access?
Which Kubernetes Service type assigns a service inside your cluster that other applications can access?
What is the purpose of the ExternalName
service in Kubernetes?
What is the purpose of the ExternalName
service in Kubernetes?
What is the correct format for domain names?
What is the correct format for domain names?
What does Kubernetes automate in addition to deployment and scaling?
What does Kubernetes automate in addition to deployment and scaling?
What is the Kubernetes term are multiple machines referred to as?
What is the Kubernetes term are multiple machines referred to as?
In Kubernetes, what does grouping containers into logical entities facilitate?
In Kubernetes, what does grouping containers into logical entities facilitate?
What is a characteristic of Kubernetes relative to Docker Swarm regarding community support?
What is a characteristic of Kubernetes relative to Docker Swarm regarding community support?
What happens during Desired State reconciliation?
What happens during Desired State reconciliation?
In Kubernetes, what are the worker machines responsible for?
In Kubernetes, what are the worker machines responsible for?
What watches for newly created pods without an assigned node?
What watches for newly created pods without an assigned node?
What is a key function of the Node controller
?
What is a key function of the Node controller
?
What does a Kubernetes object represent?
What does a Kubernetes object represent?
Why are Kubernetes labels used?
Why are Kubernetes labels used?
What does Kubernetes ConfigMaps allow you to do?
What does Kubernetes ConfigMaps allow you to do?
What are Kubernetes Services designed primarily to do?
What are Kubernetes Services designed primarily to do?
What does the Kubernetes Service selector define?
What does the Kubernetes Service selector define?
For internal cluster communications, which Kubernetes Service type should you use?
For internal cluster communications, which Kubernetes Service type should you use?
What is the correct structure of a domain?
What is the correct structure of a domain?
What is the primary benefit of using Kubernetes for managing containerized apps?
What is the primary benefit of using Kubernetes for managing containerized apps?
Within a Kubernetes namespace, what type of object name needs to be unique?
Within a Kubernetes namespace, what type of object name needs to be unique?
Flashcards
Orchestration
Orchestration
Automated coordination, management, and organization of tasks across multiple distributed computing nodes.
Resource Management
Resource Management
Coordinated and efficient allocation, scheduling, and control of resources across multiple computational nodes.
Kubernetes (K8s)
Kubernetes (K8s)
An open-source system for automating deployment, scaling, and management of containerized applications.
Routing Rules
Routing Rules
Signup and view all the flashcards
Name-based virtual hosting
Name-based virtual hosting
Signup and view all the flashcards
maxSurge
maxSurge
Signup and view all the flashcards
maxUnavailable
maxUnavailable
Signup and view all the flashcards
Controller
Controller
Signup and view all the flashcards
Kube-apiserver
Kube-apiserver
Signup and view all the flashcards
etcd
etcd
Signup and view all the flashcards
kube-scheduler
kube-scheduler
Signup and view all the flashcards
Kubelet
Kubelet
Signup and view all the flashcards
Kube-proxy
Kube-proxy
Signup and view all the flashcards
PersistentVolume
PersistentVolume
Signup and view all the flashcards
PersistentVolumeClaim
PersistentVolumeClaim
Signup and view all the flashcards
StorageClass
StorageClass
Signup and view all the flashcards
Kubernetes Service
Kubernetes Service
Signup and view all the flashcards
ClusterIP
ClusterIP
Signup and view all the flashcards
NodePort
NodePort
Signup and view all the flashcards
ExternalName
ExternalName
Signup and view all the flashcards
kube-dns
kube-dns
Signup and view all the flashcards
Service DNS resolution
Service DNS resolution
Signup and view all the flashcards
Declarative service model
Declarative service model
Signup and view all the flashcards
Desired State Reconciliation
Desired State Reconciliation
Signup and view all the flashcards
Cluster State
Cluster State
Signup and view all the flashcards
Study Notes
Topic Subtitle
- Kubernetes groups containers that constitute an application together into logical units for easy management and discovery
- The focus is not on single containers, but objects with different granularities within them
- Kubernetes includes objects and API extensions where you can customize to manage new things
What is Orchestration?
- Orchestration refers to the automated coordination
- It is the management, and organization of tasks and services across multiple distributed computing nodes
- It ensures these components work together to achieve a desired functionality or workflow
What is Resource Management?
- It refers to the coordinated and efficient allocation, scheduling, and control of resources
- Resources include CPU time, memory, storage, and network bandwidth across multiple computational nodes.
What is Kubernetes (K8s)?
- (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications
- Containerized applications run across multiple machines referred to as nodes
- K8s builds upon 15+ years of experience running production workloads with ideas and best practices from the community
- K8s uses docker for clusters of machines and abstracts away the underlying infrastructure, OS for clusters
- K8s has a cloud-native ecosystem that is managed by the Cloud Native Computing Foundation
Important Note
- In this presentation, workload and application are are synonymous
K8s vs Docker Swarm Mode (DSM)
- K8s is more complex than Docker Swarm to setup
- K8s is a CNCF project with a broader community, and it is production-ready
- K8s has a steeper learning curve
- K8s is able to work with multiple container runtimes
Kubernetes Features that DSM Does Not
- Scheduler
- Stateful sets
- etc
Docker Swarm Features
- DSM has limited fault tolerance
- DSM integrates smoothly with the Docker CLI and Docker Compose
Kubernetes Scaling
- K8s provides autoscaling at the container and even the node level, while DSM scaling is only manual
Kubernetes API
- K8s has general and extensible API
Two Types of State
- K8s has a declarative service model lets you define the desired state of the various services in your application stack
- K8s monitors the cluster state and reconciles differences between the actual state and your expressed desired state
Kubernetes Technical Functionalities
- Manage different types of workloads for flexibility
- Includes multi-host Networking, Service Discovery, and Load Balancing
- Includes automatic Workload Placement for efficiency
- Implements auto-remediation for fault tolerance, resilience and reliability
- Horizontal and Vertical Scaling for elasticity
- Improved security
- A/B and Canary Deployments for testing
Kubernetes Architecture
- Implements manager-worker architecture
- The Control Plane (manager) is responsible for managing the state of the Kubernetes cluster, scheduling workloads, and handling the overall orchestration
- Worker Nodes (workers) run the actual workloads in the form of containers.
- A Kubernetes cluster is a collection of machines, called nodes, running containers
- The Control Plane Node(s) manage the Worker Nodes and everything that happens within the cluster
- Multiple Control Plane Nodes are used to ensure high-availability and failover capability of the cluster
Kube API Server
- Exposes the Kubernetes API and is the front end for the Kubernetes control plan
- Horizontally scalable
Etcd
- Consistent an highly available key value store that holds object definitions
- Backing store for all cluster data
Kube Scheduler
- It watches for newly created containers with no assigned node to select a node for them to run on, by considering
- Individual and collective resource requirements Hardware and software policy constraints Affinity and anti-affinity specifications
Controller Manager
- Runs controller processes
- Each controller is its own process
- Controller's include: node controller, replication controller and service account/token controllers
Cloud Controller
- Embeds cloud-specific control logic
- Links the cluster into the cloud provider's API, and separates out the components that interact with that cloud platform
Kubelet
- Node component that has the local, control plane agent that executes and monitors containers
- Responsible for workload management
Kube Proxy:
- Node component for Network proxy that implements part of the Service concept
- Creates and maintains network rules on nodes
High Level Kubernetes Tasks
- It makes global decisions about the cluster as well as detecting and responding to cluster and application events
- Control Plane components make the cluster’s current state match the desired state by reacting to events
- Automatically starting or restarting containers or pods
- Scaling the number of replicas of a given application or nodes
Terminology
- Desired state == what you want to run, what container images they use, the number of replicas, what network and disk resources you want to make available, and more
- Users describe the cluster’s desired state via textual descriptions or declarative model Controllers - will automatically manage your cluster to match the desired state
Kubernetes Objects - Abstractions
- Kubernetes objects represent the state of the system and is usually an application's component
- They have volume, a name-space and a node as part of the base objects
- Common elements support any type of workload through higher level abstractions that include: deployment,stateful set, daemon set, replica set and jobs
Key Aspect of Kubernetes Objects
- Kubernetes objects are a record of intent
- Once created, the Kubernetes system will constantly work to ensure that object exists
- By creating an object, tell k8s that you want your cluster's workload to look like and that is your cluster's desired state
Pod
- Basic execution unit of any Kubernetes application, and the smallest and simplest unit in the Kubernetes object model that you create or deploy
- Represents processes/components running on the cluster
- Composed by either a single container or a small number of containers that are tightly coupled and that share resources
- A Pod encapsulates an application’s container (or multiple ones), storage resources, a unique network IP, and options that govern how the container(s) should run
Kubernetes Declarative Model
- The declarative model is a way to describe an object
- It is where you define what the system should look like
- K8s ensures that the cluster matches this state regardless of the current state
Kubernetes Key Tool: Kubectl
- supports 3 kinds of managed objects
- imperative commands, declarative object configuration and YML, JSON manifest files
- Includes a Kind for Pod, Deployment, Replication Controller, Job, Service
- Includes labels for key values tagged to deployable objects
- Selectable through actions and other declarations
- Specification declares pod configuration that might include fields managed by k8s
Idempotency
- Re-applying the same configuration file does not cause unnecessary changes if the cluster already matches the desired state
Version Control Friendly
- Declarative configurations are written in files, which can be version-controlled, enabling consistent management and tracking of changes, making it automation ready
Minikube Functionalities
- Implements with a local Kubernetes cluster on macOS, Linux, and Windows
- Best tool for local K8S application development and that supports all features that fit
- Runs with support for standard features
Kubernetes Preliminary Steps
- Start minikube with
minikube start
- Get list of nodes with
kubectl get nodes
- Get the list of available addons with
minikube addons list
- Enable Kubernetes Dashboard with
minikube addons enable dashboard
- Open the dashboard with
minikube dashboard --url
- then, navigate to the dashboard url and check the available namespace with
kubectl get namespaces
Kubernetes Addons
- The Addons use Kubernetes resources to implement cluster features
- Resources for addons belong within the
kube-system
namespace, such as: - DNS to launch a DNS Pod and Service to resolve DNS names
- A web UI dashboard that allows users to manage and troubleshoot applications and the cluster itself
- Cluster level logging that is responsible saves container logs to a central log store
Kubernetes NameSpaces
- They use Kubernetes resources to implement cluster features, and belong located in the
kube-system
namespace. Some include:- DNS: Which Kubernetes uses to to launch a DNS Pod and Service on the cluster, and configures the kubelets to tell individual containers to use the DNS Service's IP to resolve DNS names
- A Web UI Dashboard, that allow users to manage and troubleshoot applications running in the cluster, as well as the cluster itself
- And Cluster-level Logging, that is responsible for saving container logs to a central log store with search/browsing interface
- The namespaces provide a scope for applications where Names of resources need to be unique within a namespace, but not across namespaces.
Common NameSpaces:
- the default Namespace
- Any default is for any object without a namespace
- Then, Kube-system acts as the home for objects and resources created by Kubernetes itself
- All objects can be handled through the kube node-lease, which is a special namespace that is readable by all users and is reserved for cluster bootstrapping and configuration.
Exercise 1: Create First Pod
- Start the process by running
kubectl run my-pod --image=miciav/hello-go:1.0.0
- Make sure the program worked properly by listing it with,
kubectl get pods
- You can also open up an instance the shell from inside the pod, by calling it with
kubectl exec -it my-pod -- sh
- Now expose the pod port to the host system with,
kubectl port-forward my-pod 8080:8180
and visit in a web browser 127.0.0.1 port, NOTE This is only for debugging and developing purposes To remove, call it with the command:kubectl delete pod my-pod
Declarative Model With Kubernetes
- Start with entering a directory
- Run it:
kubectl apply -f 00_es01_nginx_pod.yml
- Use the same command as above to visualize what is going on through:
watch kubectl get pods nginx and then kubectl describe pods nginx
- To view the contents open a file or use
kubectl exec nginx to print out the environment variables
- Call port forward to have it working in our local system
Update Pod and Create Configuration by using
kubectl create configmap nginx-data --from-file index.html
- Make sure it works properly by calling it by describing it
describe configmaps nginx-data
- Delete a configuration you don't need by, calling with
kubectl delete configmaps nginx-data
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Kubernetes is an open-source system that automates the deployment, scaling, and management of containerized applications. It groups containers into logical units for easy management and discovery, focusing on objects with different granularities. Kubernetes also includes objects and API extensions for customized management.