Kubernetes
5
min read

Kubernetes for App Developers: Helpful or Overwhelming?

If you are a developer on the planet Earth, chances are you hear about Kubernetes at least 3 times a day. You hear about the greatness of this orchestration system, all the benefits it brings for containerized applications, and how it's the most difficult thing anyone has ever learned. And still doesn't know entirely. 

The goal of this article is to clarify the use cases in which it makes sense to use Kubernetes, some key concepts, and how it works, as well as identify the challenges developers have with Kubernetes and whether this practice really makes their life easier when deploying cloud-native applications. 

In the end, it should help developers understand whether they need and want to start up with Kubernetes.

Why the hype?

Mostly, because of the abstraction. Kubernetes is a platform-independent, open-source system for automating the deployment, scaling, and management of cloud services.

Kubernetes enables you to easily manage containerized apps. This makes it ideal for applications that need to be horizontally scalable such as web applications, big data solutions, or infrastructure services.

Kubernetes abstracts the monotonous tasks developers need to perform to run, maintain and scale cloud services. The benefits of using Kubernetes include:

  • Increased agility and reliability: Kubernetes enables you to quickly deploy new applications and scale your existing ones without having to worry about the underlying infrastructure. 
  • Reduced operational costs: By automating the deployment process, you can reduce the amount of time you spend on manual tasks such as setting up and configuring software tools. 
  • Simplified management: Kubernetes provides an easy-to-use dashboard that lets you monitor all aspects of your cluster in real-time.

It can be used for a variety of purposes such as:

  • Running applications in production, which means that it can guarantee high availability and performance. 
  • Managing resources such as CPU, memory, and storage efficiently. 
  • Automating deployments by using declarative configuration files.

Is Kubernetes for developers or DevOps?

First thing’s first, is Kubernetes for developers at all? What does it bring to the table? Why should developers care? What does it solve? 

Kubernetes is both for developers and DevOps. It was designed to streamline the process of deploying, managing, and scaling applications in a distributed environment. This makes it ideal for use in development and operations environments.

Kubernetes also allows you to use different languages and frameworks to build your applications, making it more versatile and easier to use. Additionally, Kubernetes is highly adopted by all major cloud providers, so even if you need to use some other cloud you can adjust pretty quickly. 

One of the most valuable benefits of this powerful tool is that it provides visibility into application performance and health, making it easier to troubleshoot issues, which is something both developers and operations teams need. 

The integration of Docker with Kubernetes gives you the opportunity to use out-of-the-box solutions with ready functionalities. 

How does Kubernetes work?

There are many components that make up a Kubernetes cluster, but the most important ones are:

  1. A Kubernetes master node is responsible for managing and running the cluster. 
  2. A set of nodes that act as workers or minions and do the actual work of running containers. 
  3. An API server that provides access to the cluster resources to clients (usually a web interface). 
  4. A scheduler that decides when to run containers on which nodes.

To get started with Kubernetes, you first need to install the Kubernetes software on your computer. This can be done by downloading the installer from the Kubernetes website or by using a package manager like apt-get or yum.

Once you have installed Kubernetes, you will need to create a cluster. A cluster is a collection of nodes that work together to provide services for your applications. You can create a cluster by using the kubeadm command-line tool or by using the Kubernetes graphical user interface (GUI).

You can follow this tutorial to create a Kubernetes Cluster in 10 mins with Microtica. 

Once you have created your cluster, you will need to add an application to it. You can add an application by using the kubectl apply command-line tool or by using the Kubernetes GUI. 

Finally, you will need to configure your nodes so that they are ready to run your application. You can do this by setting up networking, setting up storage, and setting up compute resources.

Well that’s easy, right? :)

Challenges developers have with Kubernetes

It's not a coincidence that Twitter memes about Kubernetes are some of the most popular tweets out there. Developers are struggling to setup Kubernetes the right way, even with countless tutorials available. It's an overwhelming and intimidating process, according to some DevOps folks

The most confusing concepts in Kubernetes reported by developers are:

  • Different development process 
  • Bad documentation
  • YAML files 

Let’s try to understand why. 

Different development process 

Kubernetes does not replace traditional development processes and in most cases, it should be added to them. 

Developers love to work locally. They have control, they know their code, how it works, how it performs. ​​Adding containers and microservices and Kubernetes complicates stuff since you can’t run everything locally anymore.

To be able to perform their tasks completely, developers need access to the Kubernetes clusters. This creates complications for DevOps engineers, as they start to lose control of the environment and resources. 

It’s best that organizations have a self-service approach for app developers. This way they can avoid the need for negotiation of resources between developers and operations and ops have control over the infrastructure resources and architecture. They can enforce guardrails, standards, and best practices for cloud-native app deployment.

Bad documentation

https://twitter.com/memenetes/status/1469004179003920391?s=20

Kubernetes is one of the most popular open-source projects, but unfortunately, it has a pretty overwhelming documentation, that can be difficult to use even for experienced engineers. 

