<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nodejs on Iulian Mocanu</title>
    <link>https://example.com/tags/nodejs/</link>
    <description>Recent content in Nodejs on Iulian Mocanu</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 20 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://example.com/tags/nodejs/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>KUBERNETES NODEJS FULLSTACK</title>
      <link>https://example.com/post/k8s-nodejs-fullstack/</link>
      <pubDate>Mon, 20 May 2024 00:00:00 +0000</pubDate>
      
      <guid>https://example.com/post/k8s-nodejs-fullstack/</guid>
      
        <description>&lt;h2 id=&#34;description-of-kubernetes-resources&#34;&gt;Description of Kubernetes Resources&lt;/h2&gt;
&lt;h3 id=&#34;database&#34;&gt;Database&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deployment (&lt;code&gt;database&lt;/code&gt;)&lt;/strong&gt;: Deploys PostgreSQL (&lt;code&gt;postgres:14&lt;/code&gt; image) database with initialization from &lt;code&gt;init.sql&lt;/code&gt; using a &lt;code&gt;ConfigMap&lt;/code&gt;. It mounts &lt;code&gt;database-volume-claim&lt;/code&gt; for persistent storage of PostgreSQL data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service (&lt;code&gt;database-service&lt;/code&gt;)&lt;/strong&gt;: Provides a stable endpoint (&lt;code&gt;database.development.svc.cluster.local&lt;/code&gt;) for accessing the PostgresSQL database (&lt;code&gt;postgres&lt;/code&gt; Deployment) internally within the Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ConfigMap (&lt;code&gt;database-init&lt;/code&gt;)&lt;/strong&gt;: Contains &lt;code&gt;init.sql&lt;/code&gt; script that initializes the database schema (&lt;code&gt;users&lt;/code&gt; table) upon PostgreSQL container startup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secret (&lt;code&gt;database-secret&lt;/code&gt;)&lt;/strong&gt;: Stores sensitive information such as PostgreSQL credentials (&lt;code&gt;POSTGRES_USER&lt;/code&gt;, &lt;code&gt;POSTGRES_PASSWORD&lt;/code&gt;, &lt;code&gt;POSTGRES_DB&lt;/code&gt;) encoded in base64.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PersistentVolume&lt;/strong&gt;: Provides storage for PostgreSQL data.​&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PersistentVolumeClaim (&lt;code&gt;database-volume-claim&lt;/code&gt;)&lt;/strong&gt;: Requests persistent storage for storing PostgreSQL data (&lt;code&gt;/var/lib/postgresql/data&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;backend&#34;&gt;Backend&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deployment (&lt;code&gt;backend&lt;/code&gt;)&lt;/strong&gt;: Manages the backend application (&lt;code&gt;backend:dev&lt;/code&gt; image) responsible for serving requests from the web browser and interacting with the database. It pulls PostgreSQL credentials from &lt;code&gt;database-secret&lt;/code&gt; for database connectivity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service (&lt;code&gt;backend-service&lt;/code&gt;)&lt;/strong&gt;: Provides a stable endpoint (&lt;code&gt;backend.development.svc.cluster.local&lt;/code&gt;) for accessing the backend application (&lt;code&gt;backend&lt;/code&gt; Deployment) internally within the Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ConfigMap (&lt;code&gt;backend-config&lt;/code&gt;)&lt;/strong&gt;: Contains the value of database service endpoint &lt;code&gt;database.development.svc.cluster.local&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;frontend&#34;&gt;Frontend&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deployment (&lt;code&gt;frontend&lt;/code&gt;)&lt;/strong&gt;: Manages the frontend application (using the &lt;code&gt;frontend:dev&lt;/code&gt; image) which is responsible for serving requests from the web browser and interacting with the backend application. The frontend retrieves the URL of the backend API from a ConfigMap named &lt;code&gt;frontend-config&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service (&lt;code&gt;frontend-service&lt;/code&gt;)&lt;/strong&gt;: Provides a stable endpoint (&lt;code&gt;frontend.development.svc.cluster.local&lt;/code&gt;) for accessing the frontend application (&lt;code&gt;frontend&lt;/code&gt; Deployment) internally within the Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ConfigMap (&lt;code&gt;backend-config&lt;/code&gt;)&lt;/strong&gt;: Contains the value of backend api url &lt;code&gt;http://backend.development.svc.cluster.local:3000/api/users&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;network-flow-description&#34;&gt;Network Flow Description&lt;/h2&gt;
&lt;p&gt;The network flow from the web browser to the database application via the backend application in Kubernetes involves the following steps:&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>