<?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 Johnny Eric Amancio on Medium]]></title>
        <description><![CDATA[Stories by Johnny Eric Amancio on Medium]]></description>
        <link>https://medium.com/@johnnyeric?source=rss-5a18798c7257------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bPvlvBA2hZqApoCh0S2q7Q.jpeg</url>
            <title>Stories by Johnny Eric Amancio on Medium</title>
            <link>https://medium.com/@johnnyeric?source=rss-5a18798c7257------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:43:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnnyeric/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[Introducing Battle — Realtime Coding Battles]]></title>
            <link>https://medium.com/@johnnyeric/introducing-battle-realtime-coding-battles-ff7a06a6c668?source=rss-5a18798c7257------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff7a06a6c668</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[practice]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Johnny Eric Amancio]]></dc:creator>
            <pubDate>Sun, 16 Feb 2020 15:54:07 GMT</pubDate>
            <atom:updated>2020-03-05T13:55:30.069Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing Battle — Realtime Coding Battles</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mECwx81Iqdb78qcIxLG6iw.png" /><figcaption>Battle.CoderHub.dev</figcaption></figure><p><a href="https://battle.coderhub.dev/">Let&#39;s Battle! Practice your Programming Skills. And Have Fun.</a></p><p>I would like to introduce a project called <strong>Battle</strong>. It is a platform where developers can practice their programming skills and have fun at the same time. The goal is to make it easier for developers to find their own path into their dream jobs. At the moment it only works with JavaScript, but other languages are already planned. If you want a specific language or feature to be available please send your feedback through the feedback button in the platform and I will adjust the next languages&#39; priority.</p><h3>Battle</h3><p>Battle is a platform where you are able to participate on realtime matches against developers where the goal is to solve the problem that is presented before the other coder is able to solve it first!</p><p>I believe this process can bring a lot of improvements to you as a developer if you start practicing regularly.</p><p>This is the very first version of the project being released and it is not complete yet. I am releasing this as an MVP.</p><p>Go and give it a shot :)</p><h3>The 3 pillars</h3><p>The following are the three pillars that lead me to the conception of this project:</p><p><strong>Practice algorithms and data structures + Have fun + Learn from other Coders</strong></p><p>Now, I will explain what each of the pillars mean.</p><h3>Practice algorithms and data structures</h3><p>I believe that the practice of algorithms and data structures can help us on the daily tasks we have as programmers even if you don&#39;t realise it at first. At the same time, the theoretical concepts and the information about these topics is so vast that it may be hard to know where to begin. <strong>Battle</strong> is meant to make it easier for us developers to turn practice into a habit and stick to it on a daily basis. The idea is to reduce the overwhelming sensation of not having a good place to start and in future versions provide a clear learning path built specially for the user.</p><h3>Have fun</h3><p>I am sure the practice can also be fun, in this platform you may find a lot of different levels and problems will be constantly adjusted to the level that suits them best. That way, you can pick a level you feel comfortable and is challenging at the same time.</p><h3>Learn from other Coders</h3><p>In the platform you will be able to interact in realtime with other coders anywhere in the world and that way you can learn from their experience too. At the moment, there is a process of matchmaking by level. You can choose a level and be matched with another developer that chose the same level.</p><h3>Give it a try!</h3><p>I kindly ask for all developers to give <strong>Battle</strong> a try, it is still in the very beginning and it needs users in order for the matchmaker process to work. Also, don’t hesitate to provide your feedback it will be very valuable. And thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff7a06a6c668" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create and Deploy Serverless SPAs with Next.js on OpenFaaS or Knative (Google Cloud Run)]]></title>
            <link>https://medium.com/@johnnyeric/create-and-deploy-serverless-spas-with-next-js-on-openfaas-or-knative-google-cloud-run-4b32a073292b?source=rss-5a18798c7257------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b32a073292b</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[openfaas]]></category>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Johnny Eric Amancio]]></dc:creator>
            <pubDate>Tue, 21 May 2019 09:05:37 GMT</pubDate>
            <atom:updated>2019-05-21T09:05:37.422Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*3e9V8u5vK1E_KHB0dk_8Nw.png" /></figure><h4>TL;DR</h4><p>I love to learn different topics around Software Engineering and I have been working as a Full Stack Engineer for the past years. At the same time I am very enthusiastic about Cloud, Containers, IoT and Machine Learning I also want to be able to develop Web Pages and push them to the Cloud. In this article I mix some of this concepts so we can quickly deploy Single Page Applications in a simple and cheap way.</p><h4>Serverless</h4><p>Serverless applications are based on the idea of functions/services that can be packaged as containers and integrated as a pool. They are meant to have an orchestrator that abstracts away the difficulties of managing the deployment of each application directly on VMs and enables lots of possibilities for automation.</p><h4>Next.js</h4><p>Today we already have several different ways of deploying static web apps and modern SPAs. At the same time, technology has been constantly evolving and so much experience obtained. Initially, applications were served mainly from the server side, later JavaScript started being used more and more to create Single Page Applications but both experiences had their trade-offs. Today, an alternative way is being explored, which is to use the best of both worlds. Next.js is a framework in this field which has done a great work around this topic.</p><p>Next.js makes it easy to create web applications with React and it takes care of several important aspects to make production ready web apps. It has the concept of pages as being an entrypoint url <strong>route</strong> that maps to a React <strong>component</strong> and is very flexible about <strong>configuration</strong>.</p><p>Regarding the Serverless concept, Next.js has recently released its <a href="https://nextjs.org/blog/next-8#serverless-nextjs">release 8</a>, which introduced a new feature to build a <strong>single</strong> <strong>page</strong> packaged as an independently deployable function. This is great as <strong>pages</strong> can now be built and deployed independently.</p><p>The way Next.js applications work is by providing the first render of the pages in the server. Then, after pages are loaded, they act as SPAs by being managed on the client side and fetch data from APIs when necessary.</p><h4>OpenFaaS</h4><p>I started experimenting with Open Source Serverless projects because I like the flexibility of containers to deal with all the different kinds of workloads. I researched about different projects but the one I appreciated most was the OpenFaaS project and I have been following it since then. In my opinion, it is great for being focused around containers and does not force us to use a specific function handler. Sure it has the concept of templates that turns things a lot simpler, but it also makes it very easy to customize a container image when necessary.</p><p>A few months ago, OpenFaaS published an <a href="https://www.openfaas.com/blog/serverless-single-page-app/">article</a> detailing how one could serve single page applications from a Serverless functions and I got very excited about it. After reading about the new <strong><em>serverless mode</em></strong> of Next.js and seeing some example usages, I started thinking about how I could leverage that with OpenFaaS as a simple way of pushing React components to the Cloud.</p><p><a href="https://www.openfaas.com/blog/serverless-single-page-app/">How to build a Serverless Single Page App</a></p><h4>Knative and Cloud Run</h4><p>Knative is a recent Open Source project from Google, Pivotal and other major companies created in order to provide base foundations for Serverless. It has three main components (build, serving and eventing) and integrates with Istio (Kubernetes Native Service Mesh).</p><p>Cloud Run was recently released by Google on their Cloud Platform. It uses Knative and Istio as its foundation and is a product where we can run stateless workloads packaged in containers at a very minimum cost as we only pay for the time the service is actively running.</p><p>Also, it has a free tier of 2 million invocations per month, that way you can get started for <strong><em>free</em></strong>.</p><h4>OpenFaaS Next.js template</h4><p>After the OpenFaaS blog post about Serverless SPAs and the release of the <a href="https://nextjs.org/blog/next-8#serverless-nextjs">Next.js 8</a> with its new <strong><em>serverless mode</em></strong> I was tempted to figure out how I could integrate that with OpenFaaS. I was seeking a way to quickly create a React component and publish that to an url. As stated in my twitter <a href="https://twitter.com/johnnyeric/status/1115543385987780608">@johnnyeric</a>, I created an OpenFaaS template already setup with Next.js on serverless mode.</p><h3>Johnny Eric on Twitter</h3><p>This weekend I wanted a simple way to push #reactjs components to the cloud. So I built an @openfaas template to leverage #nextjs new serverless mode. https://t.co/tBSy7oAk87</p><p>That way, we can generate the function based on this template via the OpenFaaS CLI, create a page and publish to an <a href="https://www.openfaas.com/">OpenFaaS</a> gateway or deploy it to <a href="https://cloud.google.com/run/">Google Cloud Run</a>.</p><p>As of today, the template is not yet published on the OpenFaaS template store, but it is in process to be. It is being reviewed and for the moment you can use it directly from my repo.</p><p><a href="https://github.com/johnnyeric/openfaas-serverless-nextjs-template">johnnyeric/openfaas-serverless-nextjs-template</a></p><p>Enough for introductions!</p><h4>Let’s create a Serverless SPA</h4><p>As stated in the title of this article there are two targets for deployment. In case of OpenFaaS, a deployment of the OpenFaaS Gateway will be required. Otherwise, it is possible to follow the deployment on Google Cloud Run. In both scenarios, the OpenFaaS CLI will be used.</p><p>Then, first make sure to have the CLI installed so we can start. Go and, follow the following post to get started with the CLI:</p><p><a href="https://blog.alexellis.io/quickstart-openfaas-cli/">Morning coffee with the OpenFaaS CLI</a></p><p>For simplicity, here it is one of the ways to install:</p><pre>$ curl -sL https://cli.openfaas.com | sudo sh</pre><h4>Create a function using the template</h4><p>After having the CLI installed, we can go ahead and create our Serverless SPA.</p><p>Get into a folder and execute the following:</p><pre>$ faas template pull <a href="https://github.com/johnnyeric/openfaas-serverless-nextjs-template">https://github.com/johnnyeric/openfaas-serverless-nextjs-template</a><br>$ faas new --lang serverless-nextjs &lt;function-name&gt;</pre><p><strong><em>The example function created from the template is ready to be deployed and you can test the deployment first and then customize. Also, it is already setup with emotion for styling but you can tweak the configurations or add packages as you wish.</em></strong></p><p>Initially when created there are two example pages (Home and About) with links to each other.</p><p>In order for the links to work, it is important to define two parameters in the <strong>next.config.js</strong>, because depending on the environment the function runs it can have a url prefix.</p><p><strong>Example configuration</strong></p><p><strong><em>Default (Will be enough for Google Cloud Run):</em></strong></p><pre>module.exports = {<br>  target: ‘serverless’,<br>  env: {<br>    BASE_URL: ‘/’<br>  },<br>  //assetPrefix: ‘/function/&lt;function-name&gt;’<br>}</pre><p><strong><em>Example (Will be necessary for OpenFaaS Gateway):</em></strong></p><pre>module.exports = {<br>  target: &#39;serverless&#39;,<br>  env: {<br>    BASE_URL: ‘/function/&lt;function-name&gt;’<br>  },<br>  assetPrefix: ‘/function/&lt;function-name&gt;’<br>}</pre><p><strong>Example function</strong></p><p>This is what the function handler of the newly created function will look like.</p><pre>const home = require(&#39;./.next/serverless/pages/index.js&#39;);<br>const about = require(&#39;./.next/serverless/pages/about.js&#39;);<br><br>module.exports = (context) =&gt; {<br>  const contentPath = `${__dirname}/static`;<br>  const defaultPath = `${__dirname}/static/404.html`;<br><br>  context.servePages({<br>    &#39;/&#39;: home,<br>    &#39;/about&#39;: about,<br>  });<br><br>  // Everything not served as Next.js pages will be served as static<br>  context.setCustomFolder(contentPath, defaultPath); // optional<br>  context.serveStatic();<br>}</pre><p><strong><em>The index.js and about.js are just React components.</em></strong></p><h4>Deploy to OpenFaaS Gateway</h4><p>At this point, if you have a gateway deployed, make sure to login to it in the CLI. If it is defined as default, the function definition will already point to the correct gateway, if not go to the YAML file and define it.</p><p>Also, it will be important to define the container image registry in the OpenFaaS YAML file. If using Docker Hub, then include your username at the beginning of the image name. Otherwise, define your own container registry, then make sure the OpenFaaS Gateway environment also has the credentials to this registry.</p><p><strong><em>Example:</em></strong></p><pre>provider:<br>  name: openfaas<br>  gateway: &lt;gateway-url&gt;<br>functions:<br>  &lt;function-name&gt;:<br>    lang: serverless-nextjs<br>    handler: ./&lt;function-name&gt;<br>    image: &lt;docker-hub-username&gt;/&lt;function-name&gt;:latest</pre><p>You can now <strong><em>build</em></strong> and <strong><em>deploy</em></strong> the function. To make things simpler, just run the <strong><em>up</em></strong> command that will do both.</p><pre>$ faas up -f &lt;function-name&gt;.yml</pre><p>And that&#39;s it!</p><h4>Function page after deployment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8xW5S-3GlCJnBYEjvWE6g.png" /><figcaption>My personal OpenFaaS Gateway showing the Function Page</figcaption></figure><h4>Deploy to Google Cloud Run</h4><p>First you can go and configure the <strong>gcloud</strong> CLI to use Cloud Run from the documentation.</p><p><a href="https://cloud.google.com/run/docs/quickstarts/build-and-deploy">Quickstart: Build and Deploy | Cloud Run Documentation | Google Cloud</a></p><p>On Cloud Run the image needs to be in Google’s container registry. You can just add the the registry address for your Google project at the function YAML file then only build the container instead of the <strong><em>up</em></strong> command.</p><p><strong>Steps</strong></p><ul><li>First get your Google PROJECT_ID:</li></ul><pre>gcloud config get-value project</pre><ul><li>Then add to the image name like the example below:</li></ul><pre>provider:<br>  name: openfaas<br>  gateway: &lt;gateway-url&gt;<br>functions:<br>  &lt;function-name&gt;:<br>    lang: serverless-nextjs<br>    handler: ./&lt;function-name&gt;<br>    image: gcr.io/&lt;PROJECT-ID&gt;/&lt;function-name&gt;:latest</pre><ul><li>Then build and push the image:</li></ul><pre>$ faas build -f &lt;function-name&gt;.yml<br>$ docker push &lt;image&gt; # image is defined in the YAML file above</pre><p>Next thing is to deploy the image to cloud run. It can be done from the <strong>gcloud</strong> CLI or the Google Cloud Console.</p><p><strong>Deploying from the CLI</strong></p><pre>gcloud beta run deploy --image gcr.io/&lt;PROJECT-ID&gt;/&lt;function-name&gt;</pre><p>As stated in the documentation:</p><blockquote>When prompted, select a region (for example us-central1), confirm the service name, and respond y to <strong>allow unauthenticated invocations</strong>.</blockquote><p><strong>Deploy from the Google Cloud Console</strong></p><p>It is very simple, just navigate to the Google Cloud Run panel, click on the <strong><em>Create service</em></strong> button and fill the fields on the page.</p><p><strong>Steps</strong></p><ul><li>You may select the image previously pushed to the registry from a list.</li><li>Add a name to the service.</li><li>Activate the A<strong><em>llow unauthenticated invocations</em></strong> option so the page become public.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyiXCbh2OtL1NmBVfjgZHA.png" /><figcaption>Google Cloud Run Create Service Page</figcaption></figure><h4>Cloud Run Service page after deployment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmM98LEsWykh0Y0iy6XUlg.png" /><figcaption>Google Cloud Run Service Page</figcaption></figure><h4>Access the pages</h4><ul><li><strong>OpenFaaS</strong></li></ul><p>On OpenFaaS you can check the url when you click on the function, it will show an url like the following:</p><pre>https://&lt;openfaas-gateway-url&gt;/function/&lt;function-name&gt;</pre><ul><li>Cloud Run</li></ul><p>On Cloud Run when you open the service, it will show an url like the following:</p><pre>https://&lt;service-name&gt;-&lt;hash&gt;.a.run.app</pre><p>If you did not modify the pages after building from the template they will look like these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqSyc9py3LhWklQgxfQonQ.png" /><figcaption>Home Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z6vEFmvIMtr1nkzySf1mGA.png" /><figcaption>About Page</figcaption></figure><p><strong><em>The designs are not meant to be elaborated, they are just something to get started with CSS-in-JS styles using emotion and an example of interaction through the links. And it is very easy to add new packages and create pages from scratch.</em></strong></p><h4>Conclusion</h4><p>The technology has improved a lot in the recent years and for sure it will not stop. Actually it is very hard to choose from the many options we have, we can compose different tools and services in different ways to build incredible things. Having said that, this was my attempt to contribute to Open Source and add a simple way to use these awesome technologies together. I hope you find this template useful, and would appreciate any feedbacks to it.</p><p><a href="https://github.com/johnnyeric/openfaas-serverless-nextjs-template">johnnyeric/openfaas-serverless-nextjs-template</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b32a073292b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm Basics — Using Tillerless]]></title>
            <link>https://faun.pub/helm-basics-using-tillerless-dac28508151f?source=rss-5a18798c7257------2</link>
            <guid isPermaLink="false">https://medium.com/p/dac28508151f</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tiller]]></category>
            <dc:creator><![CDATA[Johnny Eric Amancio]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 16:15:31 GMT</pubDate>
            <atom:updated>2020-01-31T16:29:02.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>Helm Basics — Using Tillerless</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*nViWw5hFgS7l3vu1RkO3YA.png" /></figure><h3>TL&amp;DR</h3><p>I have been experimenting with container technologies for a while now. Most of the time with Docker and Kubernetes. For Kubernetes, one tool that is very handy is Helm. <a href="https://github.com/helm/helm">Helm</a> is a package manager that makes deployment of apps and its dependencies very easy. Helm brings the concept of charts, which are a composition of Kubernetes resources. Helm uses Go templates that enables great flexibility on deployments as it is possible to customise the values of the chart prior to its installation. Although I believe it is an intuitive tool, as any other software product, it provides lots of functionality and sometimes it can be difficult for someone to get a quick start into using it.</p><h3>Helm installation</h3><p>Helm has two main components: a command line client and a server called Tiller. Helm&#39;s initial setup has lots of details in its documentation regarding security and provides some special concerns for its initial preparation.</p><p><a href="https://docs.helm.sh/using_helm/#installing-helm">The Helm client installation</a> is very simple, it is available in package managers for MacOS, Linux and Windows.</p><p>The Helm server (Tiller) can be installed on the cluster by simply running a command on the helm client helm init but it&#39;s not a very secure option as it involves having a server running on your cluster with access to your resources. If you want to increase the security, it involves a lot more tasks regarding namespace management, TLS certificates and RBAC.</p><p>One important note is that Tiller is commonly pointed not to be a very secure option even with all the security steps considered because Tiller lives inside the Kubernetes cluster with <a href="https://rimusz.net/tillerless-helm/">full administrative rights</a>. That&#39;s why there are lots of discussions around this topic to find alternatives to having the Tiller server installed on the cluster. People may refer to this topic as <strong>Tillerless</strong> Helm.</p><h3>Tillerless Helm with Helm 3 (Recommended)</h3><p><strong><em>Update</em></strong>: <em>As it turns out, Helm 3 was officially launched. Now it is possible to use Helm without Tiller or Tillerless plugin and it just works! Also, it is not necessary to “start” the namespace, just skip to the &quot;install&quot; part.</em></p><p>If you are just starting out with Helm I advice you to get started with Helm 3.</p><p>If you used previously the Helm 2 with the Tillerless plugin, I advice you to make the upgrade. To help on the upgrade and the migration of the previously deployed applications/configs there is this great article that will give all the necessary instructions and it is accompanied by another plugin that facilitates the migration process.</p><p><a href="https://rimusz.net/how-to-migrate-from-helm-v2-to-helm-v3">How to migrate from Helm v2 to Helm v3</a></p><p>But if the upgrade is not an option at the moment, then the section below will cover the setup of the plugin and its usage.</p><h3>Tillerless Helm with Helm 2</h3><p>As pointed out by <a href="https://rimusz.net/author/rimusz/">Rimas Mocevicius</a>, on his <a href="https://rimusz.net/tillerless-helm/">article</a>, this feature should be present in the future version 3 of Helm. But, it turns out it can be used today by following some steps. The Helm documentation states it as `Running Tiller Locally`.</p><p>Fortunately, there is a helm plugin also created by <a href="https://rimusz.net/author/rimusz/">Rimas Mocevicius</a> that makes it even easier to use this feature. I have been using it a lot and it works great.</p><p><a href="https://github.com/rimusz/helm-tiller">rimusz/helm-tiller</a></p><p>To install it:</p><pre>helm plugin install <a href="https://github.com/rimusz/helm-tiller">https://github.com/rimusz/helm-tille</a>r</pre><p>Basically, in order to use Tillerless Helm today with your kubernetes cluster just run the helm tiller start [namespace] and when done run helm tiller stop. The start command will start a Tiller server and automatically expose an environment variable with its address so the helm client can communicate with it. The plugin also has commands to deal with CI environments.</p><p>That&#39;s it for <strong>Tillerless</strong>, isn&#39;t it simpler?</p><p>It doesn&#39;t require complex setups, service account creation, nor to keep the server component inside the cluster updated with the Helm version. It is all done on the client side. When finished using Helm, just stop the <strong>Tiller</strong> server using the plugin above and it is all done. Even better, it is also more secure.</p><p>Finally, to clarify, the term <strong>Tillerless</strong> refers to <strong>not</strong> having the Tiller server installed inside the Kubernetes cluster. Whilst we <strong>still</strong> have Tiller running locally on our machine but only for a short period of use.</p><h3>Helm charts</h3><p>As stated before, Helm has the concept of charts that define all resources for an application.</p><p>Also, Helm is capable of fetching charts from registries. It has an official registry for charts that has lots of different applications categorised as stable or incubator. The applications can be found on the <a href="https://hub.kubeapps.com/">KubeApps Hub</a> web site or in a <a href="https://github.com/helm/charts">Helm&#39;s repository</a> on github. Besides that, the Helm client can also register multiple registries simultaneously.</p><h3>Helm releases</h3><p>The documentation states the concept of a release as an installed chart on the cluster. That way, the same chart can be installed multiple times under different releases.</p><h3>Helm basic commands</h3><h4>helm install [chart]</h4><p>This command takes the informed chart along with the any values provided and manages the deployment of the chart resources into the Kubernetes cluster.</p><p>According to their <a href="https://docs.helm.sh/helm/#helm-install">documentation</a>:</p><blockquote>There are five different ways you can express the chart you want to install:</blockquote><blockquote>By chart reference: helm install stable/mariadb<br>By path to a packaged chart: helm install ./nginx-1.2.3.tgz<br>By path to an unpacked chart directory: helm install ./nginx<br>By absolute URL: helm install <a href="https://example.com/charts/nginx-1.2.3.tgz">https://example.com/charts/nginx-1.2.3.tgz</a><br>By chart reference and repo url: helm install –repo <a href="https://example.com/charts/">https://example.com/charts/</a> nginx</blockquote><p>If needed, it is possible to set different values for each of the parameters configured on the chart. The parameters are usually present as a table on every chart containing the keys and its default values.</p><p>To set a value just get the key name from the table and use the --set option to override its value. This argument option accepts lots of different formats, you may refer to the <a href="https://docs.helm.sh/helm/#helm-install">documentation</a> for more details about its complete usage.</p><p>Examples:</p><pre>helm install [chart] --set key.name=value<br>helm install [chart] --set key.name=value,key2.name=value2<br>helm install [chart] --set key.name=value --set key2.name=value2</pre><h4>helm status [release]</h4><p>Command to check resources and their release status in the cluster.</p><h4>helm ls</h4><p>Command that list charts installed on the cluster.</p><h4>helm delete [release]</h4><p>Command that deletes the chart from the cluster. Use the option --purge to delete all references to the release name so its name is free to be installed again.</p><h3>Deploy an application</h3><p>Let&#39;s deploy a simple application. The chart to be used will be for the <a href="https://github.com/helm/charts/tree/master/stable/ghost">Ghost</a> blogging platform.</p><h4>Steps:</h4><p>Setup kubernetes namespace:<br>NAMESPACE=ghost-namespace</p><p>Start local Tiller with the plugin:<br>helm tiller start $NAMESPACE</p><p>Install chart with change to size of the persistent storage:<br>helm install stable/ghost --namespace $NAMESPACE --name my-ghost-release --set persistence.size=1Gi</p><p>Check release status:<br>helm status my-ghost-release</p><p>Stop local Tiller with the plugin:<br>helm tiller stop</p><p>And that&#39;s it for a basic getting started for Tillerless Helm.</p><h3>Conclusion</h3><p>When I started using theses tools I felt overwhelmed with so many information and it was difficult to just get started. I hope this article may help developers use Helm securely while still getting started with the Kubernetes ecosystem.</p><p>I find incredible the ability to install complete applications and all the required resources associated with it on a single command.</p><p>So, this is my attempt to explain the process in a simple way so people can start using it right away. So, I encourage anyone to comment here in case of doubts or any suggestion to improve this article.</p><p><a href="https://github.com/helm/helm">GitHub - helm/helm: The Kubernetes Package Manager</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dac28508151f" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/helm-basics-using-tillerless-dac28508151f">Helm Basics — Using Tillerless</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to reproduce command `docker run` via Docker Remote API with Node.js]]></title>
            <link>https://medium.com/@johnnyeric/how-to-reproduce-command-docker-run-via-docker-remote-api-with-node-js-5918d7b221ea?source=rss-5a18798c7257------2</link>
            <guid isPermaLink="false">https://medium.com/p/5918d7b221ea</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Johnny Eric Amancio]]></dc:creator>
            <pubDate>Sun, 16 Sep 2018 14:49:09 GMT</pubDate>
            <atom:updated>2018-09-19T08:16:54.457Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This articles assumes a basic understanding of docker and its ecosystem.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1jRTHAuAMWfFL9tU" /><figcaption>“assorted-color filed intermodal containers” by <a href="https://unsplash.com/@frankiefoto?utm_source=medium&amp;utm_medium=referral">frank mckenna</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TL;DR</p><p>I enjoy very much the concept of containers and became fascinated by the possibilities they enable. For an experiment I was doing, I needed a way to spin up some containers, send one time stdin data to them and receive its response via stdout, and I managed to implement this programatically via the Docker Remote API using Node.js.</p><p>Initially, I had some trouble because this part in the Remote API is a little bit tricky but after some time I finally achieved success and that’s why I wish to contribute with my findings on this topic.</p><p>Later, in the implementation section I will cover the execution details of one-off commands running inside Docker containers.</p><h3>Background</h3><p>Docker is one of the existent container technologies, and it has become one of the most popular tech stacks along with a great ecosystem of tools built around it.</p><p>Docker has a daemon server that keeps running on your machine and it exposes a Remote API for managing your containers. The most popular way to interact with containers is by using the Docker CLI tool.</p><p>If you ever used docker and its CLI, it’s for sure you’ve run into this command:</p><p>docker run &lt;options&gt; &lt;image&gt;.</p><p>The interesting part is that the Docker CLI uses the <a href="https://docs.docker.com/engine/api/v1.37/">Docker Remote API</a> under the hood (be sure to check this <a href="https://medium.com/lucjuggery/about-var-run-docker-sock-3bfd276e12fd">awesome post</a> about the unix socket the daemon listens to). Additionally, the run command has not a direct corresponding API endpoint to run containers, and it is composed by three main steps through the API that <strong>create</strong>, <strong>attach</strong> and <strong>start </strong>your containers.</p><h4>How `docker run` CLI command is composed under the hood</h4><blockquote>As I stated before, the Docker CLI abstracts the feature of &quot;running a container&quot;. That way we can have a better and easy experience while not having to deal with each of the required steps separately.</blockquote><p>For starters, let’s explain how it works:</p><p>Normally, you would use the command by informing a docker image along with some options to manage the container execution, by sending some data to the container, mounting volumes, enabling <em>tty</em> feature for interactive mode, and so on. <strong><em>Here, I will focus on the task of running a container, passing data into the stdin of the container, and obtaining its response via the stdout.</em></strong></p><p>When you call docker run it will begin its internal execution. First, it will call the <strong>create</strong> endpoint and a container is then created and allocated with a unique ID and this container remains stopped. Then, it will call the <strong>attach</strong> endpoint. It means that it will connect to the stdin/stdout/stderr of the container, allowing the container to read data and generate an output based on the received data. After the attachment is complete, it will call the <strong>start</strong> endpoint, which starts the container. After the container execution, the response will be shown and the container will remain stopped, unless the option --rm was passed — in this case the container will be destroyed right after the end of its execution.</p><p>As this feature requires three steps to complete it’s ok to expect a little overhead during its execution, as the whole process is a little bit intensive. This overhead is covered by some experiments on the following <a href="https://blog.iron.io/the-overhead-of-docker-run/">post</a>.</p><h3>Implementation</h3><h4>Description</h4><p>The goal of this implementation is to create a container, send some data through stdin and get the response from the stdout. I am using this great library to communicate with the Docker API called <a href="https://github.com/apocas/dockerode">dockerode</a>, which abstracts the direct access to the Docker API and provides some utilities like streaming stdin/stdout through the <strong>tcp</strong> connection.</p><p>We will use the following command as base for our implementation:</p><p><strong><em>Command</em></strong>: echo &quot;hello world&quot; | docker run -i alpine tr [a-z] [A-Z]</p><blockquote><strong><em>Explanation</em></strong>: Here we pipe the string hello world via stdin to the docker cli run command. It will forward the input string to to the Docker container via the Docker API. On the run command we also specify some arguments: the alpine image which is a tiny image, the tr command that will (in this case) capitalize all the letters from the input string and the -i flag that informs the container will receive data via stdin.</blockquote><p><strong><em>Result</em></strong>: HELLO WORLD</p><h4>Code</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/839d73672a6b4120a7c1eb5b7b282886/href">https://medium.com/media/839d73672a6b4120a7c1eb5b7b282886/href</a></iframe><h4>Wrapping up</h4><p>Docker containers enable lots of cool possibilities like the example of this article which is really simple, but we could create an application that would act upon receiving data and perform complex operations with it like code compilation and runtime execution. We could spawn containers on demand to deal with some tasks, and if we think about it, it is what serverless actually is. On serverless world, containers can be scaled on-demand. However, the process of spawning containers should be managed by container orchestrators like kubernetes or docker swarm. There are lots if interesting open-source projects like these, and each one has some particularities. The project I enjoyed most was <a href="https://www.openfaas.com/">OpenFaas</a>, as it integrates with the orchestrator quite easily. I am also keeping an eye on <a href="https://cloud.google.com/knative/">Knative</a>, as it is on its way to be a good foundation for future serverless projects.</p><ul><li><a href="https://docs.docker.com/engine/api/v1.37/">Docker Engine API v1.37 Reference</a></li><li><a href="https://github.com/apocas/dockerode">GitHub - apocas/dockerode: Docker + Node = Dockerode (Node.js module for Docker&#39;s Remote API)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5918d7b221ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>