Inspiration
I have built a lot of SaaS products based on Docker and Kubernetes, and many a times, scaling them is a hassle due to manual configuration and continous testing of the cluster, and the containers within it. Hence, for this hackathon, I had the idea of creating a policy for datree which would enable Kubernetes engineers to scale their services hassle-free and quickly. I believe it can make quite the impact on the way we use Kubernetes in our daily workflow.
What it does
This policy checks and validates the following fields: targetCPUUtilizationPercentage, minReplicas, maxReplicas, scaleTargetRef and containers[].resource.limits and containers[].resource.requests. It validates these fields for the resource, HorizontalPodAutoscaler. The aim is to reduce the time and effort is takes to scale Kubernetes clusters and enhance developer productivity and decrease costs. HPA is an amazing feature of Kubernetes, thus it only makes sense to use it right.
How we built it
I built it using the following technologies:
YAML: It was used as the language of choice to write out the schema logic as well as the policy itself. Using Yaml was a big decision as I had no prior experience with Yaml, so I learnt a great deal about it.
Datree: It was used to develop my policy for, and to test my policy. Datree was undoubtedly the most important technology since this policy is built for it.
Challenges we ran into
One challenge I ran into was the time constraint as I joined the hackathon a bit late, so I had to cover up by watching the video and exploring the CLI. Then I had to write the policy with no prior experience pertaining Yaml, so all in all, it was a superb learning experience for me.
Accomplishments that we're proud of
The main accomplishment for me was that I was able to build this entire policy on my own with no prior knowledge of Yaml and Datree. Moreover, I didn't even have any knowledge of json schema which was the schema language for writing our Kubernetes schemas in the policies, so I would say that I really challenges myself and explored these new technologies.
What we learned
I learnt about Yaml, since it was my first time working and writing code in Yaml. I also learnt about Datree because before this hackathon, I hadn't even heard the name of Datree yet here I am developing policies for it, so I had to learn about using the CLI, writing custom policies and even making pull requests to the GitHub repository for Datree.
What's next for Scale to the moon!
In the future, I would like to add more rules to the policy as it can really automate and help Kubernetes engineers save time and money. Plus, I would probably expand this policy to a standalone CLI tool as well, if time permits, making this a full-fledged project.
Built With
- datree
- kubernetes
- yaml

Log in or sign up for Devpost to join the conversation.