<?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 Oleksandr Slynko on Medium]]></title>
        <description><![CDATA[Stories by Oleksandr Slynko on Medium]]></description>
        <link>https://medium.com/@slynko?source=rss-5d9e64b3a5a3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T8DSXj_2d3g69Qhafdv0Ng.jpeg</url>
            <title>Stories by Oleksandr Slynko on Medium</title>
            <link>https://medium.com/@slynko?source=rss-5d9e64b3a5a3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:06:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@slynko/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[Ginkgo practices]]></title>
            <link>https://slynko.medium.com/ginkgo-practices-9973d5ef00ed?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9973d5ef00ed</guid>
            <category><![CDATA[ginkgo]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Mon, 12 Apr 2021 15:22:49 GMT</pubDate>
            <atom:updated>2021-04-12T15:22:49.063Z</atom:updated>
            <content:encoded><![CDATA[<p>Inspired by <a href="https://medium.com/@william.la.martin/ginkgotchas-yeh-also-gomega-13e39185ec96">Ginkgotchas</a> and <a href="https://medium.com/swlh/effective-ginkgo-gomega-b6c28d476a09">Effective Ginkgo/Gomega</a>.</p><h4>Minimum global variables</h4><p>Try not to use variables outside of the tests. It is possible to shadow variable, it is easy to miss the initial definition. It adds confusion.</p><p>And if you are using global variables, always assign the value in BeforeEach block. It is easy to find, if you are running the tests in the random order all the times.</p><p>One particular concern is the global variable `err`.</p><p>For some tests, the difference between the cases are only parameters of the function and the return type.</p><p>I have seen tests which consisted only from the single line and a bit different BeforeEach. Saving of the single line not worth adding the confusion and extra using of JustBeforeEach.</p><h4>Error handling</h4><p>One of the typical patterns I see in Gomega tests is the overuse of Expect(err).NotTo(HaveOccurred()) . Sometimes it is easy to track, but mostly it is just confusing. Why the error happened, what was the call. You quite often have to go inside the test to uncover the problem. It might be even worse for the cases when you expect the error and it does not happen.</p><p>If you want more context, you can read <a href="https://github.com/kubernetes/kubernetes/issues/34059">this long-running issue in Kubernetes</a>.</p><h4>GinkgoWriter</h4><p>The typical way to see what is happening is to write logs. Typically, people write in stdout and do this in tests as well. This pollutes the nice output. To prevent it, use GinkgoWriter. It can be used instead of stdout and hides the output unless the test fails or you run the test in the verbose mode.</p><h4>Use ginkgo binary</h4><p>There is a built-in way of running tests: go test . Ginkgo supports it, but also provides its own binary. It is much better to use ginkgo . It provides several goodies: ginkgo watch , flags to randomize tests and suits, one of my favourites flags to look for the flakes -untilItFails .</p><p>I suggest using ginkgo -r -race -randomizeSuites -randomizeAllSpecs -keepGoing because it makes it easier to find any flakes you can have.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9973d5ef00ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pod security policies]]></title>
            <link>https://slynko.medium.com/pod-security-policies-732e575b64a9?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/732e575b64a9</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 21:28:31 GMT</pubDate>
            <atom:updated>2020-08-31T21:28:31.916Z</atom:updated>
            <content:encoded><![CDATA[<h4>Five things I wish i knew before I used PSPs</h4><p>Pod security policy is an attemp to improve security defaults in Kubernetes for applications to allow operators to set presets for it.</p><p>About two years ago we have started <a href="https://www.pivotaltracker.com/story/show/155793102">investigation</a> for using them in Cloud Foundry Container Runtime. We took it seriously because we didn’t want to break existing users and make the transition painless. At that time, Kubernetes documentation was not as good as right now so we had to learn some things in a hard way.</p><p>We have started the Pod Security Policies due to <a href="https://www.cisecurity.org/benchmark/kubernetes/">CIS benchmark for Kubernetes</a>. You might take a look there, it covers lots of things, but before you start implementing it, you have to understand the reasons behind each point and how the features interact with each other. This leads to my first point.</p><ol><li>Enabling pod security policies requires you to allow users to modify some security aspects in their application. You will have to remove the SecurityContextDeny. This contradicted the benchmark before and has been fixed recently.</li><li>The pod security policies can mutate the pod definition by setting the user id or seccomp annotation if those are not specified.</li><li>The policies are chosen alphabetically and if your pod does not specify some of the properties, more strict policy might be chosen. For example, the policy that specifies run with non-root might be chosen if your pod does not specify which user it will run with. As a result, you can create some very restrictive policy with lots of letters a at the beginning and assign it to all service accounts to catch the applications that has not specified proper pod security policy and properties.</li><li>You can check which security context the pod will use by checking the pod annotations and that is the only way to find out. It is not possible to assign specific pod to specific policy.</li><li>The only way to validate that policy satisfies the application is to deploy them.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=732e575b64a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why does Cloud Foundry not use Eirini to deploy itself?]]></title>
            <link>https://slynko.medium.com/why-does-cloud-foundry-not-use-eirini-to-deploy-itself-ef9b6205f1a?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef9b6205f1a</guid>
            <category><![CDATA[cloud-foundry]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 22:53:16 GMT</pubDate>
            <atom:updated>2020-04-15T07:32:11.578Z</atom:updated>
            <content:encoded><![CDATA[<h4>Or why we don’t feed our dogs with caviar?</h4><p>I might be a little bit biased, but I think Cloud Foundry is a pretty good platform to run applications. Cloud Foundry on Kubernetes uses Eirini to schedule applications. However, it uses different applications to deploy itself. The obvious question is why does Cloud Foundry does not deploy itself using Eirini.</p><p>To answer this question, I will separate the applications in two big chunks — platform applications and user-facing applications.</p><p>Platform applications are usually rarely updated, some vendor provides a verified version and this version is installed on multiple servers. The important qualities of such applications are the reproducibility(especially after several weeks), the ability to find the exact version and correlate it with the code to debug it.</p><p>User-facing applications are updated more often, sometimes several times a day. Usually, only a single version is deployed. The speed of the build is more important for such applications, upgradability of the components is also quite important. The number of user-facing applications deployed is bigger than the number of platform applications. (If it is not the case, you are doing something wrong). In the end, the developer does not need to know all the limitations and best practices for the platform, so if something applies the best practices for a developer this is a big help.</p><p>Cloud Foundry can build the application, but there is no need to rebuild the component for each deployment, you should use prebuilt image. Cloud Foundry adds routes, but there is no need to add routes for system components. Most of user-facing applications don’t need access to Kubernetes API or Cloud Foundry API, so it should be not available from there; components rely on the access to Kubernetes API.</p><p>Cloud Foundry is one of the best places to run user-facing applications, but not so much for platform applications. This separation allows to prioritise more important features for Cloud Foundry components rather than adding support for Kubernetes configs.</p><p>Will this change? Probably. But or the nearest future the dogfooding won’t work. Cloud Foundry components need a different kind of food.</p><p>PS. This is my personal view and it does not represent my current and previous teams, employers, colleagues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef9b6205f1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes upgrades — the boring way]]></title>
            <link>https://slynko.medium.com/kubernetes-upgrades-the-boring-way-4fe535fc73d5?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fe535fc73d5</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Sun, 22 Mar 2020 16:26:47 GMT</pubDate>
            <atom:updated>2020-03-22T16:26:47.031Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes upgrades — the boring way</h3><h4>Upgrade a month keeps the problems quite far</h4><p><a href="https://www.slideshare.net/offslinker/upgrade-kubernetes-the-boring-way">This article is based on my presentation for K8s day in Amsterdam</a> in 2018.</p><p>I have worked on Cloud Foundry Container Runtime for almost two years. The main goal of the project is to provide Enterprise-ready Kubernetes. We have been upgrading Kubernetes since the first version. Upgrade pipeline probably was the first one that we had implemented. And as a result, I can honestly say that I upgraded thousands of clusters.</p><p>Upgrades of Kubernetes clusters are not that hard. To be honest they quite boring and simple, the only thing that is required is to follow the process. Unfortunately, most operators do not trust in their process and do not upgrade their clusters often enough. That leads to problems in upgrades and slows them down. But let’s get to the point.</p><h3>How to upgrade a Kubernetes cluster?</h3><p>First of all, what does the typical cluster consist of? Etcd for data storage, several master nodes with the control plane(kube-apiserver, kube-scheduler, kube-controller-manager) and lots of worker nodes.</p><p>The upgrade is a simple as restart all the components with new versions of packages. But before doing the restart you have to do the backup. I have done it with <a href="https://etcd.io/docs/v3.3.12/op-guide/recovery/">etcdctl snapshot</a> and velero . Both worked fine, the only important thing is to practice restoring the backup and verify its consistency.</p><p>And one more thing that you want to do before the upgrade is to verify that cluster works fine.</p><p>First, on some installations, you can verify that master components are running successfully by running kubectl get componentstatus command. Unfortunately, there <a href="https://github.com/kubernetes/kubectl/issues/762">is a bug</a> with a newer CLI and API server that might prevent you from doing that. Also, at some point, AKS was responding with <a href="https://github.com/kubernetes/kubernetes/issues/74643">failure to the request</a>, I don’t have the AKS cluster to verify if this is still the case.</p><p>The second verification step is to check if all nodes are fine. That is easy to do, just run kubectl get nodes and check that all nodes are ready.</p><p>The third step is to check that all pods are running:</p><pre>kubectl get pods — all-namespaces — field-selector &#39;status.phase!=Running,status.phase!=Succeeded&#39;</pre><p>This command will show all the pods are not running or not finished successfully for the jobs. We haven’t added automatic check because it is up to the operator to decide if the crashing pods are acceptable.</p><p>After verifying that the cluster is in the upgradable state, we can start the actual upgrade procedure.</p><h3>Upgrading Etcd</h3><p>Etcd has quite good <a href="https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/">documentation</a> on how to upgrade, Kubernetes also has a <a href="https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/">documentation page about upgrading etcd</a>.</p><p>Etcd and Kubernetes have a different upgrade cycle and can be upgraded separately. In my experience, people usually collocate etcd with master components. The benefit is reduced footprint, the disadvantage is an increased coupling. I will suppose that etcd is running separately, but it doesn’t change a thing.</p><p>The way I would do it is to delete the old etcd node and add the new one. There are several possibilities. You can attach the disk from the previous node and make the new node use the same name. This is how Cloud Foundry Container Runtime does it.</p><p>Alternatively, you can just delete the old etcd node, remove it from the cluster and add the new one. Then wait for some time until it gets all the data. The long-time Kubernetes user told me that their company does it.</p><h3>Upgrading masters</h3><p>The master nodes usually have three components running: kube-apiserver, kube-scheduler and kube-controller-manager.</p><p>The API server is stateless and serves the data from the etcd database. The scheduler and controller manager connect to the API server and do the work. Only one scheduler and controller manager can be active at any single moment. The re-election happens periodically.</p><p>To upgrade the master simply just delete the master node and start the master with the new version. You might experience tiny downtime in API and the scheduling will interrupt for several seconds.</p><p>It is important to know that during the minor version upgrade the schema might change, some roles might get removed. It is safer to check the release notes and then add the missing pieces separately.</p><p>After upgrading the master you will have a working cluster with a <a href="https://kubernetes.io/docs/setup/release/version-skew-policy/">skew version</a>.</p><h3>Upgrading workers</h3><p>The next step is to upgrade workers. It is a little bit harder than masters upgrade because you need your applications to stay running during the process.</p><p>It is possible, especially for patch upgrades just restart binaries on the nodes. This will keep your applications running without restarts, it is possible even to restart some container runtimes with the containers going down. This, however, introduces complexity and I would suggest recreating the node anyway. You can either create a new node in advance or first delete the old one. This will cause pods to restart on your nodes. So let’s get prepared.</p><p>Firstly, the applications have to be configured properly. There are multiple things to do, for example, you can check <a href="https://github.com/cloudfoundry-incubator/kubernetes-guidelines/blob/master/DETAILED.md#upgrades">Cloud Foundry guidelines</a> that I wrote. The main idea is that at any given time at least one replica of the application should be ready to serve traffic.</p><p>Before upgrading the node, you first have to <a href="https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/">drain</a> it. This is the main time-consuming task for upgrades. If your applications are incorrectly configured, your upgrade might be stuck forever(<a href="https://github.com/cloudfoundry-incubator/kubo-release/pull/219">this issue</a> in Cloud Foundry Container Runtime describes the problem). This is the reason, why some installations don’t do drain(I have seen the cases when draining the node in advance prevented upgrade issues) or force timeout during the drain(ie GKE <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades">has 1-hour timeout</a>). Drain also cordons the node(prevents it from scheduling more applications). Draining is a concept of the kubectl and not part of Kubernetes API as of now, so to do it programmatically you have to call kubectl drain command.</p><p>Now, there is one tricky step that is very valid if you use volumes and on-prem solutions. You have to wait for all disks to detach from the virtual machine. When pods with persisted storage are deleted, the disks stay attached to the VM. This the optimisation for a faster restart, but in the upgrade case, the pod case to start on a different VM, so when this happens, cloud provider requests the disk to be detached from current VM and attached to a new one. This takes time, and if the node is unavailable at the given time, the cloud provider might wait for it. I experienced 30 minutes waiting time for one of the volumes, the waiting usually takes less than a minute.</p><p>Now, you can delete the node and repeat it until the process is finished.</p><p>As you can see, the process is relatively simple but will take time and requires periodic testing. As I mentioned most Kubernetes providers do that for you, and you just have to relax and repeat the process at least once three months.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fe535fc73d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging cf-for-k8s]]></title>
            <link>https://slynko.medium.com/debugging-cf-for-k8s-51eba58e114e?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/51eba58e114e</guid>
            <category><![CDATA[cloud-foundry]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Sat, 15 Feb 2020 14:55:58 GMT</pubDate>
            <atom:updated>2020-02-15T18:16:51.393Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use Kubernetes primitives to find the problem in Cloud Foundry applications</h4><p>Three weeks ago <a href="https://github.com/cloudfoundry/cf-for-k8s">the cf-for-k8s</a> repository has been open-sourced. It allows you to deploy Cloud Foundry components in Kubernetes and use cf push against that deployment. There are already several projects that enable deploying Cloud Foundry to Kubernetes — <a href="https://github.com/SUSE/kubecf">KubeCF</a>, its previous version <a href="https://github.com/SUSE/scf">SCF</a>, several Kubernetes <a href="https://github.com/bosh-cpis/bosh-kubernetes-cpi-release">CPIs</a> <a href="https://github.com/sap/bosh-kubernetes-cpi-release">for</a> <a href="https://github.com/cfibmers/kubernetes-cpi">Bosh</a>. However, they all leverage BOSH in one way or another, cf-for is the first native project that uses everything built from scratch.</p><p>The project is just started and has minimal functionality that enables teams to integrate. Right now it only allows users to use Docker push, but there is work ongoing to introduce <a href="https://github.com/pivotal/kpack">kpack</a> as a building mechanism.</p><p>Deploying cf-for-k8s is relatively simple, you can follow <a href="https://github.com/cloudfoundry/cf-for-k8s/blob/master/docs/deploy.md">the official readme</a>. However, problems might happen. What to do when the application doesn’t work? To do that you need to know a deployment flow.</p><h3>How does cf push work in cf-for-k8s?</h3><p>(This section will be missing some pieces soon when features are getting added to the cf-for-k8s).</p><p>The first step is staging. During that step, the application is prepared to run. In case of source code it is compiled and put on Docker image. When you are pushing the Docker image, Eirini should extract the port on which application is running, so it can generate the health check, but right now this happening in CAPI. We are working <a href="https://www.pivotaltracker.com/story/show/169060978">on a story to fix it</a>. The important part that during the staging process CAPI will make a call to Eirini and wait for a callback(but not right now).</p><p>The next step is deploying. CAPI sends the request to Eirini with the application information. Then Eirini creates a stateful set which creates a pod.</p><p>In the parallel, the routesync component makes sure that application is routable. It creates a service in Kubernetes and a virtual service for Istio. As soon as application starts it is routable.</p><h3>Debugging</h3><p>So imagine, you have pushed the application but you can’t access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jrhp9ptIlWKBVYQ0I_ez9w.png" /><figcaption>Something like this</figcaption></figure><p>Now when you know what is happening you can debug the issue.</p><p>First, you can check if routesync worked fine — check if you have a service and a virtual service: kubectl get virtualservices.networking.istio.io,services -n cf-workloads . If they are not, you should check the logs for the routesync component kubectl -n cf-system logs cfroutesync-6b6844444-xrdm --all-containers</p><p>Then you can check if the pods are created: kubectl get pods -n cf-workloads. If there are no pods, you can also check statefulsets kubectl get statefulsets -n cf-workloads .</p><p>If there are stateful sets, but not pods there might be several reasons and you can find them if you run kubectl describe statefulset -n cf-workloads and find out the reason why. There might be not enough resources or something wrong with the security policy.</p><p>If there are no stateful sets, then Eirini didn’t work, so check the logs. You should see the logs with all requests from CAPI something like :</p><pre>{&quot;timestamp&quot;:&quot;2020-02-15T14:38:35.767557362Z&quot;,&quot;level&quot;:&quot;debug&quot;,&quot;source&quot;:&quot;handler&quot;,&quot;message&quot;:&quot;handler.get-app.requested&quot;,&quot;data&quot;:{&quot;guid&quot;:&quot;a2448075-715c-40a9-aead-7e8230cdb709&quot;,&quot;session&quot;:&quot;3&quot;,&quot;version&quot;:&quot;2d45687b-d7cb-4850-9b6a-f8152a1a1dcd&quot;}}</pre><p>If you don’t see that message in logs, then there is an issue at CAPI end and you can try to check CAPI logs for the issue. In this case, the issue was with the wrong certificate. I know that because I found the issue in logs:</p><pre>{&quot;timestamp&quot;:1581544219.7816372,&quot;message&quot;:&quot;Request failed: 503: {\&quot;description\&quot;=&gt;\&quot;Instances information unavailable: hostname \\\&quot;eirini.cf-system.svc.cluster.local\\\&quot; does not match the server certificate\&quot;, \&quot;error_code\&quot;=&gt;\&quot;CF-InstancesUnavailable\&quot;, \&quot;code\&quot;=&gt;220002, \&quot;test_mode_info\&quot;=&gt;{\&quot;description\&quot;=&gt;\&quot;Instances information unavailable: hostname \\\&quot;eirini.cf-system.svc.cluster.local\\\&quot; does not match the server certificate\&quot;, \&quot;error_code\&quot;=&gt;\&quot;CF-InstancesUnavailable\&quot;, </pre><p>The debugging process is one of the main reasons why Cloud Foundry moves to Kubernetes. You can easily debug everything with the same command, you can get everything using the same patterns and you can find the missing part.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51eba58e114e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Response to Building Large Kubernetes Clusters]]></title>
            <link>https://slynko.medium.com/response-to-building-large-kubernetes-clusters-41919b80e4bf?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/41919b80e4bf</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[scalability]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Tue, 17 Dec 2019 18:52:57 GMT</pubDate>
            <atom:updated>2019-12-17T18:52:57.431Z</atom:updated>
            <content:encoded><![CDATA[<p>Last CNCF mailing list has <a href="https://engineering.linecorp.com/en/blog/building-large-kubernetes-clusters/">an article about large clusters</a>. And there are several points that I want to comment on the article.</p><p>I spend almost two years on cluster installer — creating clusters and improving the availability of clusters, testing scalability and so on.</p><p>First — strange cluster topology.</p><p>More etcd nodes make cluster only slower. The API-server returns a successful response only when the majority of etcd nodes write the result. More nodes in the cluster — more calls API server has to make. Also, even the amount of etcd nodes is odd. It does not add availability.</p><p>The cluster also has 20 master nodes with 20 schedulers and control managers. But at any given point only single scheduler and control manager can be used. So rest 19 schedulers just participate in leader election and not doing any actual work. It would be better to have two groups — one bigger group with just API servers and one much smaller with API servers and schedulers. (The question that pops up in my head is if all the API servers were needed.)</p><p>The cluster creation is important. But creation happens only once. There are more important aspects — operability, usability, durability. They have deployed 1000 VM cluster but only a single deployment. They haven’t tried to deploy multiple services, they haven’t tried to deploy all the additional components such as FluentBit or Prometheus or Ingress. (I suppose they deploy additional components since Kubernetes is a just a part of a system.) There was no investigation around DNS, no investigation about how pods would be spread, no investigation about the number of namespaces/CRDs and time to upgrade the pod.</p><p>Then there should be day 2. What happens during deployment upgrade — how long does it take to upgrade several deployments in parallel, are there any obvious problems, what is the load on API servers, how pods are spread around nodes, is there a way to autoscale the cluster, how long does full backup take and restore.</p><p>Then there is disaster recovery. How long does it take for the cluster to find out that one of the nodes goes away? Will the node get recreated? When the pods get recreated? What happens when one of the AZs goes down? What happens when there is a networking problem in the connection between AZs in such a huge cluster?</p><p>And then my favourite — upgrade. It depends on the type of the installer. For Cloud Foundry Container Runtime, it takes about five minutes to recreate a virtual machine and some time to properly drain the node. The draining is unpredictable and depends on the number of pods on the single node and attached volumes. I saw it took 10 minutes, I saw it took more than one hour. So how long will it take for 1000 VM cluster to upgrade? How to organize the upgrade? It depends on the amount of extra computing power available. But if there is enough power for let’s say 50 VMs then the upgrade would take from 5 hours to one day. So there should be a way to partially upgrade the cluster. That is the saddest part — the operability is not investigated in this expensive and time-consuming experiment.</p><p>And this leads me to the main question. <strong>Is the one huge cluster even needed?</strong> What is the problem with multiple small clusters? It is much simpler to operate multiple smaller clusters. It is much easier to upgrade a small cluster. The small clusters are much better tested and much better documented. But the article about using multiple clusters won’t get discussed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41919b80e4bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The interview that has changed my life]]></title>
            <link>https://slynko.medium.com/the-interview-that-has-changed-my-life-8d7fe2969854?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d7fe2969854</guid>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Sat, 30 Nov 2019 15:52:23 GMT</pubDate>
            <atom:updated>2019-11-30T15:52:23.633Z</atom:updated>
            <content:encoded><![CDATA[<p>How could interview not to change a life? You get rejected and learn new things, you pass it and get a new job and new experiences. But this is more about the results of the interview or maybe the interview might change the way you prepare to the interviews, but I want to tell a story about the interview which changed the way I work in general.</p><p>I have been interviewed multiple times and interviewed many people as well. And most of the interviews feel the same.</p><p>First, you get through the initial filter. Some companies just send someone to ask you super generic questions. Other companies ask you quickly about your experience without too many details. There is also a big group that will give you a test task (this happens more often when you are a junior developer). The first step is very annoying, especially if you are doing an active search. Questions are quite repetitive, tasks are quite boring. I usually try to learn something new when doing test tasks because otherwise my time is wasted. (This doesn’t increase chances to get hired).</p><p>Usually, companies are looking for people who already know the tools and ready to work. So, in the second round, you might get asked about tools and commands. But toolset can be quite limiting and then companies are looking for smart people. You will get a tricky task to solve in such a company. There will be something that requires you to use create or remember algorithms. However, this focus helps to find people who are really interested to work in given companies and spent at least several months going through <a href="https://leetcode.com/">leetcode</a> or <a href="https://careercup.com/book">“Cracking the coding interview”</a> or something similar. So this won’t let you find smart people, people who can think rather than know lots of tricks. The requirement to prepare for a long time for the interview seems unfair to me and it filters out people who don’t have time. Interviewers tried to find a better way to find people are can come up with the solutions. For example 15 years ago brain teasers were popular. (I gave a couple of puzzles when I interviewed people as well). But brain teasers do not correlate with actual work, add more stress for the interviewee and give a feeling of superiority to the interviewer who was able to solve the teaser on their own with pressure.</p><p>All such interviews do not show if the person will suitable for work. The only way to test it is to give a person actual work. During one of my favourite interviews, I had to code review and give polite feedback to the person who wrote the code. The code was bad and had many mistakes, but as a reviewer, I had to focus only on important ones, ask questions and point to important things to learn. Additionally, some things could be easily found by static code analyzer.</p><p>I was almost ready to say yes to the position. But I had one more interview left. And I was waiting for it because <a href="https://builttoadapt.io/the-developer-hiring-process-is-broken-672bf273c183">the screening interview</a> was mind-blowing.</p><p>The interview was something I never did before. It was a single-day test period. I had to do something similar to the actual work task in a usual working routine. So you can see what people do during the working day, you can feel how is it to work in the company. The first half I was programming using the language I never used before. I learnt tricks, I learnt best practices, we discussed the way to test the task. The second part was quite strange. The internet connection was terrible, so I have to do vim commands with a terrible delay. I met people during my first day, we discussed a lot and I didn’t feel that I was interviewed. It was the first day of my new job. I‘ve learnt a lot that day.</p><p>I won’t be able to ask trick questions again, I won’t be able to demand the candidate implement complex algorithmic tasks in one hour. It is all not important.</p><p>I rejected all other proposals I had, even though the company was going through legal stuff and haven’t said yes. But the interview changed my life already and I could not think about working in other companies. I wanted to work in the company which gives me opportunities to grow even during the interview.</p><p>I believe this was the right decision. I keep learning and Pivotal is the best company I ever worked for.</p><p>I have 4th anniversary today and I am happy to be Pivot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d7fe2969854" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rotate certificates for Kubernetes]]></title>
            <link>https://slynko.medium.com/rotate-certificates-for-kubernetes-40dbf4ccaf6b?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/40dbf4ccaf6b</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[bosh]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Mon, 07 Oct 2019 12:16:27 GMT</pubDate>
            <atom:updated>2020-04-24T17:35:42.188Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes uses mTLS for service components to communicate.</p><p>Certificates are <a href="https://medium.com/@slynko/master-certificate-in-kubernetes-45fdf64c8676">difficult</a> and automatically generating them is one of the key features of Cloud Foundry Container Runtime(CFCR).</p><p>There is one thing though. The default certificate duration in CFCR is one year, so if you have deployed the cluster last year, it is time to rotate the CA certificates.</p><p>Now, here is the typical way, the CA certificates are rotated. First, you generate a new certificate, then you add it to the chain of trust. Then you generate new certificates and start using them. After this, you can remove the old certificate from the trusted chain.</p><h4>So, how to do this in CFCR?</h4><p>First, you need to know how CA certificates values are set.</p><p>The obvious answer is the property with the name. For example, <a href="https://github.com/cloudfoundry-incubator/kubo-release/blob/master/jobs/kubelet/templates/config/apiserver-ca.pem.erb">the kubelet job</a> uses the property to set the API certificate. In the manifest, it can be passed <a href="https://github.com/cloudfoundry-incubator/kubo-deployment/blob/master/manifests/cfcr.yml#L413">as a single high-level property</a> or split into <a href="https://github.com/cloudfoundry-incubator/kubo-deployment/blob/b6e9f6b187d48ea9ec8b04ce6f2bd5d325f869c3/manifests/cfcr.yml#L407-L410">three properties</a>. In the release, usually, only the high-level property is referenced.</p><p>Another way to pass properties is via links. The kube-apiserver is the main component that all other components communicate. Almost two years ago we decided to share it as a link so that other components can consume all the required data automatically. Etcd release uses links the same way.</p><p>Now, when you know all the ways the certificates are passed, we can proceed to the minimum downtime upgrade.</p><p>How to do this for CFCR</p><ol><li>Modify manifest to add new CA certificates. For example, you can duplicate <a href="https://github.com/cloudfoundry-incubator/kubo-deployment/blob/b6e9f6b187d48ea9ec8b04ce6f2bd5d325f869c3/manifests/cfcr.yml#L483-L487">these rows</a> and add the certificate with name kubo_ca_2019</li><li>Find all the certificates that use given ca. Then find all the reference in the manifest and add the second ca into the manifest.<br>For example, <a href="https://github.com/cloudfoundry-incubator/kubo-deployment/blob/master/manifests/cfcr.yml#L257">this line</a> should look like ca: ((tls-kubernetes.ca))((kubo_ca_2019.certificate)) <br>Also, since the certificate in the manifest is just an object with three properties, some places hide these properties and reference directly to the variable. You will have to expand those variables and add individual properties for each key.</li><li>Find all the links and <a href="https://bosh.io/docs/links-manual/">reconfigure them manually</a> with adding additional CA certificate where it is required.</li><li>Deploy CFCR with the new manifest. This will restart all the VMs and might cause workload downtime.</li><li>Now, you should change CA for all the certificates in the manifest. To do this, change the CA value for each of the certificate to the new one and <a href="https://bosh.io/docs/manifest-v2/#features">enable converging variables</a> in the manifest.</li><li>Deploy CFCR with the new manifest. This will restart all the jobs and might lead to workload downtime.</li><li>Now, you can delete old CA from the manifest. You can also optionally, rename certificate in CredHub to the original value (kubo_ca_2019 to kubo_ca) and revert manifest to the original way.</li><li>Last redeploy will delete old trusted certificates and will restart all jobs as well.</li></ol><p>Ideally, this process should be automated and happen every month. Or alternatively, you can upgrade certificates step by step with each stemcell upgrade. This way you will not have additional downtime.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40dbf4ccaf6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes and Diego 5: into the Eiriniverse]]></title>
            <link>https://slynko.medium.com/kubernetes-and-diego-5-into-the-eiriniverse-b249f6353993?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b249f6353993</guid>
            <category><![CDATA[cloud-foundry]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 21:39:11 GMT</pubDate>
            <atom:updated>2019-09-23T21:39:11.913Z</atom:updated>
            <content:encoded><![CDATA[<h4>Progress on Kubernetes replacing Diego</h4><p>NB: The opinions expressed in this post are my own and not necessarily those of my employer (or my PM).</p><p>Two years ago on Cloud Foundry summit, the question has been asked: “Will Kubernetes replace Diego?” At that time I answered no and <a href="https://medium.com/@slynko/cloud-foundry-and-kubernetes-47f3c16e3da3">wrote</a> <a href="https://medium.com/@slynko/will-kubernetes-replace-diego-82d1ccdb2a02">several</a> <a href="https://medium.com/@slynko/kubernetes-and-diego-here-we-are-again-2f460e57a503">articles</a> with the explanation. Now after two years I work full time in the team that actually replaces Diego with Kubernetes. This is no longer a question. This year during Cloud Foundry summit in the Hague people were asking when Cloud Foundry will become Kubernetes-native.</p><p>The biggest selling point of Kubernetes — APIs. One can easily extend Kubernetes by adding more APIs. Using API is complex, annoying and unified. There are many integration points left for developers. People can easily replace networking, customise scheduling or modify requests on the fly. And since all these APIs operate on the same level, they should work with each other. Unfortunately, there is a downside — all is configured via APIs and you can never be sure that two things will work the same on two different clusters that located in different clouds. Multiple vendors bring another problem — it is impossible to configure clusters to work the same, there are multiple settings that it of users control. There is no such thing as a typical Kubernetes cluster. There is a conformance certification, but it covers only tiny part of Kubernetes features. It satisfies deploying of simple applications but does not help vendors.</p><p>This is where Diego and Cloud Foundry are better and simpler. No one needs to know all the details to deploy to the cluster. And by default, everything just works and works the same way everywhere.</p><p>Project Eirini simplifies application deployment. And it is feature complete. Ok, almost feature-complete — one can deploy an application, scale and delete it. What else do you need?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9Gvj8xkfotFblUssgnCLQ.png" /><figcaption>Wait, what?</figcaption></figure><p>So Eirini is almost feature complete. Does it mean Cloud Foundry with Eirini supports all the little things that Cloud Foundry with Diego does? No. And it never will. Remember, I said there is no such thing as a typical cluster. That means there is no guarantee that all the features that we test will work in different clusters. But even if we could focus on a single type (for example IKS), we don’t support everything. There are things that are missing in core Kubernetes. But if we focus on features that Eirini team should deliver, there is not that much left.</p><p>So is it time to scale down Eirini team? I specifically focused on features, but there are many non-functional requirements that Eirini does not currently have. We have barely touched upgrades and performance. We haven’t worked on scalability. This should be the focus of the team.</p><p>I have never seen lift-and-shift to work for a long time. I don’t think it will work for Cloud Foundry as well. Eirini is just the first step. But it opens the door for future work. It starts Eiriniverse (non official internal name). It allows other teams start implementing features that will work the best way in Kubernetes and improve Eirini flow. There are many moving parts in Cloud Foundry and they provide great experience together, but right now they can’t be extracted and deployed separately or replaced easily. This contradicts with Kubernetes world and this is where I suppose Cloud Foundry will evolve — to a set of APIs that provide great experience to developers.</p><p>A few steps were already made in Eiriniverse — Suse is working on <a href="https://www.cloudfoundry.org/blog/introducing-eirinix-how-to-build-eirini-extensions/">EiriniX</a> and Pivotal is working on integrating <a href="https://github.com/pivotal/kpack">kpack</a> into Cloud Foundry. We will see how it looks in 6 months.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b249f6353993" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy latest Kubernetes]]></title>
            <link>https://slynko.medium.com/deploy-latest-kubernetes-b8af49041b32?source=rss-5d9e64b3a5a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8af49041b32</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[bosh]]></category>
            <dc:creator><![CDATA[Oleksandr Slynko]]></dc:creator>
            <pubDate>Tue, 06 Aug 2019 16:35:28 GMT</pubDate>
            <atom:updated>2019-08-06T16:36:39.447Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploy latest Kubernetes using CFCR</h3><p>Every three months a new Kubernetes major version is released. It is hard to keep up with the latest all the time. It is very hard to keep up, you need to deploy the newest version in advance to see if it breaks something.</p><p>There is an easy way to deploy the latest version if you use Cloud Foundry Container Runtime (CFCR). Officially, CFCR usually is two months behind the latest major version, but it is very easy to try the next version on your test environment.</p><ol><li>Clone <a href="https://github.com/cloudfoundry-incubator/kubo-release">kubo-release</a> repository</li><li>Run <a href="https://github.com/cloudfoundry-incubator/kubo-release/blob/master/scripts/download_k8s_binaries">update_binaries</a> command with desired Kubernetes version. Ie. ./scripts/download_k8s_binaries 1.16.0-alpha.2</li><li>Create a new release bosh create-release --force . You need to specify force flag since you change the blobs</li><li>Upload the release to your Bosh director. You can create the Bosh director using<a href="https://github.com/cloudfoundry/bosh-bootloader"> bosh-bootloader</a>. There are <a href="https://github.com/cloudfoundry/bosh-bootloader/tree/master/plan-patches/cfcr-gcp">guides</a> about deploying CFCR.</li><li>Deploy CFCR with the <a href="https://github.com/cloudfoundry-incubator/kubo-deployment/blob/master/manifests/ops-files/misc/dev.yml">dev</a> operation file.</li><li>(Optionally) run apply-addons errand to deploy metrics, DNS and dashboard.</li><li>(Optionally) run smoke-tests to check if the cluster is operational.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8af49041b32" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>