<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Filip Petkovski on Medium]]></title>
        <description><![CDATA[Stories by Filip Petkovski on Medium]]></description>
        <link>https://medium.com/@filip.petkovski?source=rss-9cfe1c0dff0b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Or0APp7TkOsoknhiTrGhxw.png</url>
            <title>Stories by Filip Petkovski on Medium</title>
            <link>https://medium.com/@filip.petkovski?source=rss-9cfe1c0dff0b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:11:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@filip.petkovski/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building higher-level abstractions in Kubernetes]]></title>
            <link>https://medium.com/inside-personio/building-higher-level-abstractions-in-kubernetes-39f275e57e64?source=rss-9cfe1c0dff0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/39f275e57e64</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[hrtech]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Filip Petkovski]]></dc:creator>
            <pubDate>Thu, 25 Mar 2021 10:16:48 GMT</pubDate>
            <atom:updated>2021-03-25T10:16:48.044Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past few years, Kubernetes has established itself as the de-facto standard for container orchestration. There are plenty of reasons for its success, including a rich community and a strong backing by large companies. However, setting the organizational reasons aside, where Kubernetes especially stands out is in its well-designed, rich, and extensible API that can account for a wide range of use cases.</p><p>The downside of having such an extensive API is the complexity and the non-trivial barrier of entry that it imposes on the end-user. This problem is especially pronounced in fast-growing microservice-based ecosystems, such as the one at Personio, where things are changing all the time. In this blog post, we explain how simpler, domain-specific abstractions can be built on top of the Kubernetes API when tools like helm or kustomize stop being effective.</p><h3>Limitations of Helm Charts</h3><p>At Personio we have close to 100 services running in production. Of those, around 40 serve product workloads and that number is continuously growing. The deployment manifests for each microservice are bundled as a helm chart and are part of the same repository as the service itself. With the growth of the engineering organization, our knowledge and understanding of Kubernetes evolved, and so did the charts used for deploying these microservices. Typical improvements which we introduced over time include adding affinity rules and PodDisruptionBudgets for Deployment objects. Each iteration required updates to each microservice chart and as the number of services grew, the cost of making such changes from an organizational perspective grew as well.</p><p>Our initial solution to this problem was maintaining a reference chart as part of a microservice template, with every team being responsible for keeping up with updates. This solution served us well at a smaller scale, but started to create unnecessary work for every team.</p><p>Some of the updates that we did, such as adding a PodDistruptionBudget, could have been rolled out safely without needing involvement from the teams owning the services. In contrast, we ended up having to create a pull request in each repository, identify the owning team, and follow up to make sure the PR was reviewed, merged, and rolled out to production. This particular example illustrated the need for a more centrally-managed solution where we could make improvements and adjustments without disturbing teams. In other words, we started to see the need for a domain-specific platform on top of Kubernetes.</p><h3>Enter Custom Resource Definitions</h3><p>We wanted to create a minimal configuration file for our engineers that allows them to run a docker image on Kubernetes without them needing to worry about all the plumbing and wiring. In addition to this, we needed the possibility to roll out changes centrally across all microservices without creating toil for other engineering teams.</p><p>After some research into what is available in the Kubernetes ecosystem, we decided to introduce a custom Microservice resource as a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">Kubernetes CRD</a>:</p><pre>apiVersion: personio.de/v1<br>kind: Microservice<br>metadata:<br>  name: ground-breaking-microservice<br>spec:<br>  image: ground-breaking-microservice:v1.1<br>  cpu:<br>    request: 500m<br>    limit: 1<br>  memory: 256Mi<br>  configMapName: config-name<br>  secretName: secret-name</pre><p>The `spec` of the custom resource exposes all of the parameters that need to be specified by the team owning the service. The custom resource in itself does not contain any behavior and merely serves as an interface. The behavior associated with the resource needs to be fulfilled by a Kubernetes controller.</p><p>In our particular case, we had to develop a controller with the responsibility of taking the `Microservice` `spec` and creating well-configured Kubernetes resources from it, such as a Deployment, Service, Ingress, etc.</p><h3>Implementing a Kubernetes Controller</h3><p>There are a few open source frameworks which greatly simplify the development of Kubernetes controllers, including <a href="https://github.com/kubernetes-sigs/kubebuilder">Kubebuilder</a> and <a href="https://github.com/operator-framework/operator-sdk">OperatorSDK</a>. These are good general-purpose frameworks which can address a wide range of use cases. They can help with managing resources inside as well as outside of Kubernetes.</p><p>Our particular case however, was a perfect match for <a href="https://github.com/metacontroller/metacontroller">Metacontroller</a>, a framework that makes it easy to write and deploy custom controllers in the form of HTTP webhooks and is only scoped to managing Kubernetes specific resources.</p><p>Metacontroller is installed as an operator in Kubernetes. It takes care of watching for updates on our custom `Microservice` resources and making sure they are processed in a FIFO manner to prevent race conditions. Our responsibility then becomes implementing an idempotent webhook which takes in the parameters of the `spec` and returns a list of Kubernetes objects for those parameters. Based on the webhook response, Metacontroller will interact with the Kubernetes API to reconcile the desired state by creating, updating, or deleting Kubernetes objects.</p><p>Metacontroller will also run the reconciliation loop for all resources periodically, and in our specific case every minute. This allows us to propagate changes to all microservices by making a change in our webhook. This periodic reconciliation completely eliminates configuration drift between different microservices and gives us the confidence that all of them are deployed and configured in Kubernetes in exactly the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NH6CiMmt5IGUV1oy" /></figure><h3>Ensuring a High Quality Bar</h3><p>A centralized solution to manage deployments has its own drawbacks which should not be taken lightly. Problems in the reconciliation workflow can affect all microservices or cause global outages.</p><p>For example, exposing the wrong port in a Service object when deploying a Microservice could cause network calls between microservices to suddenly start failing.</p><p>To mitigate this problem, we rely heavily on both unit and integration tests. Our webhook is thoroughly tested using conventional unit tests to ensure Kubernetes resources for different configurations are created and wired up appropriately.</p><p>In addition to unit tests, we also leverage integration tests against an actual Kubernetes cluster. The integration tests run for every branch as part of a deployment pipeline and use <a href="https://kind.sigs.k8s.io/">kind</a> to dynamically spin up and tear down a Kubernetes cluster inside a docker container. Every pipeline run creates a new cluster with Metacontroller and the supporting webhook. It then deploys a microservice resource and runs assertions verifying that the appropriate objects were created in Kubernetes. At the end of the test run, the cluster is torn down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X5BwrBJ8JrZowaXn" /></figure><h3>Conclusion</h3><p>In the Developer Experience (DX) team, our mission is to actively work on reducing complexity within our stack. To make progress on that mission, we often need to do <strong>more</strong> so that everyone else can do <strong>less</strong>.</p><p>What this particular project has taught us about Kubernetes is what the community has been trying to say all along: Kubernetes is a great platform for building platforms. It provides well designed primitives that can be used to run containers across many nodes.</p><p>But, those primitives are not always the simplest to use, understand, or manage on a larger scale. This is why we at DX constantly ask ourselves which parameters our engineers want to control, and which ones are toil that they have to deal with.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39f275e57e64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-personio/building-higher-level-abstractions-in-kubernetes-39f275e57e64">Building higher-level abstractions in Kubernetes</a> was originally published in <a href="https://medium.com/inside-personio">Inside Personio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservice monitoring as Kubernetes CRDs]]></title>
            <link>https://medium.com/inside-personio/microservice-monitoring-as-kubernetes-crds-5dbad63567d?source=rss-9cfe1c0dff0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dbad63567d</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[new-relic]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Filip Petkovski]]></dc:creator>
            <pubDate>Mon, 10 Aug 2020 15:51:47 GMT</pubDate>
            <atom:updated>2020-08-10T15:51:47.189Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microservice monitoring through Kubernetes custom resource definitions</h3><p>On the journey towards a microservice architecture, Personio as a company has been quite successful in adopting tools for building and deploying our software. One aspect which was challenging for us until recently was monitoring these services once they were running in production. As the pace of developing new services was picking up, keeping alerts and dashboards up to date was starting to become harder. This was mostly because they were being defined through a UI.</p><p>We realized over time that defining monitoring in this manner simply did not scale with the growth of the organization. Alerts often suffered from configuration drift, a lack of collaboration and peer review. It was hard to make system-wide changes. If we wanted to solve the problem, services had to have their monitoring defined as close to the code as possible, just as they had a Dockerfile and a build pipeline.</p><p>After looking at existing solutions, we did not manage to find a tool that would fully solve our problem. However, most of these tools served as an inspiration for us to develop an open source software that would integrate two crucial components of our infrastructure, Kubernetes and New Relic. In this article we will explain how monitoring became an integral part of every piece of software which now runs in production.</p><h3>A quick glimpse at existing solutions</h3><p>While most vendors in the monitoring space do provide some means of defining dashboards and alerts as code, many of these methods rely on using a particular piece of technology through which you implement alert management.</p><p>One set of solutions revolves around the various terraform modules available for vendors such as <a href="https://www.terraform.io/docs/providers/datadog/index.html">Datadog</a> or <a href="https://registry.terraform.io/providers/newrelic/newrelic/latest/docs">New Relic</a>. Unfortunately, a major problem with terraform is the fact that it runs client-side and therefore makes secret management complicated business. For instance, at Personio we use New Relic as our monitoring platform and it requires the use of an Admin API Key for defining alerts and dashboards. Having API keys with a high level of access spread across tens or hundreds of repositories just for the sake of defining alerts appears to be a huge limitation of using terraform for this purpose.</p><p>A better solution regarding these constraints would have been <a href="https://prometheus.io/docs/alerting/latest/alertmanager/">Alertmanager</a>. It removes the need for end-users to manage secrets, and integrates natively with Kubernetes. Unfortunately, this tool is highly coupled to Prometheus. We did, however, use it as an inspiration for what a good alert management tool would look like from an API perspective.</p><h3>Alerts as code in Personio</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AzeuamKBVB_jKlJQ" /></figure><p>With the rapid increase in the number of microservices being developed at the company, we saw the need for reusable and scalable monitoring across the board. What we set out to achieve was establishing a baseline of alerts and a dashboard that would come out of the box with every new service that gets added to the system. One part of such a baseline would be key metrics we wanted to always keep an eye on, such as error rate, latency and resource consumption. In addition to this pre-defined baseline, we also wanted each service to be able to either define new alerts or modify the ones coming from the baseline if they were not adequate for the service. Finally, we set a hard requirement to find a way to enable teams to be fully responsible for defining how a service is monitored, and to be the first ones that are notified when something goes wrong.</p><p>At Personio we rely heavily on Kubernetes to run almost all of our workloads. As we are also fully in AWS, we leverage EKS to a large extent to operate multiple Kubernetes clusters and manage them through <a href="https://www.terraform.io/">terraform</a>. Each microservice defines the necessary Kubernetes manifests through a <a href="https://helm.sh/">helm</a> chart. Finally, once in production, services are monitored through New Relic alerts and dashboards specific to that service. Since we use Kubernetes extensively and our developers are experienced at deploying their services through Kubernetes manifests, <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">Kubernetes Custom Resources</a> seemed like a natural integration point between the workloads we run and the alerts and dashboards that monitor them.</p><p>Out of all of these constraints, the <a href="https://github.com/personio/newrelic-alert-manager">New Relic alert manager</a>, a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/operator/">Kubernetes operator</a> that manages New Relic alerts and dashboards, was born. An in-cluster operator allowed for all the alerts and dashboards for a service to live in the same repository as the service itself. This approach solidifies the ownership of service monitoring with the team developing the service. The way a new service is initialized at Personio is by cloning a template repository and filling in parameters like the service name and the team which owns it. This allows us to package premade monitoring with sensible defaults as part of the helm chart of the service template. As a result, when a new service is created, it comes with basic monitoring already set up with key metrics and wired to trigger notifications to appropriate channels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*So_ncVjnkrQ4MVdW" /></figure><p>At the end of the entire process, we managed to empower developers to fully manage the monitoring for their services, as they are the ones who best understand how the service works and where it can break. However, when they decide to bring a new service into the system, they do not need to start from scratch and deal with technicalities like naming conventions and notification channels.</p><p>We believe we are not the only company facing these challenges, and have therefore also decided to open source our <a href="https://github.com/personio/newrelic-alert-manager/blob/master/hack/examples/personio_alert.yaml">alert</a> and <a href="https://github.com/personio/newrelic-alert-manager/blob/master/hack/examples/personio_dashboard.yaml">dashboard</a> templates together with the project. Our monitoring baseline is heavily inspired by the <a href="https://landing.google.com/sre/sre-book/toc/index.html">Google SRE Book</a> and we are more than happy to take feedback or contributions in any form.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dbad63567d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-personio/microservice-monitoring-as-kubernetes-crds-5dbad63567d">Microservice monitoring as Kubernetes CRDs</a> was originally published in <a href="https://medium.com/inside-personio">Inside Personio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>