<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="https://koderama.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://koderama.com/" rel="alternate" type="text/html" /><updated>2023-07-03T08:14:23+00:00</updated><id>https://koderama.com/feed.xml</id><title type="html">Koderama</title><subtitle>Reliability, scalability, and all the code in between</subtitle><entry><title type="html">6 things to know before autoscaling your Kubernetes cluster</title><link href="https://koderama.com/challenges-k8s-autoscaling/" rel="alternate" type="text/html" title="6 things to know before autoscaling your Kubernetes cluster" /><published>2023-07-02T00:00:00+00:00</published><updated>2023-07-02T00:00:00+00:00</updated><id>https://koderama.com/challenges-k8s-autoscaling</id><content type="html" xml:base="https://koderama.com/challenges-k8s-autoscaling/">&lt;p&gt;Have you decided to stop wasting money on nodes you don’t use? Do you want a flexible infrastructure to respond to real-time demand without manually setting your nodes? That is where Kubernetes autoscaler comes into the scene.&lt;/p&gt;

&lt;h3 id=&quot;what-is-cluster-autoscaler&quot;&gt;What is cluster autoscaler&lt;/h3&gt;
&lt;p&gt;When a pod &lt;del&gt;begs&lt;/del&gt; requests Kubernetes to be scheduled, Kubernetes checks whether it has nodes with enough resources to accommodate the pod (based on the resources requested by the sum of all its current pods); in case it doesn’t, lower priority pods can be evicted, to accommodate the new pods.&lt;/p&gt;

&lt;p&gt;If it can’t find a place for the new pod, it marks the pod in a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pending&lt;/code&gt; state and start the process to spin up a new node; the new node is provisioned and then can receive the new pods.&lt;/p&gt;

&lt;p&gt;Here, I’ll describe six essential things to remember when preparing your cluster to scale smoothly, so you can go to bed without worrying about being paged at 3 am.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/k8s-autoscaler.png&quot; alt=&quot;_config.yml&quot; /&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Resources definition
Kubernetes likes to know about their workload beforehand; pods with neither requests nor limits defined run in the QoS(Quality of Service) class &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BestEffort,&lt;/code&gt; which puts them on the top of the eviction list.
Make sure you have your pods with adequate &lt;a href=&quot;https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/&quot;&gt;quality of service&lt;/a&gt;, and please, don’t let your pods without their resources defined; autoscaler won’t get along with them well.
You can use a policy engine like &lt;a href=&quot;https://kyverno.io/&quot;&gt;Kyverno&lt;/a&gt; or &lt;a href=&quot;https://www.openpolicyagent.org/&quot;&gt;OPA&lt;/a&gt; to enforce it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/images/qos.jpeg&quot; alt=&quot;_config.yml&quot; /&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Watch out for Pods that Need Longer Periods for Graceful Shutdown:
When dealing with these slow dudes, you have to make sure your autoscaler is patient and gives these pods the time they need to shut down gracefully; this can lead to slower scaling and will make you reconsider or rearchitect how those pods work.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Monitor properly
Keep an eye on the speed at which your nodes are spinning up, how long your pods are scheduled end-to-end, the number of failed schedulings, and failures to spin up nodes. You don’t want those things to go unnoticed.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Balance of Nodes in Different AZs
Don’t let your nodes spin on a single AZ; make sure to have some auto-balancing in place, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;clusterautoscaler&lt;/code&gt; has a &lt;a href=&quot;https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#im-running-cluster-with-nodes-in-multiple-zones-for-ha-purposes-is-that-supported-by-cluster-autoscaler&quot;&gt;flag&lt;/a&gt; exactly for this purpose.
Make sure you don’t have any conflicts operations; for example, AWS has its own AZ Rebalancer and when operating along with Kubernetes autoscaler &lt;a href=&quot;https://github.com/giantswarm/roadmap/issues/150&quot;&gt;it can have undesired effects&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Select the best expansion strategy
With the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--expander&lt;/code&gt; flag, you can select among a &lt;a href=&quot;https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders&quot;&gt;few different strategies&lt;/a&gt; to select the node group to expand when needing to scale, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;least-waste&lt;/code&gt; is a good starting point, but you can also select based on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;price&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;priority&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Do you need a faster scale-up?
Sometimes the time to spin up a new node can take a few minutes, which might not be optimal for some scenarios; you can achieve that by &lt;a href=&quot;https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-configure-overprovisioning-with-cluster-autoscaler&quot;&gt;overprovisioning&lt;/a&gt;, basically running dummy pods with low priority, they will be evicted in case new pods with higher priority need to be scheduled, and the new pause containers will force the cluster to scale up!&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, you can grab a coffee, open your cluster dashboard and look at all the magic of scheduling and scaling.&lt;/p&gt;</content><author><name></name></author><summary type="html">Have you decided to stop wasting money on nodes you don’t use? Do you want a flexible infrastructure to respond to real-time demand without manually setting your nodes? That is where Kubernetes autoscaler comes into the scene.</summary></entry><entry><title type="html">The confusion about Kubernetes requests</title><link href="https://koderama.com/k8s-requests/" rel="alternate" type="text/html" title="The confusion about Kubernetes requests" /><published>2022-10-19T00:00:00+00:00</published><updated>2022-10-19T00:00:00+00:00</updated><id>https://koderama.com/k8s-requests</id><content type="html" xml:base="https://koderama.com/k8s-requests/">&lt;p&gt;There is a famous quote in computer science:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“There are only two hard things in Computer Science: cache invalidation and naming things.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Name things is hard because you need to consider the function of the thing you are naming, not only in the present but also in the future, and yet to predict all possible confusions that might arise in people’s minds.&lt;/p&gt;

&lt;p&gt;Recently, working on a project that required bringing awareness about resource utilization on a Kubernetes cluster, I noticed a common theme for confusion: Kubernetes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;resources requests&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;resources limits&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After analyzing &lt;del&gt;hundreds&lt;/del&gt; &lt;strong&gt;three&lt;/strong&gt; messages, I came to the conclusion that the confusion has a clear culprit: the bad naming for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;requests&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;limits&lt;/code&gt; is not that bad, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;requests&lt;/code&gt; on the other hand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requests&lt;/strong&gt; is an extremely generic term, and everyone knows that the rule #1 of naming is: &lt;strong&gt;DO NOT&lt;/strong&gt; use a generic name.
&lt;strong&gt;Requests&lt;/strong&gt; can mean anything, and the context of resources adds absolutely &lt;em&gt;zero&lt;/em&gt; to the clarification.&lt;/p&gt;

&lt;p&gt;I’m sure all the confusion would have gone away if, instead of requests, the Kubernetes team had picked a name that fits the function better, like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;guaranteed&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reserved&lt;/code&gt;, because that is what it does, reserve or guarantees the resources specified there.&lt;/p&gt;

&lt;p&gt;Then instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;resources requests&lt;/code&gt;, it would be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;resources reserved&lt;/code&gt;, it looks much clearer now, isn’t it? People would see and immediately understand that this is the amount reserved for their pod, and there is no more need to decode what the hell &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;requests&lt;/code&gt; mean in this context.&lt;/p&gt;

&lt;p&gt;But now it is too late; there’s no going back. We will need to live with it until the end of the days, or until some &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Kubernetes&lt;/code&gt; breaking change; who knows?&lt;/p&gt;

&lt;p&gt;So next time you need to understand it, just replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;requests&lt;/code&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reserved&lt;/code&gt;; that is the amount of resources &lt;em&gt;(CPU/Memory)&lt;/em&gt; your pod will have &lt;strong&gt;reserved&lt;/strong&gt;, &lt;strong&gt;guaranteed&lt;/strong&gt;, and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;limit&lt;/code&gt; is the amount it can’t exceed.&lt;/p&gt;

&lt;p&gt;Doesn’t it make it easier?&lt;/p&gt;</content><author><name></name></author><summary type="html">There is a famous quote in computer science:</summary></entry><entry><title type="html">How Scrum has killed Agile</title><link href="https://koderama.com/scrum-killed-agile/" rel="alternate" type="text/html" title="How Scrum has killed Agile" /><published>2022-10-06T00:00:00+00:00</published><updated>2022-10-06T00:00:00+00:00</updated><id>https://koderama.com/scrum-killed-agile</id><content type="html" xml:base="https://koderama.com/scrum-killed-agile/">&lt;p&gt;In the beginning, there was &lt;del&gt;darkness&lt;/del&gt; the &lt;strong&gt;waterfall&lt;/strong&gt;, and it was bad, terribly bad.
For some reason, we thought building software was the same as building an actual building, so we ended up with a pile of papers, endless meetings, stiff processes, and no software delivered.&lt;/p&gt;

&lt;p&gt;In that dark times, the fear of change was constant; whenever a change was introduced in the software development cycle, it meant going back to square one, restarting long meetings, rewriting documentation, and getting approvals.&lt;/p&gt;

&lt;p&gt;Later, IBM started pushing &lt;a href=&quot;https://en.wikipedia.org/wiki/Rational_Unified_Process&quot;&gt;RUP (Rational Unified Process)&lt;/a&gt;, a sort of iterative waterfall, which replaces the long cycles of the waterfall with shorter ones, a step in the right direction some would say, even though many companies just ignored the iterative part.&lt;/p&gt;

&lt;p&gt;But corporate had metrics and a false sense of control, so they were happy, or they thought so.
In the first years of the ’00s, a new hope joined the game; the &lt;a href=&quot;https://agilemanifesto.org/&quot;&gt;Agile Manifesto&lt;/a&gt; was published, a simple, concise manifesto with clear sentences showing what software development should focus on:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Individuals and interactions over processes and tools&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Working software over comprehensive documentation&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Customer collaboration over contract negotiation&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Responding to change over following a plan&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It embraced the nature of software development as a process in constant evolution instead of requiring a rigid plan.&lt;/p&gt;

&lt;p&gt;It was music to our ears, and I couldn’t wait to put into practice what they proposed, along with some techniques from Extreme Programming (TDD, pair programming).
So, I decided to pitch it to the management of my company at that time, and their response was something along the lines of “We have built software for fifteen years; we know how to do it, and this Agile thing is only for small companies.”&lt;/p&gt;

&lt;p&gt;A bummer, but only for a short time; Agile soon started to proliferate like fire, but something was off; it came in the form of Scrum.
Now, 20 years later, Scrum is almost synonymous with Agile, but not that Agile from the Manifest, a new form of Agile hijacked by corporate that barely has any semblance with the old one.&lt;/p&gt;

&lt;p&gt;To be able to sell the Agile idea to businessmen, they had to adapt it until the point it was not what it was proposed anymore. In order to keep managers happy, metrics and processes were introduced so they could regain their false sense of control.
Processes and tools slowly replaced individuals and interactions. More and more, Scrum was becoming a monster of meetings and documents.&lt;/p&gt;

&lt;p&gt;So instead of cultivating a team where everyone feels free to speak at any time about anything, valueing individuals. We now have &lt;strong&gt;Sprint Retrospective&lt;/strong&gt;, &lt;strong&gt;Team Health Check&lt;/strong&gt;, and many other useless meetings with predefined processes, going exactly against the Agile Manifesto.&lt;/p&gt;

&lt;p&gt;I won’t even talk about the abomination of &lt;strong&gt;Scrum Poker&lt;/strong&gt;; I’m sure some heartless sadist created it.
But wait, with all these, the managers can print nice graphs of velocity or some other useless graph that give them this false feeling of control, which again goes against the Agile Manifesto, but who cares about it at this point, right?&lt;/p&gt;

&lt;p&gt;To be honest, I met so many “Scrum Masters” who didn’t even know the existence of the Agile Manifesto, as if it is erased from software development history.&lt;/p&gt;

&lt;p&gt;But don’t take my word for it; listen to what people like &lt;a href=&quot;https://twitter.com/allenholub/status/1514806761873575936&quot;&gt;Allen Holub&lt;/a&gt; and &lt;a href=&quot;https://www.youtube.com/watch?v=hG4LH6P8Syk&quot;&gt;Uncle Bob&lt;/a&gt; have to say.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/allenholub-tweet.png&quot; alt=&quot;_config.yml&quot; /&gt;&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/hG4LH6P8Syk&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;All in all, we are moving in the wrong direction, we let business people decide how software engineering should work for so long that now what we call Agile is not much different than the RUP, and we are all witnesses of the slow death of Agile, killed by Scrum.&lt;/p&gt;</content><author><name></name></author><summary type="html">In the beginning, there was darkness the waterfall, and it was bad, terribly bad. For some reason, we thought building software was the same as building an actual building, so we ended up with a pile of papers, endless meetings, stiff processes, and no software delivered.</summary></entry><entry><title type="html">Google FLoC {Insert some F*K pun here}</title><link href="https://koderama.com/google-floc/" rel="alternate" type="text/html" title="Google FLoC {Insert some F*K pun here}" /><published>2021-05-04T00:00:00+00:00</published><updated>2021-05-04T00:00:00+00:00</updated><id>https://koderama.com/google-floc</id><content type="html" xml:base="https://koderama.com/google-floc/">&lt;p&gt;I’ll have to put a disclaimer on the beginning of this post: I don’t like Google, its practices, its mindset, their business model and everything in between. I have &lt;em&gt;degoogled&lt;/em&gt; myself as much I could, and I keep looking for better alternatives in the sense of usability, privacy and security.
However, on this post I’d like to go beyond the buzz created by their &lt;em&gt;FLOC ID&lt;/em&gt; recently announced and already under attack for all the sides, based on its reception (Brave/Vivaldi/Firefox, all already said they won’t implement it) it looks like it is an &lt;em&gt;dead-on-arrival technology&lt;/em&gt;. Does it really deserve all the hate?&lt;/p&gt;

&lt;p&gt;FLoC(Federated Learning of Cohorts) is part of the &lt;a href=&quot;https://www.privacysandbox.com/#:~:text=One%20proposal%20in%20the%20Privacy%20Sandbox%20is%20to,method%20is%20called%20Federated%20Learning%20of%20Cohorts%20%28FLoC%29.&quot;&gt;Privacy Sandbox Proposals&lt;/a&gt; aiming to satisfy advertisers needs without third-party cookies and other tracking mechanisms.
The idea behind FLoC is to cluster large groups of people to make them unidentifiable as individuals, but still relevant to ads in the form of a generic profile that they call FLoC cohort. In this sense, FLoC is more of a profiling tool than a tracking one.&lt;/p&gt;

&lt;p&gt;Is it even possible? After the announcement a lot of criticism has been thrown on the proposal, some of them are valid points, some of them seem to not understand how it works.&lt;/p&gt;

&lt;p&gt;EFF was one of the first ones to &lt;a href=&quot;https://www.eff.org/deeplinks/2021/03/googles-floc-terrible-idea&quot;&gt;attack the proposal&lt;/a&gt;, they raise a valid point; Google is saying that a cohort ID can’t fingerprint a user due to how generic it is (on its first implementation it uses a 8-bit identification, which makes it only 256 possible cohorts), however, in combination with other fingerprinting techniques it can helps to identify a user even easier than now.
Google, on the broader Privacy Sandbox, has other proposals to mitigate fingerprinting:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Creating &lt;em&gt;Privacy Budget&lt;/em&gt; limits, where the website has a limited access to information that could be used for fingerprinting.&lt;/li&gt;
  &lt;li&gt;The User-Agent won’t give the full information that is shared Today, instead they will expose an API, which will be limited by the &lt;em&gt;Privacy Budget&lt;/em&gt; above.&lt;/li&gt;
  &lt;li&gt;IP Security will make the IP available on request and part of the &lt;em&gt;Privacy Budget&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, as pointed by EFF, none of these are currently implemented, and FLoC is already on Original trial, so for now we don’t have the other benefits, only the cons of the FLoC being used in conjunction with other techniques for fingerprinting.&lt;/p&gt;

&lt;p&gt;The cohort is based on your web history, renewed weekly, and supposed hiding sensitive information to avoid homogeneity attacks, websites categorized as “sensitive data”, like medical or adult content won’t be showed there(the sensitive categories are the same already defined by Google for advertisement), this is achieved by ensuring that no cohort has more users who has visited sensitive websites more often than the general population, this approach is explained in more details in &lt;a href=&quot;https://docs.google.com/a/google.com/viewer?a=v&amp;amp;pid=sites&amp;amp;srcid=Y2hyb21pdW0ub3JnfGRldnxneDo1Mzg4MjYzOWI2MzU2NDgw#:~:text=In%20the%20context%20of%20the%20FLoC%20API%2C%20a,visited%20a%20website%20about%20a%20rare%20medical%20condition.&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;They also will be auditing running frequently to identify cohorts that could make correlations leading to discrimination, again, not clear how efficient this can happen.
FLoC delegates most of computing to the browser, keeping it locally, which will be responsible to calculate your cohort applying a SIMHash algorithm and expose it to the website via a browser API as below:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;cohort&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;interestCohort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://ads.example/getCreative&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;searchParams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;cohort&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cohort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;creative&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Another criticism is that as the cohort changes overtime, a website could use to collect more and more information of the user, creating a much broader profile. Google has a proposal for tackling this on their &lt;a href=&quot;https://github.com/WICG/floc#longitudinal-privacy&quot;&gt;Longitudinal Privacy&lt;/a&gt; section: Sticky the same exposed cohort for each website you visit. Therefore, the first time you visit a website it will gain access to your cohort, which will remain the same on next visits, even if your local one has changed. However, this is just a proposal and raises other concerns per se.&lt;/p&gt;

&lt;p&gt;Also, using a &lt;a href=&quot;https://github.com/WICG/floc#opting-out-of-computation&quot;&gt;&lt;strong&gt;Default Allow&lt;/strong&gt;&lt;/a&gt; is enough to raise some eyebrows.
There is also some concerns about Google enrolling users on the trial without consent, both from user’s and from the websites.&lt;/p&gt;

&lt;p&gt;In summary, I think there are some good ideas, ideas that may work better in terms of privacy than the current third-parties cookies approach (not a high bar, I know). However, for it to make sense, not only the FLoC from the &lt;em&gt;Privacy Sandbox&lt;/em&gt; needs to be implemented, but most, if not all, of its proposals.
Adding only FLoC to the mix is not replacing third-party cookies or fingerprinting, it is just adding another layer of data collection while preserving the &lt;em&gt;web status quo&lt;/em&gt;, not the user’s privacy.
I don’t think FLoC is where we should start this. Maybe starting from the &lt;a href=&quot;https://github.com/bslassey/privacy-budget&quot;&gt;&lt;em&gt;Privacy Budgets Limits&lt;/em&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/WICG/trust-token-api&quot;&gt;&lt;em&gt;Trust Token API&lt;/em&gt;&lt;/a&gt; will have a better reception?&lt;/p&gt;</content><author><name></name></author><summary type="html">I’ll have to put a disclaimer on the beginning of this post: I don’t like Google, its practices, its mindset, their business model and everything in between. I have degoogled myself as much I could, and I keep looking for better alternatives in the sense of usability, privacy and security. However, on this post I’d like to go beyond the buzz created by their FLOC ID recently announced and already under attack for all the sides, based on its reception (Brave/Vivaldi/Firefox, all already said they won’t implement it) it looks like it is an dead-on-arrival technology. Does it really deserve all the hate?</summary></entry><entry><title type="html">When Horizontal Auto Scaler is not fast enough</title><link href="https://koderama.com/hpa-limitations/" rel="alternate" type="text/html" title="When Horizontal Auto Scaler is not fast enough" /><published>2021-04-13T00:00:00+00:00</published><updated>2021-04-13T00:00:00+00:00</updated><id>https://koderama.com/hpa-limitations</id><content type="html" xml:base="https://koderama.com/hpa-limitations/">&lt;p&gt;Recently I was listening to a podcast with the brazilian team responsible for probably the most popular fantasy game in Brazil: &lt;a href=&quot;https://globoesporte.globo.com/cartola-fc/&quot;&gt;Cartola FC&lt;/a&gt;.
Cartola FC is a fantasy game based on real football matches, and in a country that loves football as much as Brazil you can imagine the load they receive when a match is ongoing.
The number of requests on their application has a very high variability, depending on whether there is a football match happening or not and whether some popular players have scored.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/neymar.jpg&quot; alt=&quot;_config.yml&quot; /&gt;&lt;/p&gt;

&lt;p&gt;During these moments when a popular player has scored, the users wanna quickly check their status on the game, and then their API access can go, in a couple seconds, from ~30k requests por second to ~230k.
Of course, when it happens they want to be able to have enough resources to not frustrate the user (he will be frustrated enough watching his selected players missing the goal).&lt;/p&gt;

&lt;p&gt;There are already one big factor that makes this team “unique”, their infrastructure is on-premises. In a world where most of the computing power is centred on Amazon, Google and Microsoft it is sure a risk decision per se.
They are asked about how they scale their pods when those spikes happen, and they comment that they don’t use things like &lt;a href=&quot;https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/&quot;&gt;Kubernetes Horizontal Auto Scaler&lt;/a&gt;, and the reason is quite simple, with the spike happening in a couple seconds the auto scaler is not fast enough to provision the extra pods.&lt;/p&gt;

&lt;p&gt;Reading online about the &lt;em&gt;Kubernetes&lt;/em&gt; HPA most of time its limitations are not mentioned and it sounds more like magic than actual technology.&lt;/p&gt;

&lt;p&gt;At my current company we have a similar issue, as a tv provider, when a new football championship or Formule 1 season is about to start our APIs experience a ten fold increase in traffic, and even with HPA in place, sometimes they are just not fast enough.&lt;/p&gt;

&lt;p&gt;While a pod is being prepared to become ready for new requests, all the load is put on the back of the current pods, eventually they can’t handle the requests anyre and then they become unhealthy, so &lt;em&gt;Kubernetes&lt;/em&gt; takes them out of the pool and the problem only gets worse.&lt;/p&gt;

&lt;p&gt;There is also other limitations like costs, nodes available and database connections, one failure can propagate the error down the hill becoming harder to recovery.&lt;/p&gt;

&lt;p&gt;It is an ongoing and learning process, and we are playing with different scenarios and solutions in order to optimize the resources usage.&lt;/p&gt;

&lt;p&gt;A few things that can help to mitigate the issue:&lt;/p&gt;

&lt;h2 id=&quot;scheduled-provisioning&quot;&gt;Scheduled provisioning&lt;/h2&gt;
&lt;p&gt;When an known event that increases traffic is about to happen you can provision before hand the necessary pods, increase the number of minimum pods, this is something that gets better as more data of past events you have.
You also can use tools for load testing, i.e: &lt;a href=&quot;https://locust.io/&quot;&gt;Locust&lt;/a&gt; to simulate the number of requests you expect.
Unfortunately, not always it is possible to predict when it will happen.&lt;/p&gt;

&lt;h2 id=&quot;higher-liveness-probe&quot;&gt;Higher liveness probe&lt;/h2&gt;
&lt;p&gt;This way your pod is not killed while it waits for the new pods to enter the pool, but make sure that you don’t let it too long to have stalled pods.&lt;/p&gt;

&lt;h2 id=&quot;increase-sensibility-of-the-hpa-trigger-metrics&quot;&gt;Increase sensibility of the HPA trigger metrics&lt;/h2&gt;
&lt;p&gt;Another approach you can try is to make the pods more sensible to trigger the scale more often and give more time for the current pods to handle the requests.&lt;/p&gt;

&lt;p&gt;In summary, sometimes, scaling your application in a proper way is more of an art than a science, and you have to weight all the trade-offs in each possible solution, mix them, test and analyze to find the optimum way according to your situation, and then keep re-evaluating it and improving it, as new solutions and tools never stop coming.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Kubernetes HPA&lt;/em&gt; is an extraordinary tool, but it needs to be separated from the hype, like mostly things in this industry, but this a topic for another post.&lt;/p&gt;</content><author><name></name></author><summary type="html">Recently I was listening to a podcast with the brazilian team responsible for probably the most popular fantasy game in Brazil: Cartola FC. Cartola FC is a fantasy game based on real football matches, and in a country that loves football as much as Brazil you can imagine the load they receive when a match is ongoing. The number of requests on their application has a very high variability, depending on whether there is a football match happening or not and whether some popular players have scored.</summary></entry><entry><title type="html">Browser Isolation</title><link href="https://koderama.com/browser-isolation/" rel="alternate" type="text/html" title="Browser Isolation" /><published>2021-04-08T00:00:00+00:00</published><updated>2021-04-08T00:00:00+00:00</updated><id>https://koderama.com/browser-isolation</id><content type="html" xml:base="https://koderama.com/browser-isolation/">&lt;p&gt;CloudFlare has just announced what they call zero-trusted browsing.&lt;/p&gt;

&lt;p&gt;The services, aiming on business, has the goal of making the employee experience feel less restrictive in comparison to regular organization policies, while keep the browsing safe.
The way it works is different than regular remote browsing, and they claim it is what it makes it faster and a frictionless experience.&lt;/p&gt;

&lt;p&gt;If they delivery what they are promising it might set another level on business security without compromising the employee experience, as browsers has become the main attack vectors, but it all comes with a cost, security is not free after all.&lt;/p&gt;

&lt;p&gt;This technology came from their acquisition of a company called S2 Systems, it’s a proprietary patent that attempts to tackle the main issues of the current remote browser isolation technologies.&lt;/p&gt;

&lt;p&gt;The current technologies are “Pixel Pushing” and “DOM Reconstruction”.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Pixel Pushing: The rendered page is transmitted pixel by pixel, similar to remote desktops, this approach tend to be very slow and produces a terrible user experience.&lt;/li&gt;
  &lt;li&gt;DOM Reconstruction: The server “cleans” the DOM and send it back to the client, this approach is not as slow as the first one, but can break pages or even let malicious code pass undetected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;S2 System introduced what they call “Network Vector Rendering” or NVR, this technology utilizes Chromium &lt;a href=&quot;https://skia.org/&quot;&gt;Skia 2D library&lt;/a&gt; to send compressed Skia draw commands to any HTML5 compliant browser.
In order to run it the local browser will have a NVR Web Assembly library responsible for draw the commands on the local window, and on the cloud it runs a headless Chromium-based browser.&lt;/p&gt;

&lt;p&gt;I’m curious to try this approach, My only experience with browser isolation was running Citrix and its awful usability.
Hopefully, CloudFlare will set the bar higher for this one, and make organizations a bit more… secure.&lt;/p&gt;

&lt;p&gt;If you want to read more about CloudFlare browser isolation, check their &lt;a href=&quot;https://www.cloudflare.com/teams/browser-isolation/&quot;&gt;official page&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><summary type="html">CloudFlare has just announced what they call zero-trusted browsing.</summary></entry><entry><title type="html">Hello, World</title><link href="https://koderama.com/Hello-World/" rel="alternate" type="text/html" title="Hello, World" /><published>2021-04-07T00:00:00+00:00</published><updated>2021-04-07T00:00:00+00:00</updated><id>https://koderama.com/Hello-World</id><content type="html" xml:base="https://koderama.com/Hello-World/">&lt;p&gt;Opening the season for posts with our traditional hello world!&lt;/p&gt;

&lt;p&gt;You can expect posts about cybersecurity, privacy related news, scalability and all around programming.&lt;/p&gt;

&lt;p&gt;So, let it begin!&lt;/p&gt;</content><author><name></name></author><summary type="html">Opening the season for posts with our traditional hello world!</summary></entry></feed>