Getting Started With Kubernetes - Basic Concepts Of Kubernetes

avatar

This is the first in a series in getting started with Kubernetes. We will start with an overview of what makes up a the environment and go further into depth in our next posts.

ETCD


Etcd is a distributed and reliable key value store, which is run on port 2379 and can use the etcdctl client to work directly with the key value store. In kubernetes etcd cluster is used to store all the relevant information for the kubernetes environment including the nodes, pods, configs, secrets, accounts, etc. You can set up etcd from scratch, using the binaries, or using kubadm. When setting up etcd, make note of the “advertised client url” which is the IP address of the server and port 2379. “initial cluster” will set the different functions in the cluster.

Schedulers


These are responsible for scheduling pods on nodes. The scheduler only decides which node the pod will go on, and it is up to the node to create the pod. The scheduler will rank nodes giving them a score based on the available resources and will assign pods to the nodes that are ranked higher.

Manual Scheduling - There may be situations where there is no scheduler, your pods will stay in a Pending state, so you will need to manually set the node name on your pod definition file. There is an unspecified field called “nodeName” that will need to be set, for example:

nodeName: node02

Kube API Server


This is the primary management component in kubernetes. It is responsible for authenticating users, validating requests, retrieving data, updating etcd, scheduling and kubelet. It is the only component that interacts directly with the etcd datastore.

Kube Controller Manager


This manages various controllers in kubernetes. Controllers have a set of their own responsibilities, and are process that continuously monitor the state of various components running on the system and its goal is to get the cluster running to the desired state.

Kubelet


Kubelet will perform the work on the nodes, it will register the node with the cluster, will request the run time engine to get the image and run it on the node. It will then monitor the container running on the node.

Kube-Proxy


This allows pods to reach and communicate with every other pod in the cluster. It is a process running on each node and looks for new services being created. When a new service is created, it will create a rule to allow traffic to be forwarded across the cluster.

Pods


Our aim is to deploy our application onto kubernetes. We do not deploy containers directly on the workers, they are encapsulated in pods. It is the smallest object you can create in kubernetes. Pods usually have a one to one relationship with the container running your application. To scale up your application, you add additional pods, instead of adding containers to your pod. A single pod can have multiple containers, but when this happens, they are not usually containers of the same kind. In cases you might have a helper container that may live along side your application container.

ReplicaSets and ReplicationController


Even if you have a single pod, you will still have a replication controller as it will bring up a new pod if the only pod running fails. Replication controllers will also be able to spin up additional pods when the demand is needed. Replication controller is being replaced by ReplicaSet.

Deployments


A kubernetes object that allows us to upgrade underlying instances seamlessly. A definition for a deployment is the same a replicaset but instead of the kind being replicaset, it is deployment. The definition will automatically create a replicaset as well as the deployment.

Services


Enable communication between components applications within kubernetes and outside of kubernetes. Services enable loose coupling between micro services in our application. A service is an object in our kubernetes cluster and can listen to requests on a specific port and forward those requests to a port on the pod running an application. Types of services include, NodePort, ClusterIP and Loadbalancer.

NameSpaces


Namespaces are used to isolate and organise your cluster. Resources in the namespace can refer to each other simply by their name. To refer to a service in another namespace, you would need to use service, then the namespace…To be more specific, it is
<service_name>.<namespace>.svc.cluster.local.

“cluster.local” is the default domain name for the cluster. The default namespace is created automatically when the cluster is created.

Daemonsets


These are like replica sets, but will make sure one copy of your pod is running on each node in your cluster. These are perfect for log monitoring agents on your cluster or a networking solution.

I told you it would be quick and dirty, but this should just be the start of a long run of posts to get you started using kubernetes.

About The Author
I am a DevOps Engineer, Endurance Athlete and Author. As a DevOps Engineer I specialize in Linux and Open Source Applications. Particularly interested in Search Marketing and Analytic’s, and is currently developing my skills in devops, continuous integration, security, and development(Python).

Posted with STEMGeeks



0
0
0.000
3 comments
avatar

I was thinking these days to learn a bit about it
Thanka for bringing it
!1UP


0
0
0.000