<?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 Sachin Agarwal on Medium]]></title>
        <description><![CDATA[Stories by Sachin Agarwal on Medium]]></description>
        <link>https://medium.com/@sachin_49501?source=rss-9772b2749937------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YCBMsYzQBlRAVBiV</url>
            <title>Stories by Sachin Agarwal on Medium</title>
            <link>https://medium.com/@sachin_49501?source=rss-9772b2749937------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:27:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sachin_49501/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[The Case For Better Self-hosting Supabase Support]]></title>
            <link>https://medium.com/@sachin_49501/the-case-for-better-self-hosting-supabase-support-dbdab63df3fa?source=rss-9772b2749937------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbdab63df3fa</guid>
            <category><![CDATA[self-hosted]]></category>
            <category><![CDATA[supabase]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Sachin Agarwal]]></dc:creator>
            <pubDate>Mon, 06 Feb 2023 05:07:08 GMT</pubDate>
            <atom:updated>2023-02-06T13:14:37.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8UQmiE7kZcu2hwXPWO3OPw.png" /><figcaption>Supabase, the open-source Firestore/Firebase Alternative</figcaption></figure><p><em>Supabase is an open-source Firestore/Firebase alternative. It is currently offered as a SaaS service, but there are some good reasons to consider self-hosting it.</em></p><p><a href="https://supabase.com/">Supabase</a> is a Firebase alternative. It builds upon Postgres by adding a REST api (<a href="https://postgrest.org/en/stable/">Pgrest</a>), a real-time addon (<a href="https://github.com/supabase/realtime">Supabase realtime</a>), and an auth/user management system. One of Supabase’s key attractions is that the code is open-sourced under liberal licenses (Apache2). So, users know what is under the hood. In fact Supabase also provides a <a href="https://github.com/supabase/supabase/tree/master/docker">docker-compose file</a> to run Supabase locally. I love the fact that Supabase (the company) uses open-source technology but doesn’t hoard its own additions behind restrictive licenses (unlike say, <a href="https://www.mongodb.com/community/licensing">MongoDB</a> or <a href="https://www.elastic.co/pricing/faq/licensing">Elasticsearch</a>)</p><p>Off course, docker-compose does not apply to production. The Supabase community has stepped up to create <a href="https://github.com/supabase-community/supabase-kubernetes">basic Kubernetes Helm charts</a> (<em>disclaimer: I have contributed to these Helm charts as well)</em>. But I would call these community Helm charts “starting points” rather than production-ready manifests to self-host Supabase at scale.</p><p>Supabase (the company) has no on-prem or self-hosted Supabase product offering or an officially-published self-hosted version. Their focus is solely on growing the SaaS product; they are going head-to-head with Firestore. But Supabase SaaS falls short for some customer needs. Lets list these use-cases to start a conversation around building a compelling case for developing self-hosted Supabase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YpMFApOwS88tAJd0TWsEYA.png" /><figcaption>Supabase SaaS is only hosted on a select number of AWS data centers.</figcaption></figure><ol><li><strong>Flexibility and Control</strong> — Supabase is more than just a database. There is a real-time component, a storage component, routing and ingress, auth and a REST api. For any sizeable application, an architect would like to have granular per-component control over scaling, redundancy and disaster recovery, monitoring and alerts and SLAs. Self-hosting Supabase gives the system architect that sort of flexibility. I am not saying Supabase SaaS is not architected well, I am saying it can’t be a one-size-fits-all!</li><li><strong>Latency </strong>— Supabase SaaS is hosted exclusively on AWS; users need to choose which AWS region to spin up their own Supabase instance. That is big limitaton, latency-wise, for what is essentially a relational database. For example, what if my customers are in Africa (where there is no Supabase option) or what if my application code runs on a different cloud provider? We are potentially adding 100s of milliseconds of latency per database call due to this limitation. On the other hand, self-hosted Supabase could be spun up in the same cloud/region/VPC as the application, shaving off latency by a lot.</li><li><strong>Limited Postgres Environment Control</strong> — Every application is different; Larger Postgres databases and the infrastructure hosting them can be tuned very effectively to specific applications. A user does not have that flexibility with Supabase SaaS. On the other hand, a self-hosted Supabase installation will give system architects access to hardware and OS optimizations. For example, a self-hosted Postgres database infrastructure can be built to use disks appropriate for the read/write patterns of the application.</li><li><strong>Missing Analytics Link</strong> — Currently there is very limited capability to sync Supabase SaaS Postgres data into a data-lake solution (e.g. Google Bigquery or AWS Redshift). Even if the Supabase SaaS solution offered scripts to do this synchronization, the cost and slow speed of frequently syncing a large database to an external analytics solution would be prohibitive. For example, you could download a Supabase SaaS Postgres backup over the Internet and then upload this data into the Analyics system today, but that approach is a non-starter for a large database (10s or 100s of GiB or more). A self-hosted Supabase solution will make it possible to house the Postgres database close to the analytics solution. In my opinion, this is the biggest advantage Google-hosted Firebase has over Supabase SaaS today. Google Firebase can sync its data with Bigquery over a high speed intra-datacenter network.</li><li><strong>Security</strong> — This one is easy — many types of sensitive data simply cannot be hosted on SaaS databases; although Supabase (the company) highlights SoC2 for its <a href="https://supabase.com/pricing">Enterprise</a> plan, there are many use-cases across industry (HIPAA, Fedramp, ISO 27001, GDPR etc.) where a SaaS database, especially hosted by a smaller company like Supabase, will be problematic for any user.</li></ol><h3>Missing: Self-Hosted Supabase</h3><p>So, where are the self-hosted Supabase how-tos, infrastructure-as-code repositories to stand it up, discussions and forums to run it in a production-like environment, and most importantly, the willingness of Supabase (the company) to champion self-hosted Supabase?</p><p>Missing.</p><p>But why?</p><ol><li>Does Supabase (the company) think there is no real market for self-hosted Supabase and therefore, its not worth the investment?</li><li>Is it simply too complicated to run self-hosted Supabase and support it across different users? Maybe large enterprise Supabase customers who need self-hosted Supabase don’t exist in large numbers.</li><li>Does self-hosted Supabase present a threat to Supabase SaaS, disuading Supabase (the company) from investing and supporting self-hosted Supabase?</li></ol><p>I’d love to hear thoughts from readers on why self-hosted Supabase is so irrelevant to Supabase (the company) and to the larger Supabase community in general.</p><h3>Quo Vadis? Where do we go from here?</h3><p>In my opinion standing up and running self-hosted Supabase is challenging, but not outside the realm of possibility of a team with a couple of talented systems engineers. And for this same reason, I don’t think Supabase SaaS is in any way threatened by self-hosted — the cost of hiring those talented systems engineers is the protective moat around Supabase SaaS.</p><p>BUT, there is significant value being left on the table by not promoting self-hosted Supabase. Hopefully, community efforts like the <a href="https://github.com/supabase-community/supabase-kubernetes">Supabase Helm charts</a> will mature further to make production-level self-hosted Supabase a reality. Lets also hope that Supabase (the company) supports self-hosted Supabase in every way possible so that some of the limitations of Supabase SaaS I wrote earlier can be addressed by self-hosted Supabase.</p><p>The big battle is with Firestore/Firebase here, not with self-hosted Supabase! And the <em>ability to self-host</em> is the one superpower Firestore/Firebase will never have.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbdab63df3fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Will That Kubernetes v1.22 Upgrade Break My Application?]]></title>
            <link>https://blog.runx.dev/will-that-kubernetes-v1-22-upgrade-break-my-application-cc339dc2e2c7?source=rss-9772b2749937------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc339dc2e2c7</guid>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-upgrades]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Sachin Agarwal]]></dc:creator>
            <pubDate>Wed, 09 Feb 2022 18:15:28 GMT</pubDate>
            <atom:updated>2022-02-09T18:15:28.573Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*xMHaqrxJJD4G9MlTz_4wQQ.png" /><figcaption>The Kubernetes Version Train, 4 minor versions each year!</figcaption></figure><p><em>Kubernetes is a </em><a href="https://kubernetes.io/releases/#release-history"><em>fast-paced</em></a><em> Open-source project. The upcoming retirement of Kubernetes v1.18 from </em><a href="https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html"><em>Amazon EKS</em></a><em> and </em><a href="https://cloud.google.com/kubernetes-engine/docs/release-schedule"><em>Google GKE</em></a><em> and the adoption of v1.22 unleashes several breaking changes in the Kubernetes API that can impact your application uptime.</em></p><p><em>How can you confirm that your application stack will not break after an upgrade?</em></p><p>The Kubernetes Project releases minor version updates every quarter, and each minor version will reach its end-of-life after about one year of the release date. Users are expected to update their infrastructure to at least within a few minor versions of the latest Kubernetes release. Refer to the <a href="https://kubernetes.io/releases/">Kubernetes release schedule</a> to learn about the release cadence and when your Kubernetes server version will reach end-of-life.</p><p>Apart from stability and software improvements, Kubernetes upgrades can also change the “Kubernetes API”. This means that your infrastructure-as-code Kubernetes manifests or Helm charts will need to evolve with these API changes. <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/">The Deprecated API Migration Guide</a> provides accurate information to help migrate from deprecated API versions to newer and more stable API versions.</p><p>As of this writing (Feb 2022), the big switch to Kubernetes v1.22 in Amazon EKS and Google GKE’s regular channel is imminent. In addition, Kubernetes v1.18 is reaching end-of-life in March 2022. Both these changes will see a major change in critical parts of the Kubernetes API, forcing users to change their Kubernetes manifests and helm charts before Kubernetes is upgraded. Not doing so could cause downtime in your applications, so read on to learn where to look for backward-incompatible API changes and how to fix them.</p><h3>Am I Impacted?</h3><p>Lets first understand if your infrastructure-as-code manifests and helm charts need to be updated for the move to Kubernetes 1.22.</p><p>Here are some of the components that “talk” the Kubernetes API to your cluster:</p><ol><li>Your Kubernetes manifest yaml files</li><li>Any custom helm charts you have written for your application(s)</li><li>Any helm charts you installed from the Internet</li><li>Any tools you are currently using to administer, control or monitor your Kubernetes clusters (e.g. kubectl, helm etc.)</li><li>Terraform or Pulumi infrastructure-as-code files which have the Kubernetes or Helm providers for example</li><li>Any direct invocation of the Kubernetes API from your code, scripts etc.</li></ol><p>In this article we will focus on items 1–3, since these are the most common integration points between your application stack and the Kubernetes API.</p><h3>Understanding API Deprecation and Removal</h3><p>As the Kubernetes API evolves, APIs are periodically reorganized or upgraded. When APIs evolve, the old API is deprecated and eventually removed. The <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/">Kubernetes Deprecation guide </a>contains information you need to know when migrating from deprecated API versions to newer and more stable API versions.</p><p>It is important to understand that APIs marked as “deprecated” are “removed” after a few minor releases. For example, the networking.k8s.io/v1beta1 API was deprecated in Kubernetes v1.19 and removed in Kubernetes v1.22; Its new stable replacement networking.k8s.io/v1 was available in Kubernetes v1.19 onwards. This means that users could use both the API versions in Kubernetes v1.19-1.21; but remember, Kubernetes releases a minor version every quarter so you will need to remove deprecated APIs within a few months of their deprecation.</p><h3>Setting up a Test Environment</h3><p>If you already have a test or staging Kubernetes cluster where you can test deprecated APIs, then you can skip this section. Here is an easy way to setup two Kubernetes clusters with different versions on your local machine or a VM to understand how API deprecation impacts your application stack:</p><ol><li>Install <a href="https://docs.docker.com/get-docker/">Docker</a> and <a href="https://kind.sigs.k8s.io/docs/user/quick-start/#installation">kind</a>, a tool for running local Kubernetes clusters using Docker containers. Kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.</li><li>Create Kubernetes v1.22 and v1.18 clusters and install the <a href="https://github.com/kubernetes/ingress-nginx">ingress-nginx</a> helm chart on both of them:</li></ol><pre># Kubernetes v1.22<br>kind create cluster --name k122 --image kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047 </pre><pre>helm upgrade --install ingress-nginx ingress-nginx   --repo <a href="https://kubernetes.github.io/ingress-nginx">https://kubernetes.github.io/ingress-nginx</a>   --version 4.0.17 --namespace ingress-nginx --create-namespace</pre><pre># Kubernetes v1.18<br>kind create cluster --name k118 --image kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c</pre><pre>helm upgrade --install ingress-nginx ingress-nginx   --repo <a href="https://kubernetes.github.io/ingress-nginx">https://kubernetes.github.io/ingress-nginx</a>   --version 3.40.0 --namespace ingress-nginx --create-namespace</pre><p>You may have noticed that we used different ingress-nginx helm chart versions for Kubernetes v1.22 and v1.18.</p><p>Why?</p><p>Because the ingress-nginx 3.x.x helm charts only support Kubernetes versions up to v1.18, and the 4.x.x helm charts support Kubernetes versions v1.19+. So as you can see, we also need to carefully vet our helm charts and their versions when upgrading Kubernetes. A lot of users will be impacted when their Kubernetes version is upgraded to v1.22 or beyond: according to <a href="https://kubedex.com/top-10/">this report</a>, the ingress-nginx helm chart is the most downloaded and used helm-chart in the world.</p><p>3. After installation, you should see two new <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#define-clusters-users-and-contexts">Kubernetes contexts</a>:</p><pre>kubectl config get-contexts</pre><pre>CURRENT   NAME         CLUSTER       AUTHINFO   NAMESPACE</pre><pre>          kind-k118    kind-k118     kind-k118</pre><pre>*         kind-k122    kind-k122     kind-k122</pre><p>You can now switch your command line tools (<a href="https://kubernetes.io/docs/tasks/tools/">kubectl</a>, <a href="https://helm.sh/docs/intro/install/">helm</a>, etc.) by setting the current context. For example,</p><pre># Use the Kubernetes v1.18 cluster<br>kubectl config use-context kind-k118</pre><pre># Use the Kubernetes v1.22 cluster<br>kubectl config use-context kind-k122</pre><p>Great, you now have a couple of Kubernetes clusters to play around with and try out API deprecation examples of this article and your own application stack.</p><p><strong>Example 1: Application With Ingress</strong></p><p>Lets create a simple httpd application on both our Kubernetes clusters, expose it with a Kubernetes service and create an ingress object for each:</p><pre># KUBERNETES v1.18</pre><pre>kubectl config use-context kind-k118<br>kubectl create deployment demo --image=httpd --port=80<br>kubectl expose deployment demo<br><br>cat &lt;&lt;EOF &gt; ing118.yaml<br>apiVersion: networking.k8s.io/v1beta1<br>kind: Ingress<br>metadata:<br>  name: demo-localhost<br>spec:<br>  rules:<br>  - host:  demo.localdev.me<br>    http:<br>      paths:<br>      - path: /<br>        backend:<br>          serviceName: demo<br>          servicePort: 8<br>EOF</pre><pre>kubectl apply -f ing118.yaml</pre><pre># Output<br># ingress.networking.k8s.io/demo-localhost created</pre><p>Now, if you tried to run the exact same code for the Kubernetes v1.22 cluster, it would fail because the ingress API version networking.k8s.io/v1beta1has been deprecated and removed from the Kubernetes API:</p><pre># KUBERNETES v1.22<br>kubectl config use-context kind-k122<br>kubectl create deployment demo --image=httpd --port=80<br>kubectl expose deployment demo<br></pre><pre># This command doesn&#39;t create the ingress object successfully<br>kubectl apply -f ing118.yaml</pre><pre># Output<br># error: unable to recognize &quot;ing118.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;networking.k8s.io/v1beta1&quot;</pre><p>For Kubernetes v1.22 we instead need to use the newer ingress API networking.k8s.io/v1(and also note the change in the ingress spec compared to the older version in the manifest below):</p><pre># KUBERNETES v1.22<br>kubectl config use-context kind-k122<br>kubectl create deployment demo --image=httpd --port=80<br>kubectl expose deployment demo<br>cat &lt;&lt; EOF &gt; ing122.yaml<br>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: demo-localhost<br>spec:<br>  ingressClassName: nginx<br>  rules:<br>  - host: demo.localdev.me<br>    http:<br>      paths:<br>      - backend:<br>          service:<br>            name: demo<br>            port:<br>              number: 80<br>        path: /<br>        pathType: Prefix</pre><pre>EOF</pre><pre>kubectl apply -f ing122.yaml</pre><pre># Output<br>ingress.networking.k8s.io/demo-localhost created</pre><p><strong>Example 2: Prometheus Helm Chart</strong></p><p>Lets try to install an older version of Prometheus Helm Chart on the two clusters</p><pre># KUBERNETES 1.18<br>kubectl config use-context kind-k118<br>helm repo add prometheus-community <a href="https://prometheus-community.github.io/helm-charts">https://prometheus-community.github.io/helm-charts</a><br>helm install prom prometheus-community/prometheus --version 11.13.1</pre><pre># Succeeds</pre><p>New lets try to install the same version on the Kubernetes v1.22 cluster:</p><pre># KUBERNETES 1.22<br>kubectl config use-context kind-k122<br>helm repo add prometheus-community <a href="https://prometheus-community.github.io/helm-charts">https://prometheus-community.github.io/helm-charts</a><br>helm install prom prometheus-community/prometheus --version 11.13.1</pre><pre># Output<br># Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: [unable to recognize &quot;&quot;: no matches for kind &quot;ClusterRole&quot; in version &quot;rbac.authorization.k8s.io/v1beta1&quot;, unable to recognize &quot;&quot;: no matches for kind &quot;ClusterRoleBinding&quot; in version &quot;rbac.authorization.k8s.io/v1beta1&quot;]</pre><p>Apparently, this older Prometheus chart (v11.13.1 from September 2020) is not compatible with Kubernetes v1.22 because the RBAC <em>ClusterRoleBinding</em> API has changed.</p><p>You may (or may not) find references to removing deprecated API code in a Helm chart’s release notes. Sometimes the only way to ascertain if a helm chart is going to break in your upgraded Kubernetes cluster is to search its source code for removed APIs, or better, try it on a test cluster before deploying it on your upgraded production cluster.</p><p>Lets try the Helm chart v15.1.3 on the Kubernetes v1.22 cluster instead:</p><pre># KUBERNETES 1.22<br>kubectl config use-context kind-k122<br>helm install prom prometheus-community/prometheus --version 15.1.3</pre><pre># Succeeds</pre><h3>Detecting Deprecated and Removed APIs</h3><p>Lets look at a couple of ways you can detect if your application stack’s Kubernetes API calls use deprecated or removed APIs. Specifically, we will determine if (1) Which deployed helm releases and kubernetes files are using deprecated APIs, using <a href="https://github.com/FairwindsOps/pluto">Fairwinds Pluto</a> and (2) If the Kubernetes API server received deprecated API calls, the metrics around these invocations, using <a href="https://kubernetes.io/docs/reference/kubectl/kubectl/">kubectl</a>.</p><p><strong>Fairwinds Pluto</strong></p><p>Pluto is a utility to help users find <a href="https://k8s.io/docs/reference/using-api/deprecation-guide/">deprecated Kubernetes</a> APIs in their code repositories and their helm releases. The tool scans existing helm releases or Kubernetes manifest files and flags deprecated APIs. You can install Pluto by downloading the binary release appropriate for your system from <a href="https://github.com/FairwindsOps/pluto/releases">here</a>.</p><p>Lets scan our Kubernetes manifests with Pluto.</p><pre>$ ls<br>ing118.yaml  ing122.yaml</pre><pre>$ pluto detect-files -o wide<br>NAME             NAMESPACE   KIND      VERSION                     REPLACEMENT            DEPRECATED   DEPRECATED IN   REMOVED   REMOVED IN  <br>demo-localhost   &lt;UNKNOWN&gt;   Ingress   networking.k8s.io/v1beta1   networking.k8s.io/v1   true         v1.19.0         true      v1.22.0</pre><pre>$</pre><p>Pluto is telling us that we have the deprecated Ingress API networking.k8s.io/v1beta1 in our manifests that was deprecated in Kubernetes v1.19 and removed in v1.22. Notice that in the detect-files mode Pluto is only checking the manifest files and not objects in the Kubernetes cluster. So you don’t need to run this scan with a Kubernetes context; you could easily add it to your CI pipeline if your application stack uses Kubernetes manifest files.</p><p>Next, lets use Pluto to scan Helm releases installed in our Kubernetes cluster:</p><pre>$ kubectl config use-context kind-k118<br>Switched to context &quot;kind-k118&quot;.<br>$ pluto detect-helm -o wide<br>NAME                                NAMESPACE   KIND                 VERSION                             REPLACEMENT                    DEPRECATED   DEPRECATED IN   REMOVED   REMOVED IN  <br>prom/prom-kube-state-metrics        default     ClusterRole          rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-prometheus-alertmanager   default     ClusterRole          rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-prometheus-pushgateway    default     ClusterRole          rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-prometheus-server         default     ClusterRole          rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-kube-state-metrics        default     ClusterRoleBinding   rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-prometheus-alertmanager   default     ClusterRoleBinding   rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-prometheus-pushgateway    default     ClusterRoleBinding   rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0     <br>prom/prom-prometheus-server         default     ClusterRoleBinding   rbac.authorization.k8s.io/v1beta1   rbac.authorization.k8s.io/v1   true         v1.17.0         true      v1.22.0</pre><p>Pluto tells us that our v11.13.1 Prometheus Helm chart has several deprecated APIs that will be removed in Kubernetes v1.22; this explains why we had to instead use Helm chart v15.1.3 for Kubernetes v1.22.</p><p><strong>Kubectl (Kubernetes v1.19+)</strong></p><p>If you have a Kubernetes v1.19+ cluster, the API will return a warning when a deprecated API is used. For example</p><pre>cat &lt;&lt; EOF | kubectl apply -f -<br>apiVersion: batch/v1beta1<br>kind: CronJob<br>metadata:<br>  name: hello<br>spec:<br>  schedule: &quot;* * * * *&quot;<br>  jobTemplate:<br>    spec:<br>      template:<br>        spec:<br>          containers:<br>          - name: hello<br>            image: busybox<br>            imagePullPolicy: IfNotPresent<br>            command:<br>            - /bin/sh<br>            - -c<br>            - date; echo Hello from the Kubernetes cluster<br>          restartPolicy: OnFailure<br>EOF</pre><pre># Output</pre><pre>Warning: batch/v1beta1 CronJob is deprecated in v1.21+, unavailable in v1.25+; use batch/v1 CronJob<br>cronjob.batch/hello created</pre><p>You can also get metrics about deprecated API usage of your environment using just kubectl, as documented on this <a href="https://kubernetes.io/blog/2020/09/03/warnings/#deprecation-warnings">Kubernetes Blog</a> article.</p><p><strong>Pluto and Kubectl: NOT always Sufficient</strong></p><p>We note that both Pluto and kubectl deprecation detection methods are not sufficient to find all deprecation issues. For example, consider the ingress-nginx helm chart versions issue we discussed in the previous section: version 3.x.x of the helm chart will not work with Kubernetes v1.22+, even though both Pluto and Kubectl do not report deprecations. The 3.x.x version tries to invoke the older Kubernetes ingress API from within <a href="https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v1.0.0">binary code</a> of the ingress nginx controller which Pluto or Kubectl cannot detect.</p><p>The key to detecting that ingress-nginx helmcharts versions need to be upgraded to 4.x.x is then only possible by looking at the release notes and source code of the Helm chart. If you want to be sure that your helm charts and kubernetes manifests are not outdated, spend time looking at their release notes and documentation, and do test critical third-party helm charts on upgraded Kubernetes versions.</p><p><strong>Cleaning up</strong></p><p>As an aside, you can delete the Kind Kubernetes clusters, like so</p><pre>kind get clusters<br>k118<br>k122</pre><pre>kind delete clusters k118<br>kind delete clusters k122</pre><h3>Notable API Changes in Kubernetes v1.22</h3><p>As of this writing, the <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22">upgrade to v1.22</a> brings forth several deprecations and breaking changes because of outdated API removal. Here is a list of the APIs that have been removed:</p><ol><li><strong>Webhook resources:</strong> admissionregistration.k8s.io/v1beta1 → admissionregistration.k8s.io/v1</li><li><strong>CustomResourceDefinition:</strong> apiextensions.k8s.io/v1beta1 → apiextensions.k8s.io/v1</li><li><strong>APIService: </strong>apiregistration.k8s.io/v1beta1 → apiregistration.k8s.io/v1</li><li><strong>TokenReview</strong>: authentication.k8s.io/v1beta1 → authentication.k8s.io/v1</li><li><strong>SubjectAccessReview: </strong>authorization.k8s.io/v1beta1 → authorization.k8s.io/v1</li><li><strong>CertificateSigningRequest: </strong>certificates.k8s.io/v1beta1 → certificates.k8s.io/v1</li><li><strong>Lease:</strong> coordination.k8s.io/v1beta1 → coordination.k8s.io/v1</li><li><strong>Ingress: </strong>extensions/v1beta1, networking.k8s.io/v1beta1 → networking.k8s.io/v1</li><li><strong>IngressClass: </strong>networking.k8s.io/v1beta1 → networking.k8s.io/v1</li><li><strong>RBAC resources: </strong>rbac.authorization.k8s.io/v1beta1 → rbac.authorization.k8s.io/v1</li><li><strong>PriorityClass: </strong>scheduling.k8s.io/v1beta1 → scheduling.k8s.io/v1</li><li><strong>Storage resources: </strong>storage.k8s.io/v1beta1 → storage.k8s.io/v1</li></ol><p><em>Remember its not sufficient to simply change the apiversion key in your Kubernetes manifests, as we noted in the ingress example above, the spec of the manifest file can also change with the apiversion.</em></p><p>You can use the techniques shown in the examples above to ascertain which of these removed APIs are in your application stack Kubernetes manifests and Helm charts before you upgrade to Kubernetes v1.22 and beyond. This should ensure a smooth transition into using the new stable APIs and minimal downtime for your applications.</p><h3>Outlook</h3><p>Kubernetes is an incredibly fast-paced project. Moreover, many related cloud-native projects, our Ingress-nginx and Prometheus Helm charts for example, are equally quick to release newer versions. It is mandatory for users to stay on top of these changes by following the releases of these projects and their deprecation timelines and to upgrade their infrastructure components regularly.</p><p>Equally important is using some of the techniques shown in this article for detecting breaking changes and validating your application stack before you hit the upgrade button, or before your Kubernetes provider automatically upgrades your Kubernetes version!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc339dc2e2c7" width="1" height="1" alt=""><hr><p><a href="https://blog.runx.dev/will-that-kubernetes-v1-22-upgrade-break-my-application-cc339dc2e2c7">Will That Kubernetes v1.22 Upgrade Break My Application?</a> was originally published in <a href="https://blog.runx.dev/">Run[X]</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortless MongoDB Atlas With Opta]]></title>
            <link>https://blog.runx.dev/effortless-mongodb-atlas-with-opta-eeb1ef0c5902?source=rss-9772b2749937------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeb1ef0c5902</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[opta]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Sachin Agarwal]]></dc:creator>
            <pubDate>Wed, 17 Nov 2021 19:21:22 GMT</pubDate>
            <atom:updated>2021-11-17T19:21:22.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*kj2QG_nQYhMrWbnQzh9ZSA.png" /><figcaption>Deploy MongoDB Atlas Applications and Databases with Opta</figcaption></figure><p><em>Do you use MongoDB Atlas in your application stack? This post shows you how to use Opta to spin up a MongoDB Atlas database and link it to your application.</em></p><h3>Introduction</h3><p><a href="https://docs.opta.dev/">Opta</a> lets you do infrastructure-as-code where you work with High-level constructs instead of getting lost in low level cloud configuration.</p><p><a href="https://docs.atlas.mongodb.com/">MongoDB Atlas</a> simplifies deploying and managing your MongoDB databases while offering the versatility you need to build resilient and performant global applications on the cloud providers of your choice.</p><p>Put together, Opta and MongoDB Atlas abstract away the complexity of deploying your applications and MongoDB databases in a production-ready cloud infrastructure. Together, they will smoothen development experience and improve your product’s feature velocity and reliability.</p><p>This blog shows you how to implement a movie search application with Atlas Search and deploy it using Opta. It is based on this <a href="https://www.mongodb.com/developer/how-to/build-movie-search-application?utm_source=runx_opta&amp;utm_campaign=pla&amp;utm_medium=referral">blog pos</a>t; but with some notable differences:</p><ol><li>Opta handles the creation of the MongoDB Atlas cluster and database, passing its credentials into the application’s code.</li><li>Instead of MongoDB Realm, this example uses a simple Flask API backend and deploys it on to a Kubernetes cluster; don’t worry — you won’t have to spin up the Kubernetes cluster yourself, Opta will do it for you in the cloud of your choice or even your local machine!</li></ol><p>Atlas is currently supported in Local and AWS Opta environments. Feel free to open a Github issue if you would like to see support in GCP or Azure.</p><p>All the code used in this example is <a href="https://github.com/run-x/opta-examples.git">available from here</a>.</p><p>Let’s get started!</p><h3>Setup</h3><p>Install the open-source Opta cli tool by following the<a href="https://docs.opta.dev/installation/"> Opta installation instructions</a>. If you are new to MongoDB Atlas you can sign up <a href="https://www.mongodb.com/try?utm_source=runx_opta&amp;utm_campaign=pla&amp;utm_method=referral">here</a>. The search application described in this blog can be implemented with the MongoDB Atlas free-tier.</p><p>(Git) clone the Opta examples <a href="https://github.com/run-x/opta-examples.git">repository</a> and use the Opta files in the <em>opta-atlas-mongo-search</em> sub-directory as a starting point. You will need your AWS and MongoDB <a href="https://docs.atlas.mongodb.com/tutorial/manage-programmatic-access?utm_source=runx_opta&amp;utm_campaign=pla&amp;utm_medium=referral">Atlas API credentials</a>. You do not need to configure the IP address in the MongoDB Atlas API key, Opta will do that for you.</p><h3>Prepping the Opta Environment</h3><p>After you have downloaded these keys from the AWS and Atlas GUIs, set them as environment variables in the terminal shell where you plan to run Opta.</p><pre># Atlas Mongo</pre><pre>export MONGODB_ATLAS_PUBLIC_KEY=”fakeefghij”</pre><pre>export MONGODB_ATLAS_PRIVATE_KEY=”FAKE015e-4503–4f95-f129–543d4e58bsdg”</pre><pre><br># AWS</pre><pre>export AWS_ACCESS_KEY_ID=FAKEFTRFFSDQAZA</pre><pre>export AWS_SECRET_ACCESS_KEY=FAKEksfja234sadfbjsdfgsdfg34SAD34fd</pre><p>Next, we create the Opta environment with the AWS EKS Kubernetes cluster, as documented <a href="https://docs.opta.dev/getting-started/aws/">here</a>. You can also refer to the<a href="https://github.com/run-x/opta-examples/blob/main/opta-mongodb-atlas-search/opta/awsenv.yaml"> environment example</a> yaml file in the git repository.</p><p><em>Note: If you are only trying this out on your local machine, append the — local flag to all the opta commands so that a local Kubernetes cluster is spun up on your machine rather than the AWS EKS cluster. For local runs as well, the MongoDB Atlas Cluster will still be spun up in the cloud.</em></p><h3>Deploying the Application with Opta</h3><p>Once we have the Kubernetes cluster, we can create the MongoDB application by running opta apply on the<em> opta-mongodb-atlas-search/opta/atlasmongoservice.yaml</em> file. Remember to set your <em>mongo_atlas_project_id</em> in this file before running Opta.</p><p>First, lets create the docker image that contains our application code:</p><pre># in the opta-examples directory cloned from Github (https://github.com/run-x/opta-examples.git)</pre><pre>docker build -t mongoapp:latest ./opta-atlas-mongo-search</pre><p>Then,</p><pre># For aws</pre><pre>opta deploy — image=mongoapp:latest -c opta-examples/opta-atlas-mongo-search/opta/atlasmongoservice.yaml</pre><pre># OR, For local</pre><pre>opta deploy — image=mongoapp:latest — local -c opta-examples/opta-atlas-mongo-search/opta/atlasmongoservice.yaml</pre><p>After a few minutes, the application will be running against the new MongoDB Atlas cluster.</p><h3>Sample Data and Atlas Search Index Setup</h3><p>Before you can use the application, follow <a href="https://www.mongodb.com/developer/how-to/build-movie-search-application?utm_source=runx_opta&amp;utm_campaign=pla&amp;utm_medium=referral#step-1.-spin-up-atlas-cluster-and-load-movie-data">steps 1 and 2</a> in the original MongoDB tutorial in order to load the sample data and set up the search index in the Atlas database (Although you don’t have to create the cluster, Opta will perform that step). After you have created the MongoDB Atlas search index, wait for a few minutes before going to the next step as the index is built in MongoDB Atlas. Opta will also set correct firewall rules inside MongoDB Atlas so that your application’s IP address(s) can connect to the database.</p><p>Once you are done, run <em>opta output</em> to get the AWS ELB endpoint url and point your browser to the address (or to<em> </em><a href="http://localhost:8080/"><em>http://localhost:8080/</em></a> in case you are using Opta Local); You should now be able to search the movie database like in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jov-89jZSXXw2nFv" /><figcaption>Movie Search Sample Screenshot</figcaption></figure><p>If you want, you can use Opta to <a href="https://docs.opta.dev/tutorials/ingress/">add TLS</a> to serve the application over HTTPS on your domain!</p><h3>Conclusion</h3><p>And there you have it, a web application (Flask API+SPA) using MongoDB Atlas deployed in minutes with Opta.</p><p>We were able to deploy the application to a SOC-2 compliant AWS EKS Kubernetes cluster and spin up an Atlas database that automatically connected into our Flask application. All with a couple of simple Opta infrastructure-as-code yaml files and without diving into the nitty-gritties of low-level terraform AWS constructs. Spend less time wrestling with your infrastructure and more time with your application!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeb1ef0c5902" width="1" height="1" alt=""><hr><p><a href="https://blog.runx.dev/effortless-mongodb-atlas-with-opta-eeb1ef0c5902">Effortless MongoDB Atlas With Opta</a> was originally published in <a href="https://blog.runx.dev/">Run[X]</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello, Opta Local]]></title>
            <link>https://blog.runx.dev/hello-opta-local-150c04be6db5?source=rss-9772b2749937------2</link>
            <guid isPermaLink="false">https://medium.com/p/150c04be6db5</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Sachin Agarwal]]></dc:creator>
            <pubDate>Tue, 12 Oct 2021 20:09:09 GMT</pubDate>
            <atom:updated>2021-10-12T20:09:09.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZsByeMexaoRWJYeBVimCw.png" /><figcaption>Opta Local: Every developer gets their own Kubernetes environment to develop and test their code</figcaption></figure><p><em>A version of the content in this Blogpost is available as a Youtube video: </em><a href="https://www.youtube.com/watch?v=xKIxolcVvTs"><em>https://www.youtube.com/watch?v=xKIxolcVvTs</em></a></p><p>Developers are increasingly tasked with building and running their applications on Kubernetes. While Kubernetes provides a nice cloud-agnostic platform for applications to escape vendor lock-in and seamlessly “migrate” across different cloud providers, the local code development is still outside this abstraction.</p><p>Developers run their code on a different operating system (like a MacOS or Windows PC) or use tools like docker compose to build and test their applications. Developers need to maintain a different local/test setup on their local machine and deal with porting their code into Kubernetes. Some even try to run test environments in public clouds, resigning to slow turn-around times and costs. Not fun, and prone to downstream testing errors and longer iteration cycles.</p><p>Thats why we built Opta Local into the <a href="https://docs.opta.dev/">Opta CLI</a>.</p><p>Opta Local will let you test and iterate your code on a Kubernetes cluster running on your own machine; and then use the same infrastructure-as-code Opta files to deploy to AWS, GCP or Azure. Behind the scenes, it deploys a Kubernetes Kind cluster and Docker registry on your local machine using docker containers, and thats where you deploy and test your code.</p><p>The high-level workflow for a developer is shown in the figure above. The developer creates code, builds its docker image, and deploys it into a local Kubernetes environment. The developer can quickly iterate without having to maintain a docker-compose environment or deal with the long wait times of deploying to the public cloud.</p><p>When the developer is ready to deploy the code to the public cloud, s/he can use the same Opta infrastructure-as-code to deploy to AWS, GCP or Azure.</p><h3>The Example</h3><p>Our full-stack example, <a href="https://github.com/run-x/opta-examples/tree/main/full-stack-example">downloadable here</a>, creates a Todo list web application with a single-page Vuejs frontend, Django Rest Framework API backend and a Postgres database. A observability stack based on Prometheus/Grafana is also attached so you can monitor the infrastructure.</p><p>Clone the opta-examples git repository</p><pre>git clone https://github.com/run-x/opta-examples.git</pre><blockquote><em>You will find the Todo list full-stack-example in the </em>full-stack-example<em> folder.</em> <em>You can view the details of running this example locally and on a cloud provider in</em> <a href="https://github.com/run-x/opta-examples/blob/main/full-stack-example/README.md">full-stack-example/README.md</a>.</blockquote><p><a href="https://docs.opta.dev/installation/">Install Opta</a> cli (≥ v0.15.0) on your local machine.</p><p><strong>TL; DR</strong></p><p>Build your application containers. You can tag these differently as you iterate developing your application.</p><pre># Build the Django API docker container</pre><pre>docker build full-stack-example/api/todo-python-django/ --tag todo-api:v1</pre><pre># Build the single page application Vuejs Frontend</pre><pre>docker build full-stack-example/frontend/todo-vuejs --tag todo-frontend:v1</pre><p>These commands will build the docker images for the Django API and Vuejs servers.</p><p>Deploy on your Local machine via Opta Local</p><pre># API</pre><pre>opta deploy --image todo-api:v1 --config full-stack-example/api/todo-python-django/opta/opta-api-service.yml --auto-approve --local</pre><pre># Frontend</pre><pre>opta deploy --image todo-frontend:v1 --config full-stack-example/frontend/todo-vuejs/opta/opta-frontend-service.yml --auto-approve --local</pre><p>Here is quick rundown of the Opta flags we used:</p><pre>--config<br>The file path of the Opta service yaml file.</pre><pre>--local<br>Ignore any environment key in th.e service opta yaml file and instead deploy to a local environment; a corresponding opto local yaml file will be created automatically.</pre><pre>--image<br>The prebuilt docker image on the local machine to deploy.</pre><pre>--auto-approve<br>Do not ask for confirmation for low-risk Opta changes.</pre><p>Optionally, deploy the Prometheus/Grafana observability stack</p><pre>opta apply --config full-stack-example/monitoring/opta-prometeus-grafana.yml --auto-approve --local</pre><p>Then open your local machine browser and visit <a href="http://localhost:8080/frontend">http://localhost:8080/frontend</a> for the Vuejs frontend, <a href="http://localhost:8080/djangapi/apis/v1/">http://localhost:8080/djangapi/apis/v1/</a> for the Django rest framework API and <a href="http://localhost:8080/grafana/">http://localhost:8080/grafana/</a> for the Prometheus/Grafana observability stack.</p><h3>Onwards to the Public Cloud</h3><p>Once you are ready to deploy to the Public cloud, you can use the same opta yaml files to deploy into AWS, GCP or Azure. Follow the instructions in <a href="https://github.com/run-x/opta-examples/tree/main/full-stack-example#deploy-to-amazon-web-services">this document</a> to deploy your application to AWS, for example.</p><h3>Lets Opta</h3><p>Learn more about Opta by reading our <a href="https://docs.opta.dev/getting-started/">getting started</a>. We at RunX are always looking for ways of helping the community and improving Opta. Feel free to join our <a href="https://slack.opta.dev/">Slack</a> to interact with the team directly or get a personalized demo by <a href="https://www.runx.dev/#">clicking here</a>!</p><p><em>A version of the content in this Blogpost is available as a Youtube video: </em><a href="https://www.youtube.com/watch?v=xKIxolcVvTs"><em>https://www.youtube.com/watch?v=xKIxolcVvTs</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=150c04be6db5" width="1" height="1" alt=""><hr><p><a href="https://blog.runx.dev/hello-opta-local-150c04be6db5">Hello, Opta Local</a> was originally published in <a href="https://blog.runx.dev/">Run[X]</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How TLS Works — Part 1]]></title>
            <link>https://blog.runx.dev/how-tls-works-part-1-56bcb08e395b?source=rss-9772b2749937------2</link>
            <guid isPermaLink="false">https://medium.com/p/56bcb08e395b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[opta]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[ssl]]></category>
            <dc:creator><![CDATA[Sachin Agarwal]]></dc:creator>
            <pubDate>Mon, 27 Sep 2021 19:11:32 GMT</pubDate>
            <atom:updated>2021-09-27T19:11:32.851Z</atom:updated>
            <content:encoded><![CDATA[<h3>How TLS Works — Part 1</h3><p>TLS (Transport Layer Security) is used to secure Internet communication (web-browsers to servers) as well as inter-server communication, for example, application servers commuicating with databases. Using TLS correctly guarantees that hackers and bad-actors can never evesdrop your communication (communication is encrypted using a virtually unbreakable cryptographic cipher) and also confirms the identity of the communicating parties to each other (impersonation is almost impossible).</p><p>We at <a href="https://www.runx.dev/">RunX</a> foster a security-first mindset; and so, unsurprisingly, every bit of infrastructure stood up by our flagship product, <a href="https://docs.opta.dev/overview/">Opta</a>, is secured using implementations of TLS. So how exactly does TLSwork?</p><p>To understand TLS, we need to understand how Public Key cryptography works. There is a lot of good documentation available for this, but for our TLS understanding purpose lets look at a picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*z-3VE61HiVOlcZEyKv26Mg.png" /><figcaption><strong>Public Key Encryption:</strong> The information sender uses the public-key of the information receiver to encrypt the message. No one can decrypt the encrypted information without the private key of the information receiver. The Information receiver uses their private key to decrypt the information.</figcaption></figure><p>The information sender uses the public-key of the information receiver to encrypt the message. No one can decrypt the encrypted information without the private key of the information receiver. The Information receiver uses their private key to decrypt the information. In this figure, the public and private key belong to the information receiver. These are sometimes referred to as key-pairs since they exactly complement each other.</p><p>There is one more aspect we should mention here; either the public key or private key can be used to encrypt information, and the corresponding complementary key (private key or public key) can be used to decrypt it. In the figure, we used the public key to encrypt the information and the private key to decrypt the infromation, but we could use the private key to encrypt information, then the public key to decrypt it. Usually, the information receiver freely gives away the public key so that any sender can use it to encrypt information to send to the receiver. The receiver can use the private key of the key-pair to decrypt the information.</p><p>After that detour explaining Public Key Encryption, we are ready to understand how TLS works. We will use the example of a web browser client being the information sender and a server being the information receiver. The favorite scenario fitting this example is a web browser client user wishing to transact with a bank server over the Internet.</p><p>The first step in setting up a secure link is to download the server’s public key. But before the web browser client can use the server’s public key to establish secure communication with the bank server, there is the additional problem of verifying that the public key being used is in fact the public key of the bank server and not a spurious public key that a hacker supplies to the web browser client. After all, we don’t want the web browser client being duped into securely communicating with the hacker’s server instead of the legitimate bank server!</p><figure><img alt="Well known Certificate Authorities can sign public keys of organizations." src="https://cdn-images-1.medium.com/max/807/1*j90mnk3-GM_X5Uth-roXkQ.png" /></figure><p>This is where well-known certificate authorities come into play. The bank server gets its public key signed by a certificate authority, as showing in the above figure. “Signing” means that the certificate authority takes the public key of the bank, verifies the bank and its domain (e.g. <a href="https://mybank.com/">https://mybank.com</a> infact belongs to the real bank Mybank), and uses PKE with its own private key (the plaintext information being the public key supplied by the bank in this case), to come up with a signed “certificate” for the bank.</p><p>Certificate authorities publish their public keys that come pre-installed in web browser clients. The web browser client can use the public key of the certificate authority to verify that the certificate being downloaded from the bank’s website is in fact correctly signed by this well known certificate authority (as we discussed earlier, information encrypted with the private key can be decoded by the corresponding public key of the key pair). If the certificate checks out, then the client can be assured that the server it is communicating to is in fact the legitimate server.</p><p>With this Public Key Infrastructure (public-private keypairs, certificate authorities) in place we have the building blocks to implement TLS! We’ve included a couple of excellent references below if you want to continue learning the details of TLS.</p><h3>References</h3><p>[1] Transport Layer Security <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0,_2.0,_and_3.0">https://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0,_2.0,_and_3.0</a></p><p>[2] TLS Basics <a href="https://www.internetsociety.org/deploy360/tls/basics/">https://www.internetsociety.org/deploy360/tls/basics/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56bcb08e395b" width="1" height="1" alt=""><hr><p><a href="https://blog.runx.dev/how-tls-works-part-1-56bcb08e395b">How TLS Works — Part 1</a> was originally published in <a href="https://blog.runx.dev/">Run[X]</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>