DEV Community

Arpit Mohan
Arpit Mohan

Posted on • Originally published at

Running scalable workloads on Kubernetes

TL;DR notes from articles I read today.

Tips for running scalable workloads on Kubernetes

  • You must set resource requests & limits so the Kubernetes scheduler can ensure workloads are spread across nodes evenly.
  • The scheduler can use configured affinities & anti-affinities as another hint of which node is best to assign your pod to.
  • In Kubernetes, readinessProbe tells that a pod is ready to start receiving requests and livenessProbe tells that a pod is running as expected. Setting these ensure that requests to service always go to a container that can process the request.
  • It is common for nodes in Kubernetes to disappear and you should configure a pod disruption budget to ensure you always have a minimum number of ready pods for deployment.

Full post here, 13 mins read

Non-functional requirements: Quality

  • To develop quality code, you should focus on clean code structure, the correctness of implementation and maintainability. 
  • Define a company-wide META architecture for every project to follow, allowing more reuse of code. Use the KISS principle and avoid excessive detailing or heavy customizing.
  • To keep clean code, always activate the compiler warning, no matter what language you use; define (and monitor) naming, line length, and API documentation conventions like Javadoc; and maintain test coverage of least 85% with not only unit tests but also automated acceptance tests, and regular manual code inspections, especially when working with external vendors.
  • Rather than using pull requests as a quality gate, use a simpler model such as release branch lines and automate visualization of coupling between classes and modules. Light coupling is easier to maintain and lets you reutilize the module/class more readily.
  • Avoid third-party libraries, and try to solve any given problem with only one library/technology to reduce security risks. 

Full post here, 10 mins read

Get these notes directly in your inbox every weekday by signing up for my newsletter, in.snippets().

Top comments (0)