Kubernetes is very modular, there are numerous different resources, so the documentation explains rather straightforwardly what these resources are, but the most difficult part is figuring out how to combine these resources to resolve a particular problem. It can happen that you spend countless hours only reading the documentation, but it still is the best place to get familiar with the resources and concepts.  

As Kubernetes is always evolving, it’s hard to keep up with the documentation, so it’s quite possible that the docs are out-of-date. As a developer you have to search online for more recent or better examples of how to do things, which makes adopting Kubernetes even more challenging. 

https://twitter.com/memenetes/status/1461393988464873478?s=20&t=TgZzDGz7DfbdGDOJ1XDOFA

YAML files

You use Kubernetes YAML files to configure nodes, pods, services, and other resources. They are easy to read and write but the documentation is not always clear, making it difficult for developers to understand how things work.

Kubernetes Documentation often does not give a good overview of what the YAML file can do. This causes developers to have to spend time researching how certain features work in order to use them, which ultimately leads to less time developing code and more time debugging problems.

Additionally, Kubernetes requires working with a large number of YAML manifest and config files, which can be overwhelming, especially at the beginning. These files are created manually and need to be managed, introducing a lot of repeating steps that no developer enjoys. 

As the number of YAML files tends to grow with the application, automation of this process is necessary to eliminate the need for manual creation of these files from scratch. Helm is the most popular package manager for Kubernetes that solves this problem.  

How does Kubernetes improve developer’s life?

Despite these challenging setbacks, developers report great improvements after implementing Kubernetes in their organizations. Among them are the following:

1. Automated failure management

With Kubernetes deployments, developers are relieved from having to take manual action in the event of an unexpected failure. Kubernetes takes care of propagating failures across nodes in a cluster, and schedule repairs as needed. The largest benefits for developers seem to come when they move away from manually managing resources and towards automating their work with Kubernetes. Having code that is reliably deployable, scales dynamically, and manages resources automatically, leads to a more efficient and effective development process.

2. Multi-cloud 

All the major cloud providers now widely accept Kubernetes. It has native support for different clouds, including AWS, Azure, GCP, OpenStack, and VMware vSphere. Developers no longer need to learn about the intricacies of each cloud provider’s APIs. This makes it easy to move from one cloud provider to another. With these abilities, Kubernetes also enables developers to implement a multi-cloud strategy and run cloud-native applications on multiple clouds.

3. Scaling 

Kubernetes scales automatically and efficiently to meet the demands of your applications. It is able to handle millions of nodes and trillions of transactions per day with little impact on performance. Developers no longer need to think about how they are going to scale their application, Kubernetes takes care of it for them.

4. GitOps

GitOps is an operating model for Kubernetes that is designed for modern software development where code is continuously delivered through a flow of automated releases. This means that it is designed to be easy to use and integrate with existing tools and workflows. Developers can easily push code to Kubernetes, run automated tests, deploy new applications, tune parameters, monitor logs, and more using their existing pipeline tools.

What are the key things developers need to know about Kubernetes?

  1. Basic concepts and their interconnection. Really understand services, their connection with deployments, and how deployments are connected to containers and autoscaling.
  2. Ingress - an API object that manages how a cluster and it’s services are accessed externally. 
  3. Local development - you need to nail running Kubernetes on your local machine. Minikube is an open-source solution that can help you with that.  
  4. Kubernetes Dashboard - a UI where you can deploy apps, get an overview of their running mode, create/update resources and troubleshoot your clusters. 
  5. Kubernetes namespaces - understand the importance of namespaces, and how you can use them to divide your cluster in multiple logical partitions. 
  6. Volumes and persistent storage - working with data in Kubernetes through a cluster resource called Persistent Volume.
  7. How to monitor and debug clusters - what failed, where, and why?
  8. Brace for learning - don’t rush your learning process. Work hard to design the system, automate everything and make it testable. Develop a longer time, then go to production with Kubernetes. Don’t rush it, I stress this!

Start Kubernetes on Microtica 

Microtica provides a ready-to-use infrastructure template for Kubernetes. You just need to connect your AWS account, create your development environment and select the Kubernetes template. This action creates two components in the environment:

  • a VPC component to set up the networking where the EKS container will run,
  • and the Kubernetes Cluster Component, which contains EC2 instances, Load balancer, and preinstalled Ambassador API Gateway.

Click Quick deploy and in about 10 mins your cluster will be deployed and available in your cloud account. Define your applications and deploy them on the cluster from a Dashboard view, where you can follow the deployment history. Automate your deployments on git push. For the full step-by-step guide visit this article

kubernetes cluster for developers
Kubernetes Cluster View

Conclusion

If you need to start small, Kubernetes is probably not the right tool for you. The learning process is steep, especially at the beginning, you need to understand the different concepts, how they work together, what you need to combine to accomplish something for your app. If you're not familiar with Kubernetes, getting into it for a small app is not something we recommend. 

The power of Kubernetes shines when you have bigger apps, that have high traffic and performance requirements.

As your business grows, it can be very challenging to keep up with the pace. The good news is that Kubernetes allows you to scale seamlessly as lifecycle events demand for more resources or if throughput levels are exceeded.