<?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 Twelvee on Medium]]></title>
        <description><![CDATA[Stories by Twelvee on Medium]]></description>
        <link>https://medium.com/@redapple54r?source=rss-3179fccea45a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*270OX1B1AZmNxwVrtK0_ig.png</url>
            <title>Stories by Twelvee on Medium</title>
            <link>https://medium.com/@redapple54r?source=rss-3179fccea45a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:28:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@redapple54r/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[Solving the bottleneck deployment and environment replication problem]]></title>
            <link>https://medium.com/@redapple54r/solving-the-bottleneck-deployment-and-environment-replication-problem-1f3d850d853c?source=rss-3179fccea45a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f3d850d853c</guid>
            <category><![CDATA[bottleneck]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Twelvee]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 07:20:19 GMT</pubDate>
            <atom:updated>2023-06-01T07:20:19.016Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, time goes by, k8s and docker have become an integral part of our working environment, but from what I observe many companies still think that the problem of deployment bottleneck can only be solved by a bunch of bash scripts or a separate chat room where everyone should be informed about new deployments.</p><p>What is this deployment bottleneck problem? The easiest way to explain it is with an example, which probably looks familiar to you.</p><h4>An example showing what a bottleneck is</h4><p>Let’s introduce the company “Good Company”. There are only two people working there, named CTO and CEO. One of them used to work as a senior engineer in the company “Not a Very Good Company” and at one moment, when they met a man with money, the future CEO, they decided to create their own, good company. The CTO knows very well that their company will be successful and the product will be in maximum demand, so he initially develops a microservice architecture for their project. He’s also very familiar with all the new technologies and practices — docker, kubernetes, stdout logs, that sort of thing. And now, a few months later, the guys are ready to show the MVP to their users, which the CEO found during the development.</p><p>Let’s pause at this point and summarize what we have.</p><p>The development pipeline looks like one master branch in each of the 4 microservices that are rolled out in the k8s cluster. This ease of rolling out new features is what allowed them to finish the MVP in just a couple of months. It’s all cool here, the guys are awesome!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EamTQcHwkodt2wR5p5_0_A.png" /></figure><p>The project really started to attract new users, and now the company already has 4 backend and 2 frontend developers, 1 QA, project manager, CTO and CEO. All the guys are very motivated and now they can be called a real IT company! They already have 2 clusters — one for developers and one for users. Pipeline of their development looks like this: there are 2 identical branches — master and develop, guys create their feature branch from develop and make their magic, and then merge all their changes into develop and roll them out to dev cluster. That’s where the QA tests everything and after the “ok” message in the telegram — develop gets merged into the master and the most “important” programmer presses the “Deploy to production” button in some gitlab-ci. Processes! The guys are good again!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzPV-7AFGG_DXTmMj08T8g.png" /></figure><p>And now the company is growing even more, there are more users, they offer a bunch of different new features and the good guys from Good Company are happy to implement them. Now they have as many as 8 backend, 4 frontend, 2 QA engineers, a project manager, and all the same, but less skinny, CEO and CTO. Their clusters work fine, but here’s the trouble — their users are starting to complain more and more about bugs, and the developers for some reason are complaining more and more about their lives. They hold meetings, trying to figure out what the problem is, and it was enough just to look at how their project is developed.</p><p>8 backend developers working on 8 different tasks, their features are often returned by vigilant QA engineers and git hist looks really bad. When merging into a master there are huge conflicts because of critical bugfixes, which have to be fixed by the most unlucky team member (the one on the picture), along the way rewriting new features and creating even more bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oq8Ed8ajVtQeoKJdyHbOyw.png" /></figure><p>It means that our guys at Good Company have faced the problem of deployment bottleneck — when there are too many people who want to roll out their changes at the same time. They’ve faced this problem before, but “plugged” it by creating a develop branch and not very scalable git-flow, not even knowing what it would lead to.</p><h4>But how to solve this problem?</h4><p>We have already described the problem, now we need to understand what causes it. Programmers are people (for now), and people make mistakes. When you add to one branch several features at once with potential bugs. Then you try to fix conflicts in code that you see for the first time in your life because your colleague wrote it, and at the same time your other colleague fixes his bug that QA returned to him and rewrite your fixes of conflicts. Your whole git-flow turns into a mess.</p><p>Wait, but you can deploy a separate branch of each feature to the dev cluster. Yes, you can. But after all, that won’t get rid of the initial problem that caused you to create that branch develop. You’ll encounter the problem when they try to roll out the same service with different tags to the same cluster — deployment bottleneck.</p><p>And that is where stage environments (or a chat room on Telegram, where developers “reserve” a free slot to test their feature on the dev cluster) come into play.</p><p>In short, stage environments are a set of services you need for a specific feature, which you can fully test or show to a customer. Now let’s move on to practice.</p><p>First I propose to <strong>set the following git-flow</strong>: we create a branch from the master, develop the feature in it, then we create a merge request into the master and merge if everything is ok. From the master, we can roll everything out to a dev cluster, and then, by tagging off, roll in an release to our users.</p><p>Along with this gif-flow we <strong>need to get your service’s docker image built for each branch</strong> and the ability to deploy those images as separate, independent environments. As a result, we should get: the prod should have images with the release tags, the dev should have images from the master (or just the latest), and each created branch should have its own docker image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRwSd1nDgscmHLOqGmVG3g.png" /></figure><h4>The hardest part is over!</h4><p>How to correctly and quickly roll out these branch-based images is a complex problem, which is solved in different ways, but I decided to collect sugar in a bunch and make a small open-source project, which I myself will use in all my projects. I named the project k8sbox and it allows you, with a single toml specification, to roll out your microservices across your cluster.</p><p>By combining terms and thinking a bit, I got the simplest and most straightforward interface for this specification. We have an environment, which contains boxes with our applications inside them.</p><p>And this is what the toml specification looks like:</p><pre>id = &quot;${TEST_ENV}&quot; # It could be your ${CI_SLUG} for example<br>name = &quot;test environment&quot;<br>namespace = &quot;test&quot;<br>variables = &quot;${PWD}/examples/environments/.env&quot;<br><br>[[boxes]]<br>type = &quot;helm&quot;<br>chart = &quot;${PWD}/examples/environments/box1/Chart.yaml&quot;<br>values = &quot;${PWD}/examples/environments/box1/values.yaml&quot;<br>name = &quot;first-box-2&quot;<br>    [[boxes.applications]]<br>    name = &quot;service-nginx-1&quot;<br>    chart = &quot;${PWD}/examples/environments/box1/templates/api-nginx-service.yaml&quot;<br>    [[boxes.applications]]<br>    name = &quot;deployment-nginx-1&quot;<br>    chart = &quot;${PWD}/examples/environments/box1/templates/api-nginx-deployment.yaml&quot;<br><br>[[boxes]]<br>type = &quot;helm&quot;<br>chart = &quot;${PWD}/examples/environments/box2/Chart.yaml&quot;<br>values = &quot;${PWD}/examples/environments/box2/values.yaml&quot;<br>name = &quot;second-box-2&quot;<br>    [[boxes.applications]]<br>    name = &quot;service-nginx-2&quot;<br>    chart = &quot;${PWD}/examples/environments/box2/templates/api-nginx-service.yaml&quot;<br>    [[boxes.applications]]<br>    name = &quot;deployment-nginx-2&quot;<br>    chart = &quot;${PWD}/examples/environments/box2/templates/api-nginx-deployment.yaml&quot;<br><br>[[boxes]]<br>type = &quot;helm&quot;<br>chart = &quot;${PWD}/examples/environments/ingress/Chart.yaml&quot;<br>name = &quot;third-box&quot;<br>values = &quot;${PWD}/examples/environments/ingress/values.yaml&quot;<br>    [[boxes.applications]]<br>    name = &quot;www-ingress-toml&quot;<br>    chart = &quot;${PWD}/examples/environments/ingress/templates/ingress.yaml&quot;</pre><p>All documentation is available and can be found in the links at the end of this article, but it seems to be pretty clear here, just take a look at the example (which is completely in the githab repository).</p><p>Along with this chart — we can run our k8sbox tool and it will roll out this environment on your k8s cluster. Something like this:</p><pre>$ k8sbox run -f environment.toml</pre><p>If our QA finds a bug and we need to reload the environment, we just execute the same run command. It will delete all previous charts and install them again and do it very quickly. Like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1gprbie9cQnwYfrp9NUmyA.gif" /></figure><p>You can also always see what environments you have already rolled out to the cluster and find out more with</p><pre>$ k8sbox get environment // list of saved environments<br>$ k8sbox describe environment {EnvironmentID} // describe the environment</pre><p>Well, if your QA engineer said OK, we can easily clear the cluster from our environment by running the command:</p><pre>$ k8sbox delete -f environment.toml</pre><p>All your services are rolled out on YOUR k8s cluster, which means you can configure any parameters you want for them. And also the pluses are the ready-made docker images with entrypoint just on k8sbox. That means you can easily integrate this tool into any of your CI pipelines.</p><p>This tool will allow you to solve your bottleneck problem in a very simple way — split development of new features, letting the developers do their magic in parallel and independently from each other.</p><h4>Useful Links:</h4><p><a href="https://www.cncf.io/blog/2020/03/23/deployment-bottlenecks-and-how-to-tame-them/">An article about deployment bottleneck that advises less frequent deployment -_-</a></p><p><a href="https://github.com/twelvee/k8sbox">Link to k8sbox repository</a></p><p><a href="https://docs.k8sbox.run/">Link to k8sbox documentation</a></p><p><a href="https://hub.docker.com/r/twelvee/k8sbox">Link to dockerhub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f3d850d853c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fix 9 out of 10 problems with your microservices.]]></title>
            <link>https://medium.com/@redapple54r/how-to-fix-9-out-of-10-problems-with-your-microservices-ea1cdb962b59?source=rss-3179fccea45a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1cdb962b59</guid>
            <category><![CDATA[management]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops-tool]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Twelvee]]></dc:creator>
            <pubDate>Mon, 29 May 2023 19:01:15 GMT</pubDate>
            <atom:updated>2023-05-29T19:29:10.839Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey! Let me introduce myself a bit. My nickname is Twelvee, I’m a software engineer. Just an engineer. Not a CEO/CTO of some modern LA startups, just an engineer in a common company with common problems. As not MAANG employee I did often change companies I work and all these companies had one common thing — microservices.</p><p>Microservices is pretty much accepted by industry standard of backend architecture, and we all know what is hiding behind the amazing scalability and flexibility — mess. Mess with microservices, mess with data transferring, mess with testing and deploying.</p><p>Let me show you an example. You will probably find this a bit familiar.</p><p>We have 10 microservices and 4 backend engineers working on them at the same time. Also, there are 1 QA engineer, 2 frontend engineers, project manager, CTO and CEO of your new big unicorn startup. You also have 2 clusters, because you guys don’t play games here. Let name those two clusters — dev and prod. You probably have daily g.meets calls, and a Slack chat as your main team communication tool.</p><p>Everything looks nice and clean, engineers doing their engineer things, QA test everything twice on each cluster, your “to-market” pipeline looks like</p><p><em>Build &gt; Tests &gt; Deploy To Dev &gt; Deploy To Prod.</em></p><p>Your company grows, now you have 25 microservices and 7 backend engineers working on them at the same time. Now we have 2 QA engineers, 4 frontend engineers and still one project manager, CTO and CEO of your big unicorn startup. You still have 2 clusters. And still have dev and prod environments running on them 24/7. But somehow hiring new engineers in your team — didn’t make the time-to-market property as good as you expected and there are always new bugs, tech debt is growing faster than your company.</p><p>So… What’s happened? It’s simple — you reached the limit of your environment capacity. Not the “resources” capacity, the “deployments at the same time” capacity. How you’re going to fix it?</p><p>If you are a project manager — you’ll probably create a Slack channel called “Deployments” and ask your engineers to send text message into this channel every time he or she deployed a new build on dev environment. Sounds NOT fun.</p><p>If you are an engineer — you’ll probably google it first. And all you could find is a ton of bash/ansible/terraform scripts. It would work. Trust me. But you will fight with HUGE amount of problems that people in different companies already solved. If you ask your colleague to build it — you’ll lose. Because he will quit company, and you’ll have to fix bugs in this solution instead.</p><p>If you are an CEO — you’ll hire DevOps. It’s good and right choice. Thanks for reading this article. Goodbye!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KroYQaEnkkV_fGZwcBmMgA.png" /><figcaption>Box of devops</figcaption></figure><p>JK. DevOps engineers are awesome, but you don’t need a DevOps engineer if you have a small team and only 25 microservices in your repositories. Everything is already working fine, the problem you’re hitting is a logistic type of problem, not the “we need to hire a DevOps” type of problem.</p><p>The reason I write this article — I’ve got hired recently, and again we have the same problem. DEV ENVIRONMENT IS A BOTTLENECK. Everyone wants to push something to the dev cluster, everyone pushes tons of features into one branch “dev” and then the unluckiest one have to fix tons of conflicts missing tens of new features and making new bugs by that at the same time. Then one of the team loudly thinking about “How good it would be if I have a separate environment, just like DEV, but just mine”</p><p>To solve it — use k8sbox.</p><p>k8sbox is my new open-source project, It’s just a simple binary file or a docker image. It’s actually simple. I will explain to you how fast it could solve this problem. But let me just show how it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1gprbie9cQnwYfrp9NUmyA.gif" /></figure><p>What’s happened on this GIF? Well, I’ve just typed in my console</p><pre>k8sbox run -f ./examples/environments/example_environment.toml</pre><p>and all my microservices were redeployed on my own k8s cluster. Separated to other team deployments and dev environment. It’s just my new environment. I have the endpoints, I have my own database, I have my own microservices I need (not all of them, because why I should up useless microservices). The QA will look at the new endpoints and will check it for bugs. The other team will do the same thing. We’re just parallel our work. It feels so good. Now I can make my engineering things alone, without asking a permission to deploy them on dev environment to check what logs saying about my new feature. And it took just 16 seconds.</p><p><strong><em>I want it! Give it to me!</em></strong></p><p>Sure, all you have to do:</p><ol><li>Pull the repository <a href="https://github.com/twelvee/k8sbox">https://github.com/twelvee/k8sbox</a></li><li>Build it make build</li><li>Run it ./bin/k8sbox run -f environment_i_need.toml</li></ol><p>There’s even faster way if you’re lazy or a gitlab bot:</p><ol><li>docker run twelvee/k8sbox run -f environment_i_need.toml</li></ol><p>Make sure you’ll set your $KUBECONFIG variable, other way it will throw an error. Fair enough error tho, c’mon, you’re trying to deploy your environment to your k8s cluster.</p><p><strong><em>But how to delete the environment if I don’t really need it anymore?</em></strong></p><p>k8sbox delete -f environment_i_dont_need_anymore.toml</p><p>Yes. That is simple.</p><p><strong><em>I did some changes on my pull request. How do I re-deploy it?</em></strong></p><p>Just execute run command again. It will uninstall your helm charts and install it again.</p><p><strong><em>Awesome! There’s a case. I run a new environment to make the QA test it, but I forgot what kind of microservices I put into it.</em></strong></p><p>k8sbox get environment will return every single running environment with all the boxes inside.</p><p><strong><em>Damn, you’re just saving my life! Every single case is covered. All I have to do now is look at the environment in my k8s cluster to check if everything is ok with it.</em></strong></p><p>Yeee… About that.</p><p>k8sbox describe environment {EnvironmentID} will show your application’s status with pretty much complete information about the charts.</p><p>As you can see — k8sbox solve the huge problem. It makes your development process parallel. In my experience, it brings time-to-market down.</p><p>All documentation is available on <a href="https://docs.k8sbox.run/">https://docs.k8sbox.run/</a> and the project is updating every week. Currently, I’m working on it alone, but I would like to see some pull requests :)</p><p>Thanks for reading this, I just wanted to introduce you my new open-source project. I will make another articles about it with use-cases and examples of how do I use it personally, so, if you’re interested — feel free to follow me. Bye!</p><p>Links:</p><p>Repository: <a href="https://github.com/twelvee/k8sbox">https://github.com/twelvee/k8sbox</a></p><p>Docker Hub: <a href="https://hub.docker.com/r/twelvee/k8sbox">https://hub.docker.com/r/twelvee/k8sbox</a></p><p>Documentation: <a href="https://docs.k8sbox.run/">https://docs.k8sbox.run/</a></p><p><em>A full example with 2 services and nginx ingress is available on github.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea1cdb962b59" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>