Architecture Flashcards
What is Kubernetes basically?
An orchestrator for microservice apps
What is a microservice app?
It is a name for an application that’s made up of lots of small and independent services.
How does Kubernetes basically works?
It organizes things so that they work on the right networks with the right secrets. That is called orchestration.
How does a typical K8s cluster look like?
It has masters and nodes. Masters are in charge and decide which node does what. Nodes do the work.
How do we package code for Kubernetes?
We have Kubernetes deployment where we define the process inside a yml file. It tells K8s how our app should like e.g. ports, how many replicas. We give the file to master in Kubernetes and it deploys the app on the cluster
Describe the platform agnostic property of K8s
It is platform agnostic. It runs on Linux but it is not interested on which platform this Linux runs; bare metal or VM etc.
How is master structured?
It’s a bunch of moving parts. They all run on a single server. We don’t run user workloads on master, it orchestrates nodes.
What is kube-apiserver (apiserver)?
It is the front-end to the control plane. It’s the only master component that we should be talking to so also known/called as master. It exposes a RESTful API and it consumes JSON. By default it exposes on port 443
What is cluster store?
If the apiserver is the brain of the master, that’s the memory of it. The config and the state of the cluster is persistently stored here. It uses etcd as Cluster Store
What is etcd?
etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines.. KV store is a noSQL database. It’s distributed, consistent and watchable.
What is kube-controller-manager?
It’s the controller of controllers. At the moment it implements some features like Node controller, Endpoints controller, Namespace controller. These controllers watch for changes and help maintain desired state. They are all controlled by controller manager.
What is kube-scheduler?
This watches api-server for new pods and assigns work to nodes. It has to think about a lot of things like affiity/anti-affinity, constraints, resources etc.
What are nodes?
A.k.a. Minions. They are K8s workers. There are basically 3 components that we care about; kubelet, container runtime and the kube proxy.
What is Kubelet?
It is the main Kubernetes agent on Node and referred as Node. Registeres node with cluster. Watches the apiserver on master for work assignments. Any time it sees one, it carries out the task and reports back to master. Instantiates pods????? If the pod fails for some reason, it reports back to master and it does not try to restart it or find another node to run it. It’s masters responsibility to make decision at that point. It exposes and endpoint at localhost on port 10255 (it lets you inspect the spec of the Kubelet). /spec end point gives some info, /healthz for health check and /pods for running pods and much more.
What does Container Engine do?
It does container management like pulling images, starting/stopping containers, etc. It’s usually docker but its pluggable and can be rkt if one wants.