What is Kubernetes
Kubernetes is a software for containers management, which allows to automatize containers administration, monitoring, deployment and scaling of applications inside containers.
Kubernetes helps to make application always accessible, more suitable for operation under high load, and easily recoverable.
Its goal is to simplify deployment, autorecovery, autoscaling and traffic balancing.
// INFO
Container is isolated and portable software package, containing all required all components required to run certain applications in any environment
What is structure of Kubernetes?
Kubernetes cluster consist of master node with replicas, and multiple worker nodes.
Master node purpose is to manage dependent nodes lifecycle and processes.
Master node consist of few parts:
- Api server
- Controller
- Scheduler
- Etcd storage
What is Ingress in Kubernetes?
An Ingress is a set of rules within a Kubernetes cluster that determines how external traffic accesses services within the cluster.
It allows traffic to be routed to different services within the cluster based on host or path.
Ingress itself is just a config, it does nothing by itself. To make it work, there must be an Ingress Controller in cluster, what will set up proxy / balancer following rules described in config.
Controller itself can be as separate process (Nginx), as in-built in proxy (traefik)
Controller will route and balance traffic over required Services.
What is Service in Kubernetes?
Service is an abstraction over group of pods, what provides single entry point for them. It balances incoming traffic over all pods, that match selector.
What is kube-proxy?
This is node-local kubernetes process, that acts like a load balancer, distributing incoming traffic between pods.
What is kubelet?
Kubelet is node-local controller, purpose of what is to manage pod deployment inside this node and check their status. If there is too many pods inside node - close some of them. If not enough - start new.
What is StatefulSet in Kubernetes?
A StatefulSet is a type of Kubernetes controller designed for deploying stateful applications. It is used instead of a Deployment.
A StatefulSet provides non-random pod IDs that follow a predefined order.
It does not provide replication or data synchronization functionality by itself, this must be implemented separately.
A new pod is created with an index number of +1. When destroying excess pods, they are destroyed in the reverse order of their creation.
A new pod is empty and must be initialized, either within the container image running in the pod or using a special operator, such as Patroni.
What is Deployment in Kuberentes?
Deployment is Kuberenetes resource, that provides automated control over application deployment of certain service, including version update and rollback.
This is abstraction over ReplicaSet. Difference is that Deployment also provides functionality for simple replacement of old pods with new pods with new version of certain resource.
What is headless service in Kuberenetes?
Headless service is such service, that does not provide any in-built balancing and single entrypoint in form of virtual IP. Instead, it just provides list of IPs of inner pods.
What is DaemonSet?
DaemonSet is a special controller, that runs one pod of certain type inside every node or node subset.
Usually, this functionality is used in order to run telemetry / logging / metrics agents.
What is Helm?
Helm is Kubernetes package manager and template engine.
It packs separate manifests into chart, and helps to manage Kubernetes resources in cluster.
What is Helm Chart?
Helm Chart is a package that contains information about application. That are manifest templates, files with default values, metadata and dependencies.
It is used to simplify process of kubernetes config development.
What is Release?
Release is installed instance of Chart inside cluster.
What is Value?
Value is configuration, set in .yaml file, that can be used as value inside templates.
What is Template?
Template is a certain template of certain manifest inside Kubernetes. This template can use things like template values, dependencies etc, and then this template is compiled into Chart using Helm.
What is difference between container and virtual machine?
Well… If to talk in general, both containers and virtual machines purpose is to virtualize certain enviroment, where we run certain processes.
In case of virtual machines, we virtualize everything, including operational system.
In case of containers, we virtualize only environment inside existing operational system.
What is api-server?
This is a gateway between internal functional parts of master node and external world. All interaction with master node & interaction of internal master node parts with external entities is conducted through api server. External users can communicate with it using kubectl
This module watches worker nodes and notifies master node about changes.
What is Kubernetes Controller Manager?
Internal part. Responsible for tracking current cluster state and bringing it to desired state through performing actions with worker nodes.
Intenally implements Deployment, ReplicaSet, StatefulSet, DaemonSet, Jobs, CronJobs controllers
What is ETCD storage?
This is key-value database, what is used in order to store data that we can use in Kubernetes, for example settings & custom parameters.
What is scheduler?
Scheduler is a component purpose of what is to distribute load between worker nodes. It constantly watches worker nodes resources and makes decision about node where new pod should be deployed.
What is ReplicaSet?
ReplicaSet is a Kubernetes controller, purpose of what is to deploy certain number of pods inside Kubernetes cluster.
What is Job?
Job is a Kubernetes resource, that represents single time task.
If task fails, Job will try to restart pod until success or timeout.
After task is successfully finished, Job is considered finished too, and newer runs in cluster again.
How job can be used? For example, in order to set up certain environment. Let’s say, that we want to set up CI/CD that way, that when we create a new branch in our project, then we create a new environment for testing. Job, this case, can be used in order to create and fill databases with all required information, for example.
What is pod?
Pod is smallest Kubernetes entity, what runs containers inside. Can contain multiple containers.
Each pod has its own unique IP-address, and, optionally, dedicated disk volumes.
What is CronJob?
CronJob is a Kubernetes resource that is used in order to run certain Job regularly. This can be used for almost anything: for deleting old entries from DB, for sending messages, or sth else.