<?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 Matthias Nguyen on Medium]]></title>
        <description><![CDATA[Stories by Matthias Nguyen on Medium]]></description>
        <link>https://medium.com/@m.k.joerg?source=rss-b7ab952f8550------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oP22dJ3qGj1gbKo_UWTxWQ@2x.jpeg</url>
            <title>Stories by Matthias Nguyen on Medium</title>
            <link>https://medium.com/@m.k.joerg?source=rss-b7ab952f8550------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:25:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@m.k.joerg/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[Monorepo for GitOps]]></title>
            <link>https://faun.pub/monorepo-for-gitops-5402fe7a8e35?source=rss-b7ab952f8550------2</link>
            <guid isPermaLink="false">https://medium.com/p/5402fe7a8e35</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[gitops]]></category>
            <dc:creator><![CDATA[Matthias Nguyen]]></dc:creator>
            <pubDate>Mon, 27 May 2019 18:46:16 GMT</pubDate>
            <atom:updated>2019-07-21T11:10:03.168Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Monorepo for GitOps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CegqAYjC9hzSsptz19koIQ.jpeg" /><figcaption><a href="https://unsplash.com/photos/842ofHC6MaI">Unsplash</a></figcaption></figure><p>Recently while implementing a GitOps based strategy, I wrote a <a href="https://medium.com/faun/gitops-comparison-pull-and-push-88fcbaadfe45">post</a> comparing the GitOps push and pull based model and evaluated their different pros and cons. Since then, I worked on an implementation of the process for our project team.</p><p>A short introduction to GitOps: Everything that is related to operations in your project is centered in Git and the repo is then used as your single source of truth.</p><p>There are many great other great articles that provide an overview of what GitOps is in detail and what the main benefits are. If you go on a quick search on Medium or Google you will find plenty of introduction material.</p><p>This article is centering around the next link in the chain, actually implementing all this process for a product. The following section will show my opinions on implementing this process.</p><h3>Hint 1</h3><p>All components related to infrastructure are checked into a single git repository for each project or team. This means not only kubernetes templates but furthermore your infra as code like terraform, you’re ansible playbooks, your grafana dashboards, your alerts, docs, you name it.</p><ol><li>You get only one single source of truth, what is actually currently running on your infrastructure and you have one central place where to find runbooks, alert manifests, and documentation.</li><li>You can apply linting and policy checks on this repos CI system, that will allow you to scan everything that goes into your infrastructure systems and apply your own rules. At best this is always as automated as possible, but can also be done by hand at the beginning.</li><li>Disaster recovery is a way easier because GitOps is always centered around Operators that apply the stuff in the repository for you and you have all information and stuff central at one location, at best documented very well. Applying this, reduced our disaster recovery time from 1 day to 50 minutes (A lot of this time is waiting for Infra to be provisioned)</li><li>Central controllability and audit-ability are provided by the git system you are using. If you use for example Gitlab or Github, you can enforce signing of commits by PGP, enforce Pull Request strategies apply policies, extract the git log as audit source and so forth.</li></ol><p>A sample structure could be as follows:</p><p>/ <strong>terraform</strong> -&gt; This will be scanned by your terraform operator (Atlantis) <br>— / <strong>modules</strong> -&gt; can be extracted globally if required in multiple teams <br>— / <strong>workspace</strong> -&gt; the actual folder where terraform is applied from <br>/ <strong>k8s</strong> -&gt; this will be scanned by your kubernetes deploy operator (Flux) <br> — / <strong>prod</strong> -&gt; your production k8s templates <br> — / <strong>int</strong> -&gt; your integration k8s templates <br>/ <strong>templates</strong> -&gt; this could contain your customize overlays (triggered at each push to generate stuff in the k8s folder) <br>/ <strong>docs</strong> <br>/ <strong>runbooks</strong> <br>/ <strong>monitoring</strong> <br> — / <strong>alerts</strong> <br> — / <strong>dashboards</strong> <br>…</p><p>The structure can be as flexible as you need it, the only rule has to be, that each operation on infrastructure is started from this repository.</p><h3>Hint 2</h3><p>Automation is key because it speeds you up immense. So if you are using, for example, Prometheus alerts or grafana dashboards, try to automate the creation of dashboards based on generic templates that can be applied for each http service, displaying RED or USE metrics and also lint and validate this resources automated, so they are all suitable for a schema.</p><p>A simple example is creating the following RED metric graphs ( <a href="https://www.weave.works/blog/the-red-method-key-metrics-for-microservices-architecture/">The RED Method: key metrics for microservices architecture</a>) as code templates and deploy them to grafana for each newly introduced service with a REST API. The same can be done, as stated above, with Prometheus alerts and also other configs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkaF6C9JhYX2HbZ3ivoV6g.png" /></figure><h3>Hint 3</h3><p>Use Operators where possible.</p><p>They will keep the burden away from applying all this stuff manually, it is that simple.</p><ol><li>For example, there is an Operator out there, called <a href="https://www.runatlantis.io/">Atlantis</a>, that can automate your terraform workflow over pipelines by using pull requests. This Operator will apply what you will provide in the repository in the terraform folder, based on pull requests, and with <a href="https://github.com/jml/terradiff">Terradiff</a> you can always control if the desired state equals the declarative.</li><li>To apply kubernetes templates or Helm files, there is an Operator available called <a href="https://github.com/weaveworks/flux">Flux</a> and Flux HelmOperator, by Weaveworks. It will constantly apply the cluster state from inside the clusters itself, based on your template folder.</li></ol><h3>Hint 4</h3><p>Store your secrets encrypted as close as possible in the repository or at least in a way, that they will be automatically picked up after deployment.</p><p>Secrets are still just parts of the deployment, that is why they are required for full disaster recovery for example. If you keep them close, you will be faster and complexity keeps lower. The important step here is to keep them encrypted at all time. The secret is not allowed to be pushed to the repository in an unencrypted form.</p><ol><li>Use an Operator like <a href="https://github.com/bitnami-labs/sealed-secrets">Bitnami Sealed Secrets</a>), that allows encrypting secrets before pushing them to git and decrypting them when they arrive at the cluster (Maybe Mozilla SOPS is also a good option here)</li><li>Use Hashicorp Vault as central secret store and let your deployments pull their secrets from there</li><li>Use your cloud provider offerings to fulfill this task</li><li>Use something like git-crypt or git-secret to manually encrypt them</li></ol><h3>Summary</h3><p>GitOps is beside the fancy name, an approach that can make you more efficient and increase your speed of deployment, but there has to be a mind shift in how you want to handle your infrastructure deployments. In my opinion, the strategy from above works best on project scope. If you want something to be added to the list, feel free to comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5402fe7a8e35" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/monorepo-for-gitops-5402fe7a8e35">Monorepo for GitOps</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Current limitations running Azure AKS in production]]></title>
            <link>https://faun.pub/current-limitations-running-azure-aks-in-production-55b830e89f3c?source=rss-b7ab952f8550------2</link>
            <guid isPermaLink="false">https://medium.com/p/55b830e89f3c</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Matthias Nguyen]]></dc:creator>
            <pubDate>Sat, 02 Feb 2019 15:54:49 GMT</pubDate>
            <atom:updated>2019-11-05T12:28:03.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O_WTC-wkneRkuB42r0mJ5w.jpeg" /><figcaption>Photo by rawpixel on Unsplash</figcaption></figure><h4>Update November 5th, 2019:</h4><p>Node Pools and Availability Zones are stable now. <a href="https://github.com/Azure/AKS/releases">https://github.com/Azure/AKS/releases</a></p><p><strong>Update May 6th, 2019: </strong>Since a couple of days, Azure released an update which unlocks Kubernetes 1.13.5 and brings running Node Pools as a preview feature. We had two incidents regarding persistent volumes since this writing (1.12 version), that were caused by errors between the Azure internal Kubernetes controller and the Kubernetes API. These incidents led to us being unable to deploy or delete anything with a persistent volume attached, because of inconsistencies between the two APIs. Solving these issues was only possible by searching through logs, manually draining some nodes and then detaching the volumes by hand. Azure support mentioned to me, that the persistent volumes claim bugs should be fixed with the new Kubernetes version 1.13.5, so I will take a look into it the upcoming weeks after all our clusters are upgraded. For now, we won’t enable the Node Pool feature, because it would require us to enable options account wide. Additionally Azure now supports Network Policies as a preview feature, but this has to be enabled at cluster creation. The preview features can be found <a href="https://github.com/Azure/AKS/blob/master/previews.md#virtual-machine-scale-sets-vmss--cluster-autoscaler">here</a>.</p><p>A year ago, the company I freelance for has decided to go onto the cloud journey in partnership with Azure. With our project, we agreed to settle on using AKS as managed Kubernetes service because we don’t want to waste a lot of time setting up and managing clusters. <br>Overall we are still very happy with the service, because running this on our own, would require more effort from colleagues taking care of scaling and updating and this would slow our development down. But even if we are happy we have seen some limitations, and that is what this article is all about.</p><h4>1. Provisioning time:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RR8oubeQOm63YN90Uth0CA.jpeg" /><figcaption>Photo by Philipp Berndt on Unsplash</figcaption></figure><p>A cluster can be bootstrapped by Terraform, Azure Resource Templates, Azure CLI or in the web portal. After you submit the command, you have to take your time, because this process will take in average about 15 minutes until you can access your cluster. Steven Acreman from KubeDex has made a very detailed comparison of this issue (see <a href="https://kubedex.com/google-gke-vs-azure-aks-automation-and-reliability/">here</a>). This is especially a little bit annoying if you want to spin up a test cluster to evaluate some things. Also due to the fact, that new machines take also a lot of time, autoscaling is less effective because you have to have some buffer to reduce the impact of slow starting machines.</p><h4>2. Persistent Volume mount time</h4><p>An issue we are stumbling over a lot is, that the Azure persistent volume driver is taking sometimes longer than 7 minutes to reattach a persistent volume from one node to another after a pod of a StatefulSet has been removed. This is not happening each time, but often enough to delay update times. Maybe the AKS 1.12.4 update will resolve this. After we have updated, I will update this section.</p><h4>3. Missing Network security policies</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZPJq9YvH8KC3SIcHERGCg.jpeg" /><figcaption>Photo by Philipp Berndt on Unsplash</figcaption></figure><p><strong>Update: </strong>As is seems Network Security Policies are now available in Preview natively (See <a href="https://docs.microsoft.com/de-de/azure/virtual-network/kubernetes-network-policies">here</a>). An important note is, that this seems only to work with newly created clusters.</p><p>Missing network security policies are a very big issue for us because we have right now just a single cluster and without them the only chance to isolate network zones is Istio. But due to the fact, that Istio has still some issues with StatefulSets and Kubernetes Health Checks it is a very difficult approach to embed the whole cluster into the mesh. The problem here is, that Azure AKS has it’s own Azure CNI driver to connect the cluster with Azure networking. This driver doesn’t support Kubernetes Network Policies right now and so you can’t use them. There is one blog post I found about this (see <a href="https://www.danielstechblog.io/kubernetes-network-policies-on-azure-kubernetes-service-with-azure-npm/">here</a>), describing how azure-npm could be used to enable the feature on Azure AKS. Azure-npm is a plugin from the former Azure Container Services (ACS) that will run as a privileged Daemonset and has access to xtables.</p><pre>- key: CriticalAddonsOnly<br>        operator: Exists<br>      nodeSelector:<br>        beta.kubernetes.io/os: linux<br>      containers:<br>        - name: azure-npm<br>          image: containernetworking/azure-npm:v1.0.13<br>          securityContext:<br>            privileged: true<br>          env:<br>            - name: HOSTNAME<br>              valueFrom:<br>                fieldRef:<br>                  apiVersion: v1<br>                  fieldPath: spec.nodeName<br>          volumeMounts:<br>          - name: xtables-lock<br>            mountPath: /run/xtables.lock<br>          - name: log<br>            mountPath: /var/log</pre><p>I will first try this out in a test cluster, to verify it doesn’t interfere with our current stuff. Also, Azure AKS already has marked, that they are working on Network Security Policies natively support (see updates <a href="https://azure.microsoft.com/en-us/updates/?product=kubernetes-service">here</a>).</p><h4>4. Update cluster duration</h4><p>Updating your cluster in AKS may take a while because the nodes are updated one after another and from what I have seen, the update duration is 10 minutes per node. So if you run a 40 node cluster you will have to wait some hours for the update to go through. Also on our first approach updating to 1.12.4, it seemed like the API server crashed while updating and this led to an unresponsive cluster with no DNS, which was very annoying because no internal service communication was possible anymore. (This should only occur while updating to 1.12.4 because there is a switch from KubeDNS to CoreDNS as far as I have seen) <br>The support fixed the issue on the API server and we ran the update again and got the same error some nodes later. The reason why we updated so early, was the hope this fixes the persistent volume issues from above. (See <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.12.md#changelog-since-v1123">release notes Kubernetes 1.12.4</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*FC7CsoPoD06mDNT9UQKAAQ.png" /><figcaption>Kubernetes 1.12.4 Release Notes</figcaption></figure><p>On Monday we will try the update again and if the persistent volume issue is gone, I will update this article.</p><h4>5. Restriction to same node types (Just one pool)</h4><p>Another very annoying issue is that AKS is currently bound to one node type. So if you select the recommended node type ( D2s v3–2 Cores — 7 GB RAM) you have to stick with it. If you need larger nodes, it is only possible to either spin up a second cluster. You can scale the VMs in your AKS, but after you update your cluster, the nodes will be reset. Azure is also working on supporting multiple node pools, but for now, we have to stick with what we got. This feature is the highest requested one on their ideas board. (See <a href="https://feedback.azure.com/forums/914020-azure-kubernetes-service-aks/suggestions/34917127-support-multiple-node-pool">here</a>)</p><h4>Summary</h4><p>Overall, our team likes the AKS service, for the last year it was very stable and we had no overall issues. But the farther we move on and the more we want to improve on our cluster system for production usage, the more limitations we see currently. Azure seems to work heavily on these, but for now, we have to live with them or provision our own cluster. I don’t want to bash Azure AKS with this article, I just want to show which limitations we have some struggles with to help others decide whether to take the managed service or provision their own cluster. Do you run Azure AKS in production? Are there any issues I forgot, or do you have a different opinion?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Join our community Slack and read our weekly Faun topics ⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55b830e89f3c" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/current-limitations-running-azure-aks-in-production-55b830e89f3c">Current limitations running Azure AKS in production</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitOps — Comparison Pull and Push]]></title>
            <link>https://faun.pub/gitops-comparison-pull-and-push-88fcbaadfe45?source=rss-b7ab952f8550------2</link>
            <guid isPermaLink="false">https://medium.com/p/88fcbaadfe45</guid>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Matthias Nguyen]]></dc:creator>
            <pubDate>Sat, 19 Jan 2019 14:52:05 GMT</pubDate>
            <atom:updated>2019-07-18T15:40:07.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zlS1HfEdlvHCZNng8APVDg.png" /></figure><h3>GitOps — Comparison Pull and Push</h3><h4>Introduction to GitOps</h4><p>In the last year, a new approach was added to the possible deployment options for Kubernetes. This approach is named GitOps and is founded on the core concept, that every deployment is versioned secure inside a git repository.</p><p><strong>The main benefits of this approach are:</strong></p><ol><li><strong>Versioned Deployments &amp; Change history</strong><br>All your cluster state is inside a git repository, and only by committing the users are able to update deployments. Also, every change can be monitored through the git commit history.</li><li><strong>Rollbacks by using git primitives</strong><br>A simple git reset can revert changes of deployments and the old state is always available.</li><li><strong>Out of the box access control</strong><br>A git system is often a place containing a lot of sensitive data, so it is in most firms properly secured. The same grade of security affects now also deployment operations.</li><li><strong>Policies for deployment</strong><br>Out of the box, most git systems support policies on branches, for example, that only Pull Requests can update the master branch and another member of the team has to review and accept the deployment. As with access control, the same policies apply to your deployment updates.</li></ol><p>As you can see, a lot of benefits are waiting on the GitOps site. In the last year, two approaches are rising up, the first one is the push-based one and the second is the pull-based one. Before we analyze them both, we will first take a look at how typical Kubernetes deployments look like.</p><h4>Deployment Ways</h4><p>In Kubernetes different deployment methods and tools have settled over the past years.</p><ol><li><strong>Raw Kubernetes Template Deployments / Kustomize</strong><br>This is the most basic way to deploy applications to kubernetes. The developer creates basic yaml files and applies them to the cluster. To reduce rewriting the same templates again, and again, Kustomize was born, that allows modularizing Kubernetes templates.</li><li><strong>Helm Charts</strong><br>The Helm Charts are an option, to create a bundle of templates, init Containers, Sidecars etc., that are used to deploy one application with more customization than the template approach. In the core, there are heavily templated yaml files, that are filled in with values by the Helm tool and then send to a cluster component called tiller that deploys them to the cluster and allows upgrading and rollbacks. Important is the fact, that under the hood Helm just fills in the template values and then applies the templates as in the traditional approach. There is a variety of helm charts available, spanning a broad range of popular applications.</li><li><strong>Alternative tools</strong><br>There are tons of alternative tools available, all have in common, that they process some kind of templated files into kubernetes understandable yaml files and then submit them.</li></ol><p>At my clients, we regularly use Helm charts for tools we depend on (because they are very solid and reduce work a lot) and raw Kubernetes yaml files to deploy our own applications.</p><h4>Pull &amp; Push</h4><p>In one of my last blog posts, I introduced a tool called Weave Flux, that allows committing templates to a git repository and updates the deployment after each commit or container push. As I have seen, this tool is still one of the main drivers for the pull approach so I will often reference it. If you want more details on how to use it, here is a link to the other blog post. After this is done, we will examine the push approach in detail.</p><blockquote>All benefits of using a GitOps process are valid for both approaches.</blockquote><h4>Pull approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Iv0XeH4cfaP1V26tg0WEQ.png" /></figure><p>The pull approach is based on the fact, that all changes are applied from inside the cluster. There is an operator inside the cluster, that regularly scans the associated git repositories and docker registries and if a change occurs, the cluster state will be updated from inside. This process is generally noted as very secure, due to the fact, that no external client has credentials with admin access to the cluster.</p><p><em>Pros:</em></p><ol><li>No external client has the right to publish to the cluster, all updates are coming from inside.</li><li>Some tools allow also syncing helm chart updates and can sync them to the cluster.</li><li>Docker registries can be scanned for new versions and if a new image is pushed, the git repo and the deployment are updated with the new version.</li><li>Pull-based tools can be distributed in different namespaces, with different git repositories and access rights and through this, a multi-tenant model can be applied. Team A can use namespace A, Team B can use namespace B and Infrastructure Team can have a global one.</li><li>The tools are regularly very lightweight.</li><li>Combined with a tool like Bitnami Sealed Secrets operator, secrets can be placed encrypted inside the git repository and are extracted inside the cluster.</li><li>No coupling on the CD pipelines, because deployments are done cluster internally.</li></ol><p><em>Cons:</em></p><ol><li>Managing secrets of Helm Chart deployments is harder than normal because secret values have to be first created as for example sealed secrets, then be decrypted by an internal operator and then made available to the pull tool. After this has happened, a helm release can be executed with the values in the secrets that are already deployed. The easiest way would be to create a secret of all helm values used for deployment, decrypt it and then commit it to git.</li><li>Through the pull approach, you are bound to the tools executing the pull. This shrinks the possibility to customize the process of applying deployments to the cluster. For example, the usage of Kustomize is harder, because it has to be executed before the result templates are pushed to git. I don’t say that separate tools can’t be used, but it is harder to implement them to the deployment flow.</li></ol><h4>Push approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K834WF1csBM2nQSJ5RReDw.png" /></figure><p>In the push approach, an external system (mostly CD pipelines) are triggering deployments to the cluster, after a git repository was committed to or a previous CI pipeline was executed successfully. In this approach, the pipeline system has access to the cluster.</p><p><strong>Pros:</strong></p><ol><li>Security is determined by the git repository and the build pipeline.</li><li>Deploying Helm Charts can be done easier and with the support of helm plugins.</li><li>Secret management is easier because secrets can be applied to pipelines and also stored encrypted in git, as preferred by the user.</li><li>Not bound to the specific tool, because all kind of tools can be used.</li><li>Container version updates can be injected by build pipeline.</li></ol><p><strong>Cons:</strong></p><ol><li>Cluster credentials are inside the build system</li><li>Updating the containers of deployments is still easier with a pull-based process</li><li>Strongly coupled to the CD system, because pipelines have to be created that are maybe in the language of Gitlab Runners, and then later on the team decides to migrate to Azure DevOps or Jenkins and a lot of the build pipelines have to be migrated.</li></ol><p><strong>Summary — Push or Pull</strong></p><p>I think it is as always, both approaches have their pros and cons and some tasks are easy with the one and harder with the other. At first, I did deployments manually by hand, but after I stumbled over some blog posts of WeaveFlux, it convinced me to implement GitOps processes for all projects. To implement it for all basic templates was an easy process, but then I started to stumble over issues with my helm charts. At this time Weave Flux did only provide a very early version of the Helm Chart Operator and even now, some tasks are harder, because of manually pre-creating secrets and applying them. Now you could argue, that the pull approach is way more secure because cluster credentials aren’t available outside the cluster and this would increase security so much, that the additional effort is worth it.</p><p>I was surprised, that after I rotated this thought a little bit, I came to the conclusion that this is not true. If you think about the components that should be most secure in your organization, this list will include the secret stores and the CICD systems/git repos. The information that is inside them is very sensitive and has to be protected very well. Additionally, if someone manages to break into your git repository and is able to push things there, he can deploy whatever he wants (regardless of push/pull) and infiltrate your cluster systems. So the most critical component to protect is your git repository / CICD systems and not your cluster credentials here. If you have good policies and security measures on this kind of systems and the cluster credentials are only pulled as secrets into the pipelines, the additional security of a pull approach is maybe not as valuable as originally thought.</p><blockquote>Additionally, if someone manages to break into your git repository and is able to push things there, he can deploy whatever he wants (regardless of push/pull) and infiltrate your cluster systems</blockquote><p>So if the effort is higher implementing pull and security is not increased, wouldn’t it be better to use just push-based approach? On the other hand, someone could argue that you are coupling very strongly with the CD system and it is maybe better to not do that, to allow easier migrations later on.</p><p>In my opinion, it is as always, use what is easier for your use case or combine everything. Personally, I use both approaches, WeaveFlux for pull-based deployments, that includes mostly our self-written services, and a push-based approach with Helm and plugins, that makes it very easy to apply Helm Charts to the cluster without stumbling over issues while creating secrets. I guess there will be never a fit it all solution because these topics are always very complex and use case dependent. What I can recommend deeply is using GitOps, because it makes operations life way easier and a lot more secure.</p><p>I hope my personal opinion on this topic makes it easier for you to decide, which approach is suitable for your type of deployments and I would be happy to hear your opinions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Join our community Slack and read our weekly Faun topics ⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88fcbaadfe45" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/gitops-comparison-pull-and-push-88fcbaadfe45">GitOps — Comparison Pull and Push</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous Deployment to Kubernetes with GitOps (Weave Flux)]]></title>
            <link>https://medium.com/@m.k.joerg/gitops-weave-flux-in-detail-77ce36945646?source=rss-b7ab952f8550------2</link>
            <guid isPermaLink="false">https://medium.com/p/77ce36945646</guid>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[weave]]></category>
            <category><![CDATA[deployment-automation]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Matthias Nguyen]]></dc:creator>
            <pubDate>Wed, 25 Jul 2018 20:51:01 GMT</pubDate>
            <atom:updated>2018-08-10T07:58:45.873Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*R28u8gj-hVdDFISoYqPhrQ.png" /><figcaption>Weave Flux — GitOps</figcaption></figure><p>I am currently working as a freelancer in a project, where we are building a Java Spring Boot microservice system. In my current role, I am responsible for the devops tasks (setting up infrastructure, creating pipelines, etc…).<br><br>In the beginning I created a helm chart, that could be triggered with a values.yaml and then deploys our services in a generic way to kubernetes. This meant, each project had it’s own helm values and then we executed the deployment with a chart and this values. The process worked very well for a while, but it had some downsides.</p><ol><li>Tiller was running in default configuration with admin permissions in the cluster and every developer needed to access it.</li><li>There was no way of seeing the changes made to the configuration on first look.</li><li>The container images weren’t updated automatically if a new container was pushed to the repository.</li><li>The helm charts weren’t easy to write and read.</li></ol><h4>Introduction to Weave Flux</h4><p>After a short research I stumbled over a project called Flux, by Weave (<a href="https://github.com/weaveworks/flux">See the repo</a>). This project is actually an operator that is running inside your cluster and solves the downsides from above in a simple way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*ei2vOgUNnb5C8BYy20c3Ew.png" /><figcaption>Weave Flux — Overview</figcaption></figure><p>As you can see in the illustration, the weave works operator scans a remote git repository and one or multiple docker registries. If you commit a yaml file to the git repository, the operator automatically deploys what is described in there (The GitOps way). After the second commit, the operator will update the changed resources. Over a CLI tool called fluxctl, the user can setup certain automation tasks like updating the container automatically if a new image is pushed to the container registry. <br>As you can see, this tool solves all issues mentioned above. First the operator is pulling the configuration and hasn’t to be accessed directly. This is very different to tiller, where each user has to connect with helm to tiller for deploying stuff. <br>Also the developer has to commit a change to the central repository, what leads to auditable changes, the resources are plain kubernetes yaml files that are easy to read and to adjust. The operator can automatically update the deployment if a new image version is available.</p><h4>Setup</h4><p>The flux operator can be installed by helm or template. I used helm for this task, due to the fact that it was already installed, but the template way is also valid, if you don’t want use Helm at all.</p><ol><li>Create a git repository containing the templates</li><li>Add the flux chart to your repo</li></ol><pre>helm repo add weaveworks <a href="https://weaveworks.github.io/flux">https://weaveworks.github.io/flux</a></pre><ol><li>Then create a <strong>values.yaml</strong></li></ol><pre># Default values for flux.<br>nameOverride: &quot;flux&quot;<br><br># Weave Cloud service token<br>token: &quot;&quot; #Can be left empty if you don&#39;t own weave cloud license<br><br>replicaCount: 1<br><br>image:<br>  repository: quay.io/weaveworks/flux<br>  tag: 1.4.2<br>  pullPolicy: IfNotPresent<br><br>service:<br>  type: ClusterIP<br>  port: 3030<br><br>helmOperator:<br>  create: false<br>  repository: quay.io/weaveworks/helm-operator<br>  tag: 0.1.1-alpha<br>  pullPolicy: IfNotPresent<br>  tillerNamespace: kube-system<br>  tls:<br>	secretName: &#39;helm-client-certs&#39;<br>	verify: false<br>	enable: false<br>	keyFile: &#39;tls.key&#39;<br>	certFile: &#39;tls.crt&#39;<br>	caContent: &#39;&#39;<br><br>rbac:<br>  # Specifies whether RBAC resources should be created<br>  create: true<br><br>serviceAccount:<br>  # Specifies whether a service account should be created<br>  create: true<br>  # The name of the service account to use.<br>  # If not set and create is true, a name is generated using the fullname template<br>  name:<br><br>resources:<br>  # If you do want to specify resources, uncomment the following<br>  # lines, adjust them as necessary, and remove the curly braces after &#39;resources:&#39;.<br>  limits:<br>   cpu: 2000m<br>   memory: 2Gi<br>  requests:<br>   cpu: 100m<br>   memory: 128Mi<br><br>nodeSelector: {}<br><br>tolerations: []<br><br>affinity: {}<br><br>git:<br>  # URL of git repo with Kubernetes manifests; e.g. git.url=ssh://git@github.com/weaveworks/flux-example<br>  url: &quot;&lt;your-git-repo-address&gt;&quot;<br>  # Branch of git repo to use for Kubernetes manifests<br>  branch: &quot;master&quot;<br>  # Path within git repo to locate Kubernetes manifests (relative path)<br>  path: &quot;&quot;<br>  # Username to use as git committer<br>  user: &quot;&lt;git-user&gt;&quot;<br>  # Email to use as git committer<br>  email: &quot;&lt;your-mail&gt;&quot;<br>  # Path within git repo to locate Helm charts (relative path)<br>  chartsPath: &quot;charts&quot;<br>  # Period at which to poll git repo for new commits<br>  pollInterval: &quot;30s&quot;<br><br>ssh:<br>  # Overrides for git over SSH. If you use your own git server, you<br>  # will likely need to provide a host key for it in this field.<br>  known_hosts: &quot;&lt;the-key-of-the-known-host-here&gt;\n&quot;<br><br>#for https://github.com/justinbarrick/fluxcloud/<br>#additionalArgs:<br># - --connect=ws://fluxcloud</pre><p>In my case, I used a private git repository. This required, to setup first the git url and the target branch and then to store the known host key in the field.</p><p>The template required me to have a „n“ at the end of the key, because without it a deployment wasn’t possible. At the end the known hosts key value looked like the following:</p><pre>&quot;vs-ssh.visualstudio.com ssh-rsa AAAAB3...0lfKob4Kw8H\n&quot;</pre><ol><li>After this you can execute the following command, to install weave flux to your cluster:</li></ol><pre>helm install \<br>  --name flux \<br>  --namespace &lt;your-namespace&gt; \<br>  -f values.yaml \<br>weaveworks/flux</pre><ol><li>After the operator started, go up into the logs until you find the public ssh key, that weave flux created. This key has to be added to your git server, because the operator uses this way to access your repository. After the key is deployed on your git server, the operator starts to fetch the contents for deployable templates. Also flux examines your cluster and scans all existing deployments and images used.</li></ol><h4>Usage</h4><p>The first obvious step is to place some templates in the git repository.</p><p>I created the folder structure as following:</p><pre>- /project-name<br>  - /backend<br>    - template1.yaml<br>    - template2.yaml<br>  - /frontend<br>    - ....</pre><p>Actually the folder structure is completely up to your preferences, because weave scans all folders under the path that has been set in the values above.</p><p>After you add the templates, weave starts automatically to deploy your templates to the cluster.</p><h4>Private Registry</h4><p>If you use a private docker registry it is important, to provide a registry secret to the according namespace and write this secret as pull secret into the deployment itself.</p><blockquote>Weave flux can’t read the secret just from the namespace.</blockquote><p>First you need to create the secret for the registry in the namespace (<a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/">See instructions here</a>). After this, the secret has to be added to the deployment:</p><pre>---<br>apiVersion: v1<br>kind: Service<br>...<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  ...<br>	spec:<br>	  containers:<br>	  - name: containername<br>		image: &quot;private.registry:test-v100&quot;<br>	...<br>	  imagePullSecrets:<br>	  - name: registry-secret</pre><h4>Automation</h4><p>Now we have deployed the templates to the cluster, but weave flux doesn’t update the container after a new one has been pushed, whats wrong there?</p><p>Actually we need to enable the automation explicitly. This can be done by either the command line tool fluxctl (<a href="https://github.com/weaveworks/flux/releases">Download here</a>) or by adding labels to the templates.</p><h4>1. Fluxctl</h4><p>The usage of fluxctl is a little bit complicated, because it targets by default the weave cloud address. After some research I found out how to use it with the standalone version:</p><pre>kubectl port-forward deploy/&lt;deploymentname&gt; 10080:3030<br>export FLUX_URL=&quot;http://localhost:10080/api/flux&quot;<br>fluxctl list-controllers -a</pre><p>This will list all deployments in the cluster. The port-forward deploy is just a shortcut to not use the pod name. You can also do this just by forwarding the pod directly.</p><p>After this you can enable automation with fluxctl by using the <em>fluxctl automate</em> option or adjust which tags should be updated by <em>fluxctl policy</em>. To see all available commands just type:</p><pre>fluxctl -h</pre><h4>2. Adding annotations</h4><p>The fluxctl commands from above, just add annotations to the templates that are stored in git. You can easily set them on your self without using the fluxctl command line tool.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>...<br>  annotations:<br>	flux.weave.works/tag.&lt;containername&gt;: glob:develop-v*<br>	flux.weave.works/automated: &#39;true&#39;<br>spec:<br>  replicas: 1<br>...<br>	  containers:<br>	  - name: &lt;containername&gt;<br>		image: &quot;test-image:develop-v100&quot;</pre><p><strong>This two lines will do the following:</strong></p><p>Update the container if a new develop-v.. image is pushed and enable automation.</p><h4>Summary</h4><p>I am very happy with the weave works operator. The technology is easy to use and there are also some benefits that I haven’t mentioned yet. For example if you deploy to multiple clusters in multiple regions, you can just setup the weave operator in each cluster and it pulls the configs from git and deploys your services fully automatically. I will play around with the operator for a while and battle test it. Also I will still use Helm to deploy a lot of applications, because there are well written templates already there. But for simply deploying a self developed service to kubernetes, I will stick to Flux now. Is there something I overlooked or where I am wrong? Please tell me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77ce36945646" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Installers for Cloud and Bare Metal]]></title>
            <link>https://medium.com/@m.k.joerg/overview-of-kubernetes-installers-8f06437d215a?source=rss-b7ab952f8550------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f06437d215a</guid>
            <category><![CDATA[baremetal]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubeadm]]></category>
            <category><![CDATA[rancher]]></category>
            <category><![CDATA[kops]]></category>
            <dc:creator><![CDATA[Matthias Nguyen]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 20:21:32 GMT</pubDate>
            <atom:updated>2018-07-29T10:53:42.632Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5T4p_rjr1GQh8tf3nYuZPA.png" /></figure><p>When I started experimenting with Kubernetes, it was very difficult to provision a production ready high available cluster. The setup included lots of manual steps like creating certificates, installing binaries and create a lot of config files. To understand how to setup a cluster and how the individual parts are working together, I used the „<a href="https://github.com/kelseyhightower/kubernetes-the-hard-way">Kubernetes the hard way</a>“ guide of Kelsey Hightower. <br><br>After failing for nearly a week, I managed to setup my first high available cluster doing it all manually and it really helped me to understand the purpose of each Kubernetes component and how they are working together. Even though going through this process taught me a lot I wanted to avoid this error prone manual process. This started my search for easier ways of installing.<br>There are plenty of tools out there to install a fully functional production ready cluster, and this were my requirements:</p><ul><li>Usable for On-Premise systems</li><li>Possibility to automate installation</li><li>Able to deliver high available setups</li><li>Possibility to configure cluster as far as needed</li><li>Open Source and well maintained</li><li>Easy to use and straight forward</li><li>Well documented</li><li>Often used, to harden the process</li></ul><p>The On-Premise part is very important to me, because due to my work as freelancer, I come in touch with many different infrastructure setups and I wanted a way that works for all of them. Because of this requirement, I am focusing on the tools that follow and not on the provisioning services in the big cloud systems like AKS (Azure), GKE (Google), EKS (AWS) and many more. Maybe they will follow in a later blog post.</p><h4>Installers:</h4><p>After my research I found the following installers to be the most interesting and used ones:</p><ul><li><a href="https://github.com/kubernetes/kops"><strong>Kops</strong></a>: Allows very automated installation of Kubernetes in AWS, GCE and Digital Ocean. There are more planned, but the tool seems to have a strong focus on cloud providers.</li><li><a href="https://github.com/kubernetes-incubator/kubespray"><strong>Kubespray</strong></a>: Allows setup of Kubernetes infrastructure with ansible scripts and the ability to install addons additionally. Can be used On-Premise and in cloud systems.</li><li><a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/"><strong>Kubeadm</strong></a>: Official installation tool of Kubernetes, currently in beta. Allows easy setup of single node clusters and inlcudes a guide for high availability, since the last update. Can be used On-Premise and in cloud systems.</li><li><a href="https://github.com/rancher/rke"><strong>RKE</strong></a>: A very new installer, by the Rancher team. Very lightweight solution that can bootstrap clusters from a single yaml file. Can be used On-Premise and in cloud. Supports also addons.</li></ul><h4>1. Kops</h4><p>Kops was one of the first major installation tools for Kubernetes. It is often used and also referenced in a lot of blog posts, because it seems to be very reliable and tested. <br><br><strong>Pros</strong>:</p><ul><li>Declarative provisioning with yaml files and cli tool</li><li>Allows high available installation</li><li>Allows upgrades</li><li>Same installer for multiple clouds</li><li>Well documented</li></ul><p><strong>Cons</strong>:</p><ul><li><em>Only usable in cloud systems</em></li><li>A little bit behind the newest version of Kubernetes</li></ul><p><strong>Impressions</strong>: This installer is a good way to get started with Kubernetes in cloud systems. It allows high availability installation and is fully customisable. I didn’t dig deeper into this one, because it doesn’t support the On-Premise functionality, but it seems to be a good choice for production grade cloud installations.</p><h4>2. Kubespray</h4><p>This is the installer I used the most for my bare metal setups. It is highly customisable and completely based on ansible. This allows experienced users to change certain playbooks.<br><br><strong>Pros</strong>:</p><ul><li>Declarative installation with variables and inventory</li><li>Allows high available installation</li><li>Allows upgrades</li><li>Can be used for all cloud systems and on-premise or bare metal</li><li>Allows parallel setup of Hashicorps Vault for secret management</li></ul><p><strong>Cons</strong>:</p><ul><li>Installation takes long</li><li>Addons often in older versions (Istio)</li><li>A lot of knowledge about Kubernetes needed</li><li>Not very well documented</li><li>Failure in configs can easy happen and can have major impact</li><li>A little bit behind the newest version of Kubernetes</li></ul><p><strong>Impressions</strong>: This installer was my go-to solution, due to the fact that there weren’t many solutions for on premise systems and I knew a little bit about ansible. The issue for me was the lack of documentation. I hadn’t a deep understanding of Kubernetes configuration and a lot of settings in the template weren’t self explaining. But after some research, I understood all flags needed for my installations.</p><h4>3. Kubeadm</h4><p>The official solution for installing Kubernetes clusters. Very easy to execute and is already configured with best practice settings. (<a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/">Getting started guide</a>)<br><strong>Pros</strong>:</p><ul><li>Very easy installation</li><li>Well documented</li><li>Allows upgrades</li><li>Already very well configured</li><li>Can be used for all cloud systems and on-premise or bare metal</li><li>High availability possible, but see contra…</li><li>Newest version available</li></ul><p><strong>Cons</strong>:</p><ul><li>High availability installation is <a href="https://kubernetes.io/docs/setup/independent/high-availability/">complicated</a> and requires a lot of manual steps.</li><li>Still in Beta</li></ul><p><strong>Impressions</strong>: I have used this installer to bootstrap some simple clusters and it would have been my go-to solution if there would’ve been an easy high availability option. For beginners it is the quickest and best way to get to a running Kubernetes installation. Also a lot of installation solutions are starting to implement Kubeadm into their process. The biggest downside is the complicated high availability setup process, but this will be certainly solved in the future. See <a href="https://blog.heptio.com/moving-the-needle-on-kubeadm-in-kubernetes-1-11-90a87ddb9d0f">this blog post</a> of Heptio.</p><h4>4. RKE</h4><p>The newcomer under the Kubernetes installation tools. The Rancher team needed a simple way of bootstrapping clusters, because the Rancher 2.0 server is used to provision and manage multiple clusters. It is an interesting solution because it is very fast and can be configured by one yaml file. <br><br><strong>Pros</strong>:</p><ul><li>Easy installation &amp; upgrades</li><li>Declarative approach, only one yaml</li><li>Allows high availability</li><li>Well documented</li><li>Includes backup solution for etcd</li><li>Can be used for all cloud systems and on-premise or bare metal</li><li>Easy to automate</li></ul><p><strong>Cons</strong>:</p><ul><li>Lesser used than above ones</li><li>A little bit behind the newest version of Kubernetes</li></ul><p><strong>Impressions</strong>: RKE seems like a slim version of Kubespray and Kubeadm. It is very well thought through and easy to use. Also the documentation looks promising and the configuration isn’t that hard. I will dig into this one deeper, because I think it can be a real replacement for Kubeadm and Kubespray in my setups.</p><h4>Summary</h4><p>Many of the solutions are very well suited for the On-Premise or Bare Metal installations of Kubernetes. In my opinion, kubeadm is an easy way to get started, Kubespray is very powerful and more easily customiseable, but also very complex and RKE is an interesting newcomer. All three have everything necessary to provision production ready clusters, but they are very different in detail. For me, Kubespray is still a good installer, that execxutes it’s job very well, but RKE is a very interesting alternative. I’ve planned to setup a Rancher Master Server cluster with RKE and will share my experiences in a follow up blog post. What are you’re thoughts about Kubernetes installers? Are there some interesting ones I forgot? Always happy to learn something new.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f06437d215a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>