<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Infrastructure - Architect the cloud</title>
	<atom:link href="https://blog.slepcevic.net/tag/infrastructure/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.slepcevic.net</link>
	<description></description>
	<lastBuildDate>Wed, 12 Jun 2024 22:32:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Deploying a GLOBAL sentiment Analysis service using DeepSparse and Akamai Connected Cloud</title>
		<link>https://blog.slepcevic.net/deploying-a-global-sentiment-analysis-service-using-deepsparse-and-akamai-connected-cloud/</link>
					<comments>https://blog.slepcevic.net/deploying-a-global-sentiment-analysis-service-using-deepsparse-and-akamai-connected-cloud/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Wed, 12 Jun 2024 22:31:06 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Akamai Gecko]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linode Gecko]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[Akamai CLB]]></category>
		<category><![CDATA[Akamai Cloud Load Balancer]]></category>
		<category><![CDATA[DeepSparse]]></category>
		<category><![CDATA[EdgeAI]]></category>
		<category><![CDATA[Global computing]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode VM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Neural Magic]]></category>
		<guid isPermaLink="false">https://blog.slepcevic.net/?p=441</guid>

					<description><![CDATA[<p>In the previous post, we explored how to deploy a sentiment analysis application using Neural Magic’s DeepSparse on Akamai Connected Cloud (Linode). We leveraged just two dual-core VMs and a Nodebalancer to process a pretty impressive number(40K) of movie reviews...</p>
<p>The post <a href="https://blog.slepcevic.net/deploying-a-global-sentiment-analysis-service-using-deepsparse-and-akamai-connected-cloud/">Deploying a GLOBAL sentiment Analysis service using DeepSparse and Akamai Connected Cloud</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>In the <a href="https://blog.slepcevic.net/sentiment-analysis-of-40-thousand-movie-reviews-in-20-minutes-using-neural-magics-deepsparse-inference-runtime-and-linode/" target="_blank" rel="noopener" title="previous post">previous post</a>, we explored how to deploy a sentiment analysis application using Neural Magic’s DeepSparse on Akamai Connected Cloud (Linode). </p>



<p>We leveraged just two dual-core VMs and a Nodebalancer to process a pretty impressive number(40K) of movie reviews in just 20 minutes. However, deploying in a single region can lead to latency/availability issues and doesn&#8217;t fully utilize the global reach of modern cloud infrastructure Akamai Connected Cloud offers. </p>



<p>Also, single region deployments are kinda boring <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>In this post, we&#8217;ll expand our deployment by setting up virtual machines in <strong>all available</strong> Linode regions and replacing the current <a href="https://www.linode.com/products/nodebalancers/" title="Nodebalancer ">Nodebalancer </a>with Akamai’s new <a href="https://www.linode.com/green-light/" title="Cloud Load Balancer">Cloud Load Balancer</a> (currently in beta access). </p>



<p><strong>What is Akamai&#8217;s new Cloud Load Balancer you may ask? It&#8217;s really cool peace of tech.</strong></p>



<p>Think of it like an umbrella over the internet; it gives you the possibility to load balance your workloads across ANY location; it can be on prem, Akamai&#8217;s cloud, some other hyper-scaler, heck, it can even be your home IP address if you want to <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>



<p>As long as it can be reached over the internet, Cloud Load Balancer can use it to deliver the request. </p>



<p>Joking aside, here&#8217;s a more official description of the service:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>The Akamai Cloud Load Balancer (ACLB) (formerly referred to as Akamai Global Load Balancer) is a layer 4 and 7 load balancer that distributes traffic based on performance, weight, and content (HTTP headers, query strings, etc.). The ACLB is multi-region, independent of Akamai Delivery, and built for East-West and North-South traffic. Key features include multi-region/multi-cloud load balancing and method selection.</p>
</blockquote>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="259" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/clb3-1024x259.png" alt="" class="wp-image-447" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/clb3-1024x259.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/clb3-300x76.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/clb3-768x195.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/clb3.png 1303w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Why Scale Globally?</h3>



<p>Scaling out our application across multiple regions has several benefits:</p>



<ol class="wp-block-list">
<li><strong>Reduced Latency</strong>: By having servers closer to our users, we can significantly reduce the time it takes for requests to travel back and forth.</li>



<li><strong>High Availability</strong>: Distributing the load across multiple regions ensures that if one region goes down, well, we kinda don&#8217;t care, our app stays online <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>



<li><strong>Better Performance</strong>: I mean, you can&#8217;t beat physics; simply having the possibility to do compute closer to the user improves performance and user experience.</li>
</ol>



<h3 class="wp-block-heading">Step-by-Step Deployment Guide</h3>



<p>Ok, let&#8217;s get into the meaty part; codebase from our previous post hasn&#8217;t changed significantly; only thing which we changed is that we&#8217;re not hardcoding out region anymore, but we are fetching the list of available regions from Linode API and deploying an instance in each region. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>In the code which fetches the regions, you will notice that I commented out the authentication part. </p>



<p>Some regions are available only to authenticated users; if you&#8217;re one of those, just uncomment those few lines and the full region list will be returned to you. </p>
</blockquote>



<p>Let&#8217;s start with terraform plan and see what we will create. </p>



<pre class="wp-block-code"><code>terraform plan</code></pre>



<figure class="wp-block-image size-full"><img decoding="async" width="942" height="690" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/1.png" alt="" class="wp-image-449" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/1.png 942w, https://blog.slepcevic.net/wp-content/uploads/2024/06/1-300x220.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/1-768x563.png 768w" sizes="(max-width: 942px) 100vw, 942px" /></figure>



<p>Ok, 25 instances, just what we expect since Akamai has 25 compute regions currently publicly available. </p>



<p>Let&#8217;s proceed with terraform apply </p>



<pre class="wp-block-code"><code>terraform apply</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="690" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/2-1024x690.png" alt="" class="wp-image-450" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/2-1024x690.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/2-300x202.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/2-768x518.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/2.png 1300w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>I don&#8217;t know about you, but I always nerd out on seeing a bunch of servers popping up in the console <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
</blockquote>



<p>In a minute or two we should have all instances deployed. After the instances have been deployed, <strong>cloud-init</strong> will kick off and install DeepSparse server with an Nginx proxy in front (check out the previous post or the YAML file in the repo for more details).</p>



<p><strong>Awesome</strong>! After we&#8217;ve got the infrastructure up and running, last step is to add our nodes to the Cloud load balancer pool; at the moment we will need to do some Clickops <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /> CLB service is currently in beta so IaC support isn&#8217;t out yet. </p>



<p>First step is creating a Cloud Load Balancer by clicking the &#8220;<strong>Create Cloud Load Balancer</strong>&#8221; button and giving it a name.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="410" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/4-1024x410.png" alt="" class="wp-image-452" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/4-1024x410.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/4-300x120.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/4-768x307.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/4.png 1322w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>During the beta period, Cloud Load Balancer is deployed only in 5 locations. This number will grow drastically once the service goes GA. </p>
</blockquote>



<p>With Akamai&#8217;s Cloud Load Balancer, everything starts with a &#8220;<strong>Configuration</strong>&#8220;. Let&#8217;s create one by pressing &#8220;<strong>Add Configuration</strong>&#8221; button. </p>



<p>We will configure our load balancer to &#8220;listen&#8221; on both HTTP and HTTPS. Once we selected HTTPS as our protocol, we need to add a certificate. </p>



<p>In order to do that, we need to prepare our <strong>certificate</strong> and <strong>private key</strong> which we will paste into the configuration field.<em> In this case I will use a self-signed certificate. </em></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1298" height="578" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/6-1024x456.png" alt="" class="wp-image-453" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/6-1024x456.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/6-300x134.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/6-768x342.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/6.png 1298w" sizes="auto, (max-width: 1298px) 100vw, 1298px" /></figure>



<p>At this stage we will only cover the configuration for the HTTPS protocol, HTTP is really easy and won&#8217;t bother wasting your time on it. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="485" height="886" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/7.png" alt="" class="wp-image-454" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/7.png 485w, https://blog.slepcevic.net/wp-content/uploads/2024/06/7-164x300.png 164w" sizes="auto, (max-width: 485px) 100vw, 485px" /></figure>
</div>


<p>We need to paste in the certificate &amp; the key, enter the SNI hostname and press &#8220;<strong>Create and Add</strong>&#8221; button. </p>



<p>After we&#8217;ve got the configuration and the certificate added, we need to create a &#8220;<strong>Route</strong>&#8220;. Let&#8217;s click on  &#8220;<strong>Create a New HTTP Route</strong>&#8221; button and give it a name. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="485" height="483" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/9.png" alt="" class="wp-image-455" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/9.png 485w, https://blog.slepcevic.net/wp-content/uploads/2024/06/9-300x300.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/9-150x150.png 150w" sizes="auto, (max-width: 485px) 100vw, 485px" /></figure>
</div>


<p>Great, we&#8217;ve created a route, but the route is currently empty and it doesn&#8217;t route anything. We will come back to this a bit later. </p>



<p>Next step is to save our configuration and click on &#8220;<strong>Service Targets</strong>&#8221; tab. </p>



<p>This is the place where we will define our target groups and origin servers. Click on &#8220;<strong>New Service Target</strong>&#8221; button</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="349" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/10-1024x349.png" alt="" class="wp-image-456" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/10-1024x349.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/10-300x102.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/10-768x262.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/10.png 1301w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Next steps are quite explanatory, we need to give it a name and add the nodes which we want to load balance across. </p>



<p><strong>Remember, this can be one of the existing Linode instance or it can be ANY IP address which can be reached via the internet. </strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="440" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/11-1024x440.png" alt="" class="wp-image-457" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/11-1024x440.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/11-300x129.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/11-768x330.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/11-1536x660.png 1536w, https://blog.slepcevic.net/wp-content/uploads/2024/06/11.png 1801w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>This is the step where I could really use IaC support, we need to add all 25 servers by using ClickOps to our &#8220;<strong>Endpoints</strong>&#8221; list.  <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>This is also the place where you can also select the <strong>load balancing algorithm</strong> which will be used to balance requests between the nodes. At the moment there are 5 of them available:</p>



<ul class="wp-block-list">
<li><strong>Round Robin</strong></li>



<li><strong>Least Request</strong></li>



<li><strong>Ring Hash</strong></li>



<li><strong>Random</strong></li>



<li><strong>Maglev</strong></li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="547" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/15-1024x547.png" alt="" class="wp-image-460" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/15-1024x547.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/15-300x160.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/15-768x410.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/15-1536x821.png 1536w, https://blog.slepcevic.net/wp-content/uploads/2024/06/15.png 1783w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Last step in &#8220;<strong>Service Target</strong>&#8221; configuration is to set the path and host header we will use for the health checks on the nodes and click on &#8220;<strong>Save Service Target</strong>&#8221; button. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="508" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/12-1024x508.png" alt="" class="wp-image-458" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/12-1024x508.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/12-300x149.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/12-768x381.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/12-1536x762.png 1536w, https://blog.slepcevic.net/wp-content/uploads/2024/06/12.png 1807w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>We&#8217;re almost there, I promise <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </strong></p>



<p>Final step is to go back to the &#8220;<strong>Routes</strong>&#8221; tab, click on the route which we&#8217;ve created earlier and click on Edit button.</p>



<p>In the rule configuration we will enter the hostname which we want to match upon and select our &#8220;<strong>Service target</strong>&#8221; from the dropdown. </p>



<p>We can also do advanced request matching based on <strong>path, header, method, regex or query string</strong> but for now we will use path prefix. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="535" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/13-1-1024x535.png" alt="" class="wp-image-461" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/13-1-1024x535.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/13-1-300x157.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/13-1-768x401.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/13-1-1536x803.png 1536w, https://blog.slepcevic.net/wp-content/uploads/2024/06/13-1.png 1814w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Ok, we have configured our Cloud Load balancer; final step to get our application running is to create a CNAME record for my subdomain &#8220;<strong>clbtest.slepcevic.net</strong>&#8221; and point it to &#8220;<strong>MDEE053110.mesh.akadns.net</strong>&#8221; (<em>visible in the Summary page of the load balancer</em>). </p>



<p>Let&#8217;s go ahead and visit our website. We see that our DeepSparse API server is happily responding and ready to receive requests! Woohoo!</p>



<p><strong>Yes, it&#8217;s that easy. </strong>In less than 10 minutes we have deployed a globally distributed application on Akamai Connected Cloud. Once IaC support for Cloud Load Balancer is rolled out, we can bring this time down to 5 minutes without any problems. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="649" src="https://blog.slepcevic.net/wp-content/uploads/2024/06/16-1024x649.png" alt="" class="wp-image-462" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/16-1024x649.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/06/16-300x190.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/16-768x487.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/06/16.png 1264w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Ok, 25 regions is cool, but that isn&#8217;t truly global is it? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></h2>



<p>Yes, you&#8217;re right; with 25 regions we have covered the large majority of the global (internet) population. Can we do better? For sure! Welcome Gecko!</p>



<h3 class="wp-block-heading">Gecko?</h3>



<p>Akamai’s new initiative, code-named Gecko, is set to revolutionize cloud computing by integrating cloud capabilities directly into Akamai&#8217;s extensive edge network. This move aligns perfectly with Akamai’s strategy to provide high-performance, low-latency, and globally scalable solutions. By embedding compute capabilities at or VERY near the edge, Gecko aims to deliver workloads closer to users, devices, and data sources than ever before.</p>



<h3 class="wp-block-heading">What Does Gecko Mean for Our Deployment in the future?</h3>



<p>Gecko&#8217;s will enable us to deploy our sentiment analysis application in hundreds of new locations worldwide, <strong>including traditionally hard-to-reach areas</strong>. This means extremely reduced latency, improved performance, and enhanced availability for users across the world. </p>



<h3 class="wp-block-heading">The Benefits of Deploying on Gecko</h3>



<ol class="wp-block-list">
<li><strong>Ultra-Low Latency</strong>: By running our workloads even closer to end-users, we can drastically reduce the time it takes to process and respond to requests.</li>



<li><strong>Global Reach</strong>: With Gecko, we can deploy in cities and regions where traditional cloud providers struggle to reach, ensuring a truly global presence. </li>



<li><strong>Scalability and Flexibility</strong>: With Akamai&#8217;s large compute footprint, we can scale out our application to tens of thousands of nodes across hundreds of locations. </li>



<li><strong>Consistent Experience</strong>: Let&#8217;s be real, if you&#8217;re running a global application, you&#8217;re most probably dealing with multiple providers; with Gecko we can consolidate all of your workloads and location coverage with a single provider. Just the operational benefits of that should be enough to &#8220;tickle&#8221; your brain into considering it for your application. </li>
</ol>



<h2 class="wp-block-heading">Want to try it yourself?</h2>



<p>Have fun <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Go ahead and clone the repo from <a href="https://github.com/slepix/neuralmagic-globalLinode" target="_blank" rel="noopener" title="">https://github.com/slepix/neuralmagic-globalLinode</a> and sign up to receive beta access to the new Cloud Load balancer on <a href="https://www.linode.com/green-light/" target="_blank" rel="noopener" title="">https://www.linode.com/green-light/</a> .  </p>



<p>NeuralMagic running across all Linode (including Gecko) regions in the next post? Perhaps <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>Cheers! Alex</p><p>The post <a href="https://blog.slepcevic.net/deploying-a-global-sentiment-analysis-service-using-deepsparse-and-akamai-connected-cloud/">Deploying a GLOBAL sentiment Analysis service using DeepSparse and Akamai Connected Cloud</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/deploying-a-global-sentiment-analysis-service-using-deepsparse-and-akamai-connected-cloud/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Easy way to deploy Linode instances across all (core) regions using Terraform</title>
		<link>https://blog.slepcevic.net/easy-way-to-deploy-linode-instances-across-all-core-regions-using-terraform/</link>
					<comments>https://blog.slepcevic.net/easy-way-to-deploy-linode-instances-across-all-core-regions-using-terraform/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Mon, 03 Jun 2024 22:57:35 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode regions]]></category>
		<guid isPermaLink="false">https://blog.slepcevic.net/?p=426</guid>

					<description><![CDATA[<p>In preparations for a upcoming blog post related to running AI workloads on Akamai Connected Cloud, I needed to deploy instances in all available Linode regions. Since there&#8217;s no way that I&#8217;ll manually create a list of regions, I thought...</p>
<p>The post <a href="https://blog.slepcevic.net/easy-way-to-deploy-linode-instances-across-all-core-regions-using-terraform/">Easy way to deploy Linode instances across all (core) regions using Terraform</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>In preparations for a upcoming blog post related to running AI workloads on Akamai Connected Cloud, I needed to deploy instances in all available Linode regions. Since there&#8217;s no way that I&#8217;ll manually create a list of regions, I thought it would be cool to use Terraforms HTTP provider to dynamically fetch the list of regions and deploy an instance to it. </p>



<p></p>



<h3 class="wp-block-heading">What’s the Plan?</h3>



<p></p>



<ol class="wp-block-list">
<li><strong>Fetch the list of regions</strong>: Use Terraform&#8217;s HTTP provider to retrieve the list of Linode regions via the Linode API.</li>



<li><strong>Deploy Instances</strong>: Use Terraform’s Linode provider to deploy instances in each of these regions.</li>



<li><strong>Grab some coffee</strong>: Sit back and relax while Terraform does the heavy lifting.</li>
</ol>



<h3 class="wp-block-heading">Pre-requisites</h3>



<p>Before we begin, make sure you have:</p>



<ul class="wp-block-list">
<li>A Linode account (If not, sign up <a href="https://www.linode.com/" target="_blank" rel="noopener" title="">here</a>).</li>



<li>A Linode API token (Grab it from your <a href="https://cloud.linode.com/profile/tokens" target="_blank" rel="noopener" title="">Linode dashboard</a>).</li>



<li>Terraform installed on your machine (Download it from <a href="https://developer.hashicorp.com/terraform/install" target="_blank" rel="noopener" title="">here</a>).</li>
</ul>



<h3 class="wp-block-heading">Step-by-Step Guide</h3>



<h4 class="wp-block-heading">Step 1: Define Providers and Variables</h4>



<p>We’ll start by defining our providers and variables. The HTTP provider will fetch the regions, and the Linode provider will deploy our instances.</p>



<p></p>



<pre class="wp-block-code"><code>provider "http" {}

variable "token" {
type = string
default = "mytoken" # Replace with your actual Linode API token
}</code></pre>



<h4 class="wp-block-heading">Step 2: Fetch Regions from Linode API.</h4>



<p>Next, let’s fetch the list of regions using the HTTP provider. We’ll decode the JSON response to extract the region IDs. </p>



<p><strong>Please note that if you uncomment the &#8220;request_headers&#8221; part, you will get a list of regions only available to your user/account. </strong> By default you will get a list of all public regions. </p>



<pre class="wp-block-code"><code>data "http" "regions" {
  url = "https://api.linode.com/v4/regions"

#   request_headers = {
#     Authorization = "Bearer ${var.token}"
#   }
}

locals {
  regions = &#91;for region in jsondecode(data.http.regions.response_body).data : region.id]
}</code></pre>



<h4 class="wp-block-heading">Step 3: Deploy Linode Instances</h4>



<p>Now comes the fun part! We’ll utilize Terraform’s &#8220;<code>for_each"</code> feature to loop through the regions and deploy a virtual machine. </p>



<pre class="wp-block-code"><code><code>provider "linode" {
  token = var.token
}

resource "linode_instance" "instances" {
  for_each = toset(local.regions)

  label    = "linode-${each.key}"
  region   = each.key
  type     = "g6-standard-1"  # Example Linode type, adjust as needed
  image    = "linode/ubuntu20.04"  # Example image, adjust as needed
  root_pass = "your_secure_password"  # Replace with a secure password
  authorized_keys = &#91;file("~/.ssh/id_rsa.pub")]  # Adjust path to your public key
}<span style="background-color: initial; font-family: inherit; font-size: inherit; color: initial;"></span></code></code></pre>



<h4 class="wp-block-heading">Step 4: Outputs</h4>



<p>Finally, let’s define some outputs to see the regions and instances we’ve created.</p>



<pre class="wp-block-code"><code><code>output "regions" {
  value = local.regions
}

output "instances" {
  value = { for instance in linode_instance.instances : instance.id => instance }
}
</code></code></pre>



<h3 class="wp-block-heading">Wrapping Up</h3>



<p>And there you have it! With just a few lines of code, we’ve automated the deployment of Linode instances across all regions. Terraform takes care of the heavy lifting, allowing you to focus on what matters most – enjoying a cup of coffee while your infrastructure magically sets itself up :D+</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="974" height="441" src="http://blog.slepcevic.net/wp-content/uploads/2024/06/Screenshot-2024-06-04-004302.png" alt="" class="wp-image-434" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/06/Screenshot-2024-06-04-004302.png 974w, https://blog.slepcevic.net/wp-content/uploads/2024/06/Screenshot-2024-06-04-004302-300x136.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/06/Screenshot-2024-06-04-004302-768x348.png 768w" sizes="auto, (max-width: 974px) 100vw, 974px" /></figure>



<p>Until next time, Alex!</p><p>The post <a href="https://blog.slepcevic.net/easy-way-to-deploy-linode-instances-across-all-core-regions-using-terraform/">Easy way to deploy Linode instances across all (core) regions using Terraform</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/easy-way-to-deploy-linode-instances-across-all-core-regions-using-terraform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Assigning a firewall to Linode NodeBalancer using Terraform and Cloud Manager.</title>
		<link>https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/</link>
					<comments>https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Tue, 19 Dec 2023 11:25:08 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[Nodebalancer]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=220</guid>

					<description><![CDATA[<p>Linode has finally rolled out support to assign a firewall device to a NodeBalancer (Linode&#8217;s managed load balancing service)! Assigning a firewall via CloudManager is quite easy and self-explanatory. Create a firewall, add the rules you need and simply select...</p>
<p>The post <a href="https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/">Assigning a firewall to Linode NodeBalancer using Terraform and Cloud Manager.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.linode.com">Linode</a> has<strong> finally rolled out support to assign a firewall device to a NodeBalancer</strong> (Linode&#8217;s managed load balancing service)!</p>



<p>Assigning a firewall via CloudManager is quite easy and self-explanatory. Create a firewall, add the rules you need and simply select that firewall when you create a load balancer. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="522" src="https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-1024x522.png" alt="" class="wp-image-221" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-1024x522.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-300x153.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-768x391.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1.png 1064w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>More fun part is to use IaC, mainly Terraform. </p>



<p>Example code which will create a NodeBalancer,  Firewall device and assign it to a load balancer. </p>



<p>NodeBalancer Terraform code: </p>



<pre class="wp-block-code"><code>resource "linode_nodebalancer" "primaryregion-lb" {
    label = "nodebalancer-web-${var.primary_region}"
    region = var.primary_region
    client_conn_throttle = 0
}

resource "linode_nodebalancer_config" "primaryregion-lb-config" {
    nodebalancer_id = linode_nodebalancer.primaryregion-lb.id
    port = 80
    protocol = "http"
    check = "http"
    check_path = "/"
    check_attempts = 3
    check_timeout = 30
    stickiness = "none"
    algorithm = "leastconn"
}

resource "linode_nodebalancer_node" "primary" {
    count = "2"
    nodebalancer_id = linode_nodebalancer.primaryregion-lb.id
    config_id = linode_nodebalancer_config.primaryregion-lb-config.id
    address = "${element(linode_instance.web-primary.*.private_ip_address, count.index)}:80"
    label = "nodebalancer-web-${var.primary_region}"
    weight = 50
}</code></pre>



<p>Terraform code to create a Firewall and assign it to the said load balancer.</p>



<pre class="wp-block-code"><code>
resource "linode_firewall" "lb-fw" {
  label = "lb-pub"

  inbound {
    label    = "allow-http"
    action   = "ACCEPT"
    protocol = "TCP"
    ports    = "80"
    ipv4     = &#091;"0.0.0.0/0"]
    ipv6     = &#091;"::/0"]
  }

  inbound {
    label    = "allow-https"
    action   = "ACCEPT"
    protocol = "TCP"
    ports    = "443"
    ipv4     = &#091;"0.0.0.0/0"]
    ipv6     = &#091;"::/0"]
  }

  inbound_policy = "DROP"

  outbound_policy = "ACCEPT"

  nodebalancers = &#091;linode_nodebalancer.primaryregion-lb.id]
}</code></pre>



<p>If you&#8217;ve ever used Terraform and Linode, you will notice it&#8217;s exactly the same approach we do when we want to assign a firewall device to a Linode (virtual machine); only difference is that we reference the &#8220;nodebalancer&#8221; instead of &#8220;linodes&#8221;. </p>



<p></p>



<p>Cheers, </p>



<p>Alex. </p><p>The post <a href="https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/">Assigning a firewall to Linode NodeBalancer using Terraform and Cloud Manager.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix Linode Windows VM IP configuration using Windows SAC console and Lish.</title>
		<link>https://blog.slepcevic.net/fix-linode-windows-vm-ip-configuration-using-windows-sac-console-and-lish/</link>
					<comments>https://blog.slepcevic.net/fix-linode-windows-vm-ip-configuration-using-windows-sac-console-and-lish/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Wed, 25 Oct 2023 21:44:43 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[windows linode]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=196</guid>

					<description><![CDATA[<p>Today I decided to migrate my Windows VM running on Linode from Paris region to Amsterdam region. After kicking off the migration through the Cloud Manager (which took &#60;15 minutes), my instance wasn&#8217;t responding to any network requests. Problem was...</p>
<p>The post <a href="https://blog.slepcevic.net/fix-linode-windows-vm-ip-configuration-using-windows-sac-console-and-lish/">Fix Linode Windows VM IP configuration using Windows SAC console and Lish.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Today I decided to migrate my Windows VM running on Linode from Paris region to <a href="https://www.linode.com/blog/linode/european-region-expansion-live-in-amsterdam/">Amsterdam </a>region. </p>



<p>After <a href="https://www.linode.com/docs/products/compute/compute-instances/guides/migrate-to-different-dc/">kicking off the migration</a> through the Cloud Manager (which took &lt;15 minutes), my instance wasn&#8217;t responding to any network requests. Problem was completely cause by me, by configuring a static IP on the VM. After the VM got migrated to Amsterdam DC, it got a new IP which wasn&#8217;t configured on the interface. </p>



<p>The <strong>Lish Console</strong>, also called the <strong>Linode Shell</strong>, provides direct console access to all of your Compute Instances. Through Lish, you can easily access your Compute Instance’s internal Linux system and run commands, install software, or configure applications. Lish is especially useful when you are not able to connect to your server through other means, such as SSH or the entire network stack is down. </p>



<p>Alongside <strong>Lish</strong>, there&#8217;s also a tool called <strong>Glish</strong>, which stands for &#8220;<strong>Graphical Linode Shell</strong>&#8220;, which you guessed it, has the ability to display your desktop environment, including Windows. </p>



<p>Problem comes when we run an <a href="https://github.com/kitknox/winode">UNSUPPORTED deployment of Windows OS</a> on Linode and want to send  &#8220;CTRL + ALT + DEL&#8221; command to the OS. Glish doesn&#8217;t have that ability built-in. </p>



<p></p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="802" data-id="197" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/glish-1024x802.png" alt="" class="wp-image-197" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/glish-1024x802.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/glish-300x235.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/glish-768x601.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/glish.png 1077w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<p></p>



<p>When I say unsupported I mean that <strong>Windows OS works on Linode</strong> (quite good!), <strong>but there&#8217;s no official support from Linode</strong> when it comes to debugging your system.</p>



<p>If the VM starts up (aka, passes the &#8220;BIOS&#8221; stage and has a boot attempt) Linode&#8217;s work here is done and support won&#8217;t be able to provide any help with debugging your instance in case it doesn&#8217;t work properly. With that out of the way, let&#8217;s check out what options we have to fix the IP address of the interface. </p>



<ol class="wp-block-list">
<li>Extract a valid GLISH session ID and use <a href="https://novnc.com/info.html">noVNC</a> to connect over a WebSocket (more complex)</li>



<li>Use Windows SAC console which is available via Lish to configure the IP on your network adapter (less complex)</li>
</ol>



<p>We&#8217;ll go with option 2 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Go to <strong><a href="https://cloud.linode.com/">Linode Cloud Manager</a></strong>, click on your VM and launch <strong>Lish Console</strong>. </p>



<p>You will be presented with a screen like this: </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="679" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac-1-1024x679.png" alt="" class="wp-image-205" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac-1-1024x679.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac-1-300x199.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac-1-768x510.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac-1.png 1064w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>What we see here is <strong>Special Admin Console (SAC)</strong> capability built into Windows. </p>



<p>Type in &#8220;<strong>cmd</strong>&#8221; and press Enter. You will get an output saying that a new &#8220;channel&#8221; was created. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="701" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac2-1024x701.png" alt="" class="wp-image-199" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac2-1024x701.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac2-300x205.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac2-768x526.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac2.png 1066w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>After the channel has been created, we need to switch to it. </p>



<p><strong>We can do that by pressing ESC and then TAB</strong>. This will switch us to the new channel and prompt us to authenticate to the server. If you ever used <a href="https://www.linode.com/docs/guides/using-gnu-screen-to-manage-persistent-terminal-sessions/">screen </a>in Linux, this concept will be familiar to you <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="704" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/Screenshot-2023-10-25-231227-1024x704.png" alt="" class="wp-image-200" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/Screenshot-2023-10-25-231227-1024x704.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/Screenshot-2023-10-25-231227-300x206.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/Screenshot-2023-10-25-231227-768x528.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/Screenshot-2023-10-25-231227.png 1064w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>After logging in, you&#8217;ll be presented with a familiar looking command prompt screen. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="704" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac5-1024x704.png" alt="" class="wp-image-202" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac5-1024x704.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac5-300x206.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac5-768x528.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac5.png 1064w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<p>From here you can launch <strong>Powershell </strong>to do more complex stuff, but now we will just configure the new network settings by using the classic <strong>netsh </strong>command. Make sure to replace the IP address and the subnet to match your VM. You can see those settings in Cloud Manager by clicking on your VM and then on the <strong>Network </strong>tab</p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="565" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/networkconfig-1024x565.png" alt="" class="wp-image-206" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/networkconfig-1024x565.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/networkconfig-300x165.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/networkconfig-768x423.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/networkconfig.png 1277w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<pre class="wp-block-code"><code>#Example
netsh interface ip set address "Ethernet" static YourNewIP Mask Gateway

#Example
netsh interface ip set address "Ethernet" static 172.233.47.111 255.255.255.0 172.233.47.1

</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="703" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac6-1024x703.png" alt="" class="wp-image-203" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/sac6-1024x703.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac6-300x206.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac6-768x527.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/sac6.png 1061w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>In case you have multiple network interfaces attached to your VM, make sure to replace &#8220;Ethernet&#8221; with the name of your adapter. </p>



<p></p>



<p>Cheers, Alex. </p><p>The post <a href="https://blog.slepcevic.net/fix-linode-windows-vm-ip-configuration-using-windows-sac-console-and-lish/">Fix Linode Windows VM IP configuration using Windows SAC console and Lish.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/fix-linode-windows-vm-ip-configuration-using-windows-sac-console-and-lish/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>From zero to WordPress in less than 2 minutes on Linode using cloud-init and/or Terraform</title>
		<link>https://blog.slepcevic.net/from-zero-to-wordpress-in-less-than-2-minutes-using-linode-and-cloud-init-and-or-terraform/</link>
					<comments>https://blog.slepcevic.net/from-zero-to-wordpress-in-less-than-2-minutes-using-linode-and-cloud-init-and-or-terraform/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Fri, 20 Oct 2023 11:53:34 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[cloud-init]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=185</guid>

					<description><![CDATA[<p>Yeah, it&#8217;s true. You can get a fully running VM with installed MySQL, Apache, PHP and WordPress configured in less than 2 minutes! 1:58 to be exact 🙂 Ok, what is cloud-init in the first place? Cloud-init is a widely...</p>
<p>The post <a href="https://blog.slepcevic.net/from-zero-to-wordpress-in-less-than-2-minutes-using-linode-and-cloud-init-and-or-terraform/">From zero to WordPress in less than 2 minutes on Linode using cloud-init and/or Terraform</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Yeah, it&#8217;s true. You can get a fully running VM with installed MySQL, Apache, PHP and WordPress configured in less than 2 minutes! <strong>1:58 to be exact <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong></p>



<p><strong>Ok, what is cloud-init in the first place?</strong></p>



<p>Cloud-init is a widely used open-source package for initializing and configuring cloud instances (virtual machines or instances) in cloud computing environments. It is commonly used in infrastructure as a service (IaaS) and cloud platforms such as Akamai Connected Cloud, Amazon Web Services (AWS), Google Cloud Platform (GCP), Microsoft Azure, and various other cloud providers.</p>



<p>Cloud-init allows you to define and execute custom scripts and configuration at instance launch time or when an instance boots. It is typically provided with the cloud <a href="https://blog.slepcevic.net/linode-metadata-service/">instance&#8217;s metadata</a> during its provisioning. This metadata can include user data, which consists of cloud-init configuration in the form of a script or YAML file.</p>



<p>Key features and use cases of cloud-init include:</p>



<p><strong>Operating System Configuration</strong>: You can use cloud-init to perform various tasks like setting the hostname, configuring network interfaces, setting up users, and more.</p>



<p><strong>Package Installation</strong>: Cloud-init can be used to install software packages, libraries, or applications on the newly provisioned instance.</p>



<p><strong>User Data</strong>: You can pass user-specific data to the instance, which can be used to customize the instance&#8217;s behavior at boot time. For example, you can use it to configure software, install additional packages, or run scripts.</p>



<p><strong>Security</strong>: You can use cloud-init to set up SSH keys for secure access, set firewall rules, or perform other security-related tasks.</p>



<p><strong>Customization</strong>: Cloud-init allows you to define instance-specific customizations, making it easier to automate the setup and configuration of instances.</p>



<p><strong>Cloud Provider Agnostic</strong>: While commonly used in various cloud providers, cloud-init is not tied to a specific cloud platform. It&#8217;s available and can be used in many different environments.</p>



<p><strong>Flexibility</strong>: You can provide cloud-init configuration as a script or a YAML file, giving you flexibility in how you define the initialization and configuration process.</p>



<p></p>



<p>Ok, but how do I use it? It&#8217;s quite simple actually. </p>



<p>In this example, we install 5 packages and run a few commands to download WordPress, create a DB user, prepare wp-config file and so on. </p>



<p><strong>Please make sure to use a better password and/or a better way to deliver the credentials to the VM. Password in <em>plain </em>text is just for demo purposes and it&#8217;s just <em>plain</em> wrong (ha ha, get it! :D)!</strong></p>



<p>Log into your Linode Cloud manager interface and click on &#8220;<strong>Create Linode</strong>&#8221; button. </p>



<p><strong><em>Make sure to select a distribution which support cloud-init!</em></strong> <strong>Those are indicated by a &#8220;file&#8221; icon next to the distro name. </strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="727" height="428" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/cloudinit.png" alt="" class="wp-image-186" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/cloudinit.png 727w, https://blog.slepcevic.net/wp-content/uploads/2023/10/cloudinit-300x177.png 300w" sizes="auto, (max-width: 727px) 100vw, 727px" /></figure>



<p>Next step (beside selecting the region, instance type, key and password), is to expand the &#8220;User Data&#8221; section and paste in the following code and press &#8220;Deploy&#8221;. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="262" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/userdata-2-1024x262.png" alt="" class="wp-image-189" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/userdata-2-1024x262.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/userdata-2-300x77.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/userdata-2-768x196.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/userdata-2-1280x328.png 1280w, https://blog.slepcevic.net/wp-content/uploads/2023/10/userdata-2.png 1283w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<pre class="wp-block-code"><code>#cloud-config
packages:
  - apache2
  - mysql-server
  - php8.1
  - libapache2-mod-php8.1
  - php8.1-mysql
runcmd:
  - mkdir -p /var/www/html  # Create the /var/www/html directory if it doesn't exist
  - rm -f /var/www/html/index.html  # Remove the default index.html file
  - &#091;wget, https://wordpress.org/latest.tar.gz, -O, /tmp/wordpress.tar.gz]
  - &#091;tar, -xvzf, /tmp/wordpress.tar.gz, -C, /var/www/html]
  - mv /var/www/html/wordpress/* /var/www/html/  # Move WordPress files to the root of the web directory
  - &#091;chown, -R, www-data:www-data, /var/www/html]
  - |
    mysql -u root -e "CREATE DATABASE wordpress;"
    mysql -u root -e "CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'ComplexPassword123#';"
    mysql -u root -e "GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';"
    mysql -u root -e "FLUSH PRIVILEGES;"
  - cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
  - sed -i 's/database_name_here/wordpress/g' /var/www/html/wp-config.php
  - sed -i 's/username_here/wordpressuser/g' /var/www/html/wp-config.php
  - sed -i 's/password_here/ComplexPassword123#/g' /var/www/html/wp-config.php
  - a2enmod php8.1  # Enable PHP module
  - systemctl restart apache2  # Restart Apache to apply the changes
</code></pre>



<p>Open your browser and navigate to the IP address of the server and less than 2 minutes after you should be greeted with a WordPress &#8220;Finish setup&#8221; page where you need to specify your email, username and password. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="825" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/wordpress-1024x825.png" alt="" class="wp-image-190" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/wordpress-1024x825.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/10/wordpress-300x242.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/10/wordpress-768x619.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/10/wordpress.png 1030w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<p>You can accomplish the same thing via Terraform by using the &#8220;<strong>metadata</strong>&#8221; block and <strong>encoding your cloud-init script in base64</strong>.</p>



<pre class="wp-block-code"><code>
resource "linode_instance" "wordpressviacloudinit" {
  label = "Wordpress-via-cloudinit"
  image = "linode/ubuntu22.04"
  region = "us-iad"
  type = "g6-standard-1"
  authorized_keys = &#091;"ssh-rsa AAAA...Gw== user@example.local"]
  root_pass = "terr4form-test"
  <strong>metadata </strong>{<strong>
    user_data </strong>= "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIGFwYWNoZTIKICAtIG15c3FsLXNlcnZlcgogIC0gcGhwOC4xCiAgLSBsaWJhcGFjaGUyLW1vZC1waHA4LjEKICAtIHBocDguMS1teXNxbApydW5jbWQ6CiAgLSBta2RpciAtcCAvdmFyL3d3dy9odG1sICAjIENyZWF0ZSB0aGUgL3Zhci93d3cvaHRtbCBkaXJlY3RvcnkgaWYgaXQgZG9lc24ndCBleGlzdAogIC0gcm0gLWYgL3Zhci93d3cvaHRtbC9pbmRleC5odG1sICAjIFJlbW92ZSB0aGUgZGVmYXVsdCBpbmRleC5odG1sIGZpbGUKICAtIFt3Z2V0LCBodHRwczovL3dvcmRwcmVzcy5vcmcvbGF0ZXN0LnRhci5neiwgLU8sIC90bXAvd29yZHByZXNzLnRhci5nel0KICAtIFt0YXIsIC14dnpmLCAvdG1wL3dvcmRwcmVzcy50YXIuZ3osIC1DLCAvdmFyL3d3dy9odG1sXQogIC0gbXYgL3Zhci93d3cvaHRtbC93b3JkcHJlc3MvKiAvdmFyL3d3dy9odG1sLyAgIyBNb3ZlIFdvcmRQcmVzcyBmaWxlcyB0byB0aGUgcm9vdCBvZiB0aGUgd2ViIGRpcmVjdG9yeQogIC0gW2Nob3duLCAtUiwgd3d3LWRhdGE6d3d3LWRhdGEsIC92YXIvd3d3L2h0bWxdCiAgLSB8CiAgICBteXNxbCAtdSByb290IC1lICJDUkVBVEUgREFUQUJBU0Ugd29yZHByZXNzOyIKICAgIG15c3FsIC11IHJvb3QgLWUgIkNSRUFURSBVU0VSICd3b3JkcHJlc3N1c2VyJ0AnbG9jYWxob3N0JyBJREVOVElGSUVEIEJZICdDb21wbGV4UGFzc3dvcmQxMjMjJzsiCiAgICBteXNxbCAtdSByb290IC1lICJHUkFOVCBBTEwgUFJJVklMRUdFUyBPTiB3b3JkcHJlc3MuKiBUTyAnd29yZHByZXNzdXNlcidAJ2xvY2FsaG9zdCc7IgogICAgbXlzcWwgLXUgcm9vdCAtZSAiRkxVU0ggUFJJVklMRUdFUzsiCiAgLSBjcCAvdmFyL3d3dy9odG1sL3dwLWNvbmZpZy1zYW1wbGUucGhwIC92YXIvd3d3L2h0bWwvd3AtY29uZmlnLnBocAogIC0gc2VkIC1pICdzL2RhdGFiYXNlX25hbWVfaGVyZS93b3JkcHJlc3MvZycgL3Zhci93d3cvaHRtbC93cC1jb25maWcucGhwCiAgLSBzZWQgLWkgJ3MvdXNlcm5hbWVfaGVyZS93b3JkcHJlc3N1c2VyL2cnIC92YXIvd3d3L2h0bWwvd3AtY29uZmlnLnBocAogIC0gc2VkIC1pICdzL3Bhc3N3b3JkX2hlcmUvQ29tcGxleFBhc3N3b3JkMTIzIy9nJyAvdmFyL3d3dy9odG1sL3dwLWNvbmZpZy5waHAKICAtIGEyZW5tb2QgcGhwOC4xICAjIEVuYWJsZSBQSFAgbW9kdWxlCiAgLSBzeXN0ZW1jdGwgcmVzdGFydCBhcGFjaGUyICAjIFJlc3RhcnQgQXBhY2hlIHRvIGFwcGx5IHRoZSBjaGFuZ2VzCg=="
  }
  group = "foo"
  tags = &#091; "foo" ]
  swap_size = 512
  private_ip = false
}</code></pre>



<p>Of course, you can use cloud-init for pretty much anything you want but the ideal usecase would be bootstrapping your instance so your configuration management tool can take over after Terraform creates it. </p>



<p>Until next time!</p>



<p>Cheers, Alex. </p><p>The post <a href="https://blog.slepcevic.net/from-zero-to-wordpress-in-less-than-2-minutes-using-linode-and-cloud-init-and-or-terraform/">From zero to WordPress in less than 2 minutes on Linode using cloud-init and/or Terraform</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/from-zero-to-wordpress-in-less-than-2-minutes-using-linode-and-cloud-init-and-or-terraform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to deploy a DHCP server in a Linode VLAN</title>
		<link>https://blog.slepcevic.net/how-to-deploy-a-dhcp-server-in-a-linode-vlan/</link>
					<comments>https://blog.slepcevic.net/how-to-deploy-a-dhcp-server-in-a-linode-vlan/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Fri, 08 Sep 2023 09:43:00 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[Terraform]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=171</guid>

					<description><![CDATA[<p>When a VLAN is assigned to a network interface and given an IPAM address, the Compute Instance should automatically be able to communicate over that private network. This is due to Network Helper, which is enabled by default on most instances....</p>
<p>The post <a href="https://blog.slepcevic.net/how-to-deploy-a-dhcp-server-in-a-linode-vlan/">How to deploy a DHCP server in a Linode VLAN</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>When a VLAN is assigned to a network interface and given an IPAM address, the Compute Instance should automatically be able to communicate over that private network. This is due to <a href="https://www.linode.com/docs/products/compute/compute-instances/guides/network-helper/">Network Helper</a>, which is enabled by default on most instances. For compatible distributions, Network Helper adjusts the internal network configuration files. Any network interfaces defined in the Compute Instance’s selected <a href="https://www.linode.com/docs/products/compute/compute-instances/guides/configuration-profiles/">Configuration Profile</a> (including those with VLANs attached) are automatically configured.</p>



<p>While Network Helper is really useful, it&#8217;s becomes a problem when you deploy an instance serving as an internet gateway in your VLAN. In order to assign an IP address, DNS and a gateway, we need to deploy a DHCP server. Network Helper cannot set DNS and gateway settings. </p>



<p></p>



<p>Please have in mind that you can also install the DHCP server on your IGW (Internet gateway) instance as well, but for the purposes of this post, we will assume that we have a standalone DHCP server. </p>



<p></p>



<p>First thing we need to do is to create a Linode StackScript which we will use to automatically install and configure our DHCP server. </p>



<pre class="wp-block-code"><code>#!/bin/bash
#&lt;UDF name="DEFLEASETIME" Label="Default lease time" example="3600" /&gt;
#&lt;UDF name="MAXLEASETIME" Label="Max lease time" example="14400" /&gt;
#&lt;UDF name="SUBNET" Label="Subnet" example="10.10.10.0" /&gt;
#&lt;UDF name="NETMASK" Label="Netmask" example="255.255.255.0" /&gt;
#&lt;UDF name="STARTRANGE" Label="Start range" example="10.10.10.10" /&gt;
#&lt;UDF name="ENDRANGE" Label="End range" example="10.10.10.250"/&gt;
#&lt;UDF name="ROUTER" Label="Router" example="10.10.10.1" /&gt;
#&lt;UDF name="DNS1" Label="DNS1" example="10.10.10.2" /&gt;
#&lt;UDF name="DNS2" Label="DNS2" example="10.10.10.3" /&gt;
apt update -y
apt install -y isc-dhcp-server
mv /etc/dhcp/dhcpd.conf{,.backup}
cat &gt; /etc/dhcp/dhcpd.conf &lt;&lt; EOF
default-lease-time $DEFLEASETIME;
max-lease-time $MAXLEASETIME;
authoritative;
 
subnet $SUBNET netmask $NETMASK {
 range $STARTRANGE $ENDRANGE;
 option routers $ROUTER;
 option domain-name-servers $DNS1, $DNS2;
}
EOF
sed -i 's/INTERFACESv4=""/INTERFACESv4="eth1"/' /etc/default/isc-dhcp-server
systemctl restart isc-dhcp-server.service
</code></pre>



<p>After we&#8217;ve got our StackScript <a href="https://www.linode.com/docs/products/tools/stackscripts/guides/create/">created</a>, we can deploy a VM from it by clicking on &#8220;Deploy New Linode&#8221; button and filling out all the required details. Make sure that you assign the virtual machine to the VLAN you are using in your region. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="578" height="863" src="https://blog.slepcevic.net/wp-content/uploads/2023/10/dhcpblog.png" alt="" class="wp-image-172" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/10/dhcpblog.png 578w, https://blog.slepcevic.net/wp-content/uploads/2023/10/dhcpblog-201x300.png 201w" sizes="auto, (max-width: 578px) 100vw, 578px" /></figure>



<p>You can use default settings for &#8220;<strong>Default lease time</strong>&#8221; and &#8220;<strong>Max lease time</strong>&#8220;, just make sure to adjust the &#8220;<strong>Subnet</strong>&#8221; and mask to match the ones you&#8217;re using in your VLAN. </p>



<p>We can also use Terraform to create our Stackscript by using &#8220;<strong>linode_stackscript</strong>&#8221; resource &#8211; https://registry.terraform.io/providers/linode/linode/latest/docs/resources/stackscript</p>



<p></p>



<p>For details on how to use Terraform to deploy instance from a StackScript, check out this blog post on how to use &#8220;<strong>stackscript_data</strong>&#8221; block to provide StackScript parameters &#8211; <a href="https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/">https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/</a></p>



<p></p>



<p>Cheers, Alex. </p>



<p></p><p>The post <a href="https://blog.slepcevic.net/how-to-deploy-a-dhcp-server-in-a-linode-vlan/">How to deploy a DHCP server in a Linode VLAN</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/how-to-deploy-a-dhcp-server-in-a-linode-vlan/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Deploying Linode Marketplace StackScripts with Terraform</title>
		<link>https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/</link>
					<comments>https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Thu, 29 Jun 2023 08:22:00 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[linode-cli]]></category>
		<category><![CDATA[Terraform]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=146</guid>

					<description><![CDATA[<p>Recently, I needed to deploy a 3 node Redis Cluster from Linode&#8217;s Marketplace. Quick glance at Linode&#8217;s Terraform provider shows that we can deploy instances using StackScripts, but in order to do that, we need to specify the StackScript ID....</p>
<p>The post <a href="https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/">Deploying Linode Marketplace StackScripts with Terraform</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Recently, I needed to deploy a 3 node Redis Cluster from Linode&#8217;s Marketplace. </p>



<p>Quick glance at Linode&#8217;s Terraform provider shows that we can deploy instances using StackScripts, but in order to do that, we need to specify the StackScript ID. If we are deploying from our own StackScript, it&#8217;s easy, you just reference it like this and you&#8217;re good to go.</p>



<pre class="wp-block-code"><code>resource "linode_stackscript" "foo" {
  label = "foo"
  description = "Installs a Package"
  script = &lt;&lt;EOF
#!/bin/bash
# &lt;UDF name="package" label="System Package to Install" example="nginx" default=""&gt;
apt-get -q update &amp;&amp; apt-get -q -y install $PACKAGE
EOF
  images = &#091;"linode/ubuntu18.04", "linode/ubuntu16.04lts"]
  rev_note = "initial version"
}

resource "linode_instance" "foo" {
  image  = "linode/ubuntu18.04"
  label  = "foo"
  region = "us-east"
  type   = "g6-nanode-1"
  authorized_keys    = &#091;"..."]
  root_pass      = "..."

  <strong>stackscript_id = linode_stackscript.foo.id</strong>
  stackscript_data = {
    "package" = "nginx"
  }
}</code></pre>



<p>&#8220;Problem&#8221; comes when we want to deploy a product from the marketplace, in order to do that we need to collect a few things first. </p>



<ol class="wp-block-list">
<li>ID of the StackScript you want to deploy</li>



<li>List of supported OS images</li>



<li>Check which variables we need to provide to the StackScript. </li>
</ol>



<p>Step 1 &#8211; Fetching the StackScript ID. In this case, I&#8217;ll do it using linode-cli, but you&#8217;re free to use any other method</p>



<pre class="wp-block-code"><code>linode-cli stackscripts list --label "Redis Sentinel Cluster One-Click"
</code></pre>



<p>Output of this command looks like this</p>



<p><img loading="lazy" decoding="async" width="958" height="161" class="wp-image-150" style="width: 1000px" src="https://blog.slepcevic.net/wp-content/uploads/2023/07/Screenshot-2023-07-03-100015.png" alt="" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/07/Screenshot-2023-07-03-100015.png 958w, https://blog.slepcevic.net/wp-content/uploads/2023/07/Screenshot-2023-07-03-100015-300x50.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/07/Screenshot-2023-07-03-100015-768x129.png 768w" sizes="auto, (max-width: 958px) 100vw, 958px" /></p>



<p>From here, we need to write down the ID of the script, and check the list of supported images. In this case, I&#8217;ll deploy a stackscript with the ID 1132204 which is owned by Linode. </p>



<p>Next step is to check which variables we need to provide to the StackScript. We can easily see that by running the following Powershell command:</p>



<pre class="wp-block-code"><code>$stackscripts = ((wget https://cloud.linode.com/api/v4/linode/stackscripts?page_size=500).Content | convertfrom-json)
$stackscripts.data | where {$_.id -like "1132204"} | select -expand user_defined_fields
name                   label
----                   -----
token_password         Your Linode API token
sudo_username          The limited sudo user to be created in the cluster
sslheader              SSL Information
country_name           Details for self-signed SSL certificates: Country or Region
state_or_province_name State or Province
locality_name          Locality
organization_name      Organization
email_address          Email Address
ca_common_name         CA Common Name
common_name            Common Name
clusterheader          Cluster Settings
add_ssh_keys           Add Account SSH Keys to All Nodes?
cluster_size           Redis cluster size</code></pre>



<p>And finally put all of those variables into our Terraform code, which in end looks something like this: </p>



<pre class="wp-block-code"><code>resource "linode_instance" "redis" {
        image = "linode/ubuntu22.04"
        label = "RedisCluster"
        group = "Redis"
        tags = &#091; "stage:dev" ]
        region = "eu-central"
        type = "g6-standard-1"
        authorized_users = &#091; "yourUsername" ]
        root_pass = "SuperRandomPassW0rd.123!"
<strong>        stackscript_id = <em>1132204</em>
        stackscript_data = {
            "token_password" = "yourLinodeToken"
            "sudo_username" = "myuser"
            "sslheader" = "Yes" #Default YES
            "country_name" = "NL"  #Two letter country code
            "state_or_province_name" = "South Holland" 
            "locality_name" = "Rotterdam" 
            "organization_name" = "Org Name" 
            "email_address" = "yourEmail@here.com" 
            "ca_common_name" = "Redis CA" 
            "clusterheader" = "Yes" 
            "add_ssh_keys" = "no" #yes or no
            "cluster_size" = "3" #3 or 5</strong>
        }
}
</code></pre>



<p>Notice we are required to provide our Linode token in order to deploy this cluster; this can be the same token you&#8217;re using for your existing Terraform code, so you can simple reference a environment variable in your code and off you go <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>Cheers, Alex. </p><p>The post <a href="https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/">Deploying Linode Marketplace StackScripts with Terraform</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/deploying-linode-marketplace-stackscripts-with-terraform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Building your IT landscape on Akamai Connected Cloud &#8211; Part 2 &#8211; Defining the project</title>
		<link>https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-part-2-defining-the-project/</link>
					<comments>https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-part-2-defining-the-project/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Sun, 23 Apr 2023 23:49:50 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Containers]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Infrastructure as code]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[Terraform]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=53</guid>

					<description><![CDATA[<p>Related posts Part 1 &#8211; Intro Part 2 &#8211; this post Welcome to the second part of the &#8220;Building your IT landscape on Akamai Connected Cloud&#8221; series. In this post we will define the basic scenario and requirements for our...</p>
<p>The post <a href="https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-part-2-defining-the-project/">Building your IT landscape on Akamai Connected Cloud – Part 2 – Defining the project</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p></p>



<p><strong><em>Related posts</em></strong></p>



<p>Part 1 &#8211; <a href="https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-intro/" data-type="URL" data-id="https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-intro/" target="_blank" rel="noreferrer noopener">Intro</a></p>



<p>Part 2 &#8211; <a rel="noreferrer noopener" href="https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-part-2-defining-the-project/" target="_blank">this post</a></p>



<p>Welcome to the second part of the &#8220;Building your IT landscape on Akamai Connected Cloud&#8221; series. </p>



<p>In this post we will define the basic scenario and requirements for our &#8220;<strong>demo</strong>&#8221; project which we will build on Akamai Connected Cloud. </p>



<h4 class="wp-block-heading"><strong>SCENARIO</strong></h4>



<p>We have a company called &#8220;<strong>Vapor</strong>&#8221; which is an online only company selling games and offering them for download.  </p>



<p>Having bad experiences with a MSP, they turned to <a href="https://www.akamai.com" target="_blank" rel="noreferrer noopener">Akamai </a>for help. </p>



<p>Besides aiming for better performance, <strong>Vapor&#8217;s</strong> DevOps team wanted to be more hands-on and have the ability to tweak the things &#8220;<strong>under the hood</strong>&#8221; so the entire solution can be rearchitected down the line to fit the new cloud provider. </p>



<p>Project has two major phases; first and critical phase is to do a <strong>lift and shift</strong> of the current platform and improve it with minimum amount of effort; introduce monitoring and management software and create pipelines. Current solution experiences a lot of downtime which directly correlates to lost revenue. </p>



<p>Second phase is to containerize and modernize the entire stack by utilizing Akamai&#8217;s managed Kubernetes service (LKE) and compute capabilities. Additionally, Vapor has plans to establish presence in APAC, EMEA and AMER regions in the near future so that requirement should be taken into consideration while designing the infrastructure. </p>



<p></p>



<h4 class="wp-block-heading">Current Tech stack</h4>



<p>Custom made application based on PHP and MySQL with few thousands of articles. </p>



<p>Application  is running on eight web servers behind a load balancer. Standalone host is running MySQL database engine, while game data is stored in object storage 200 TB in size. </p>



<p></p>



<p>Hardware specifications</p>



<ul class="wp-block-list">
<li>8 x Web servers: 16 CPU cores, 64 GB RAM, 200 GB SSD
<ul class="wp-block-list">
<li>Average CPU usage is 70%</li>



<li>80% memory usage</li>



<li>400 IOPS on average</li>
</ul>
</li>



<li>Database server: 32 CPU cores, 128 GB RAM, 500 GB SSD
<ul class="wp-block-list">
<li>DB is around 300 GB and growing 10% every quarter</li>



<li>90% RAM usage</li>



<li>5500 IOPS on average, with occasional spikes to 10000 IOPS</li>
</ul>
</li>



<li>Load balancer
<ul class="wp-block-list">
<li>1000 requests/s on average, with occasional spikes to 2500 req/s. </li>
</ul>
</li>



<li>Object storage
<ul class="wp-block-list">
<li>Currently hosted with a different cloud provider</li>
</ul>
</li>
</ul>



<p>Monitoring and management is handled by the current MSP, so we have an open playing field when it comes to choosing technologies which we will use for monitoring, access, security, etc&#8230;</p>



<p><strong>Simplistic overview of the current infrastructure</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="669" height="374" src="https://blog.slepcevic.net/wp-content/uploads/2023/03/mclovin.png" alt="" class="wp-image-64" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/03/mclovin.png 669w, https://blog.slepcevic.net/wp-content/uploads/2023/03/mclovin-300x168.png 300w" sizes="auto, (max-width: 669px) 100vw, 669px" /></figure>



<p></p>



<h4 class="wp-block-heading"><strong>Where do we want to be in the future? </strong></h4>



<p>Before we start writing any code (yes, everything we will do will be done in code), we need to define our project goals, <a href="https://en.wikipedia.org/wiki/Functional_requirement" target="_blank" rel="noreferrer noopener">functional</a> and <a href="https://en.wikipedia.org/wiki/Non-functional_requirement" target="_blank" rel="noreferrer noopener">non-functional</a> requirements and try to predict the future a bit <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<h4 class="wp-block-heading"><strong>Let&#8217;s start with the main project goals; </strong></h4>



<ul class="wp-block-list">
<li>Improve availability</li>



<li>Lower hosting costs compared to the current provider</li>



<li>Improve performance</li>



<li>Build for scale</li>



<li>Accommodate new modernization efforts which are in the pipeline</li>



<li>Support world wide presence with the ability to do edge computing in the future</li>



<li>Make it secure</li>



<li>Make it easy to run</li>



<li>Make it automated</li>



<li>Make developers happy &lt;3</li>
</ul>



<h4 class="wp-block-heading">Overview of the new infrastructure layout</h4>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="456" src="https://blog.slepcevic.net/wp-content/uploads/2023/04/Screenshot-2023-04-16-204916-1024x456.png" alt="" class="wp-image-77" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/04/Screenshot-2023-04-16-204916-1024x456.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/04/Screenshot-2023-04-16-204916-300x134.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/04/Screenshot-2023-04-16-204916-768x342.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/04/Screenshot-2023-04-16-204916.png 1442w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>As you can see, our infrastructure layout can be broken down into classic <strong>DT(A)P</strong> approach, along side a management and backup account. </p>



<p>Our management account will run all &#8220;operational&#8221; services we need to run our infrastructure, like monitoring, build and deployment pipelines, security tooling, secure access services, etc&#8230;, while we will have Development, Test and Production accounts for our dev/test and production workloads. </p>



<p>Goal will be to make our development, test and production accounts identical in every aspect besides scale. That will ensure that all infrastructure and application tests we will be running are giving realistic results. </p>



<p>Finally, we will have a dedicated Akamai Connected Cloud account in a different region where we will run our backup software and DR infrastructure. </p>



<p>Additionally, any <a href="https://www.linode.com/" target="_blank" rel="noreferrer noopener">Akamai Connected Cloud</a> service we might need (like <a href="https://www.linode.com/products/dedicated-cpu/" target="_blank" rel="noreferrer noopener">virtual machines</a>, <a rel="noreferrer noopener" href="https://www.linode.com/products/object-storage/" target="_blank">object storage</a>, <a rel="noreferrer noopener" href="https://www.linode.com/products/kubernetes/" target="_blank">LKE clusters</a>, etc&#8230;) will also be deployed in it&#8217;s own corresponding (DTAP) account. </p>



<p>Our intention is to have all environments physically and logically separated as much as possible. </p>



<p>Entire infrastructure will be built using code, primarily Terraform and Ansible for the first phase, while for the second phase, we will look into using some Kubernetes and application management tooling and pipelines. TBD. </p>



<p>In the next post we will start to define our functional and non-functional requirements for the entire project, drilling down into specific category and start defining our roadmaps. </p>



<p></p>



<p>Cheers, Alex. </p>



<p></p><p>The post <a href="https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-part-2-defining-the-project/">Building your IT landscape on Akamai Connected Cloud – Part 2 – Defining the project</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/building-your-it-landscape-on-akamai-connected-cloud-part-2-defining-the-project/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: blog.slepcevic.net @ 2026-01-06 11:35:20 by W3 Total Cache
-->