Basic Kubernetes Components

Jagadeesh Marali
2 min readFeb 14, 2021

There are many components in Kubernetes but in this blog, I would like to discuss some basic components like

  1. Pods
  2. Service and Ingress
  3. ConfigMap and Secrets
  4. Volumes
  5. Deployment and StatefulSet

Pods: It is the Abstraction over the containers(for example it might be the frontend, backend, or some DB) and it is the smallest unit of the Kubernetes Cluster.

Service and Ingress: In the above, the pods are created and they need to talk to each other, this is done by assigning some static or permanent IP address and some DNS name in the service. If the pod gets crashed, the service doesn’t get affected. Now the IP address which is created in the service is internal. Now we can talk to these pods from the external world with the help of ingress (as we cannot talk to websites in this way “http://someIp:port” in the external world right. so when you request some website it first talks to ingress and then ingress forwards to some internal service.). Service sometimes acts as a load balancer where there are more replicas of a pod.

ConfigMap and Secrets: It’s just an external configuration for your application. As we cannot keep some credentials like username and password in the plain text format in ConfigMap, so we keep them in the secrets which stores secret data like username, password and some certificates in base64 format which is encoded.

Volumes: What it basically does is attach physical storage on a hard drive to your pod, that storage may be outside the Kubernetes cluster or local storage or some cloud storage.

Deployment and StatefulSet: Let us assume now that pods are created and they are attached to service and all configurations are done. Now due to some heavy requests or some other issues, a particular pod has been crashed and now you can access that pod, which is not good at all. so instead of relying on a single pod, we make replicas of pods. This is done by a component called deployment, generally, you will not be creating pods, you will be creating deployments. we can say that deployment is an abstraction layer on pods. And one thing you need to observe is that we can’t replicate databases by Deployment because they maintain some state. So we do this with the help of StatefulSet. Generally, you can say that we use Deployment for stateless applications and StatefulSet for databases or stateful applications.

Note: Generally people host databases outside of K8s cluster.

My References:

  1. https://www.udemy.com/course/google-certified-associate-cloud-engineer/
  2. https://cloudacademy.com/learning-paths/google-associate-cloud-engineer-exam-preparation-844/

(If am wrong anywhere, am ready to correct and ready to listen. let’s Learn together 🙂.)

If you enjoyed reading this blog, please consider buying me a coffee to show your support. It would mean a lot to me and help me continue creating content that you love. https://www.buymeacoffee.com/jagadeeshmarali

--

--