{"id":2167,"date":"2015-08-30T03:00:00","date_gmt":"2015-08-30T10:00:00","guid":{"rendered":"https:\/\/www.microsoft.com\/reallifecode\/index.php\/2015\/08\/30\/deploying-flynn-clusters-on-azure\/"},"modified":"2020-03-18T16:43:18","modified_gmt":"2020-03-18T23:43:18","slug":"deploying-flynn-clusters-on-azure","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/ise\/deploying-flynn-clusters-on-azure\/","title":{"rendered":"Deploying Flynn Clusters on Azure"},"content":{"rendered":"<p>Flynn is a next-generation PaaS (Platform as a Service) solution that can deploy, run, and scale both twelve-factor apps as well as stateful services. The company behind Flynn (which is also named Flynn) recently joined Y Combinator and is moving fast with bold goals: \u201cFlynn deploys apps, scales apps, and manages databases with best practices right out of the box. Automatically doing all the things that were too complicated, expensive, or time consuming to do manually. And because it\u2019s open source, modular, and built on a set of core APIs, it\u2019s easy to extend or customize to any environment or need. Flynn is simply the easiest, most powerful way to run and scale your applications\u201d.<\/p>\n<p>It\u2019s a pretty bold statement, but we can attest that the team behind Flynn cares about quality like few others &#8211; <a href=\"https:\/\/github.com\/flynn\/flynn\/pull\/1567\/files\">over the course of a few weeks, we worked together to add Microsoft Azure as a target to Flynn\u2019s installation tool<\/a>. More than 5,000 lines of Go code were written so that others are able to spin up intelligent infrastructure for their apps in a few clicks. Let\u2019s take it for a ride!<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cse\/wp-content\/uploads\/sites\/55\/2020\/03\/2015-08-25-flynn-azure-cluster-flynn1.png\" alt=\"Flynn's Dashboard\" \/><\/p>\n<h3 id=\"running-the-installer\">Running the Installer<\/h3>\n<p>Flynn comes with a fancy command line client, available for both Windows, OS X, and Linux. On Windows, make use of your PowerShell by installing the Windows CLI:<\/p>\n<div class=\"highlighter-rouge\">\n<pre class=\"highlight\"><code>(New-Object Net.WebClient).DownloadString('https:\/\/dl.flynn.io\/cli.ps1') | iex\r\n\r\n<\/code><\/pre>\n<\/div>\n<p>On OS X or Linux, curl the CLI straight to your bin folder:<\/p>\n<div class=\"highlighter-rouge\">\n<pre class=\"highlight\"><code>L=\/usr\/local\/bin\/flynn &amp;&amp; curl -sSL -A \"`uname -sp`\" https:\/\/dl.flynn.io\/cli | zcat &gt;$L &amp;&amp; chmod +x $L\r\n<\/code><\/pre>\n<\/div>\n<p>Using your freshly installed command line client, run <code class=\"highlighter-rouge\">flynn install<\/code> to start the installer. A browser window should pop up, pointing to <code class=\"highlighter-rouge\">localhost<\/code>.<\/p>\n<h4 id=\"wait-localhost\">Wait, Localhost?<\/h4>\n<p>This is a big thing: All your data is in your control. Flynn gives you the convenience of a web app without actually being one. The installer naturally has the power to mess with your Azure Account (to spin up machines and deploy the cluster), but your credentials actually never leave your machine. This might seem trivial, but it\u2019s a major security feature &#8211; one that was bought with a lot of elbow grease.<\/p>\n<p>We had to come up with a somewhat tricky architecture where you, the user, will create your own Flynn Installer web application on Azure. It would have been easy to create a centralized web application able to create new clusters: Users would simply have to authenticate the app (much like you\u2019d authenticate a Facebook, Twitter, or Google app), but it would have also involved asking for complete administrative access to every user\u2019s cluster. If you take a peek at <a href=\"https:\/\/github.com\/flynn\/flynn\/blob\/0c6dbe812ad32475f12fc06d4e93103e51862171\/installer\/azure_cluster.go\">some of Flynn\u2019s underlying code<\/a>, you\u2019ll find a cool authentication flow.<\/p>\n<h3 id=\"going-through-the-installation-steps\">Going Through the Installation Steps<\/h3>\n<p>In the Flynn Installer, select \u2018Microsoft Azure\u2019 in the upper right and click on \u2018Add Credentials\u2019. A popup will open, asking you if you want the walkthrough. For the walkthrough, I created a series of GIFs showing you all the necessary steps individually. I heavily recommend that you follow the guide, but here\u2019s a quick summary:<\/p>\n<ul>\n<li>In the Azure Management Portal, select the default (or desired) Active Directory and add an application. Choose \u201can application my organization is developing\u201d and \u201cnative client application\u201d, using the redirect URI given to you by the Flynn Installer.<\/li>\n<li>Once the app is created, click on the \u2018Configure\u2019 tab and copy the \u2018Client ID\u2019 to the Flynn Installer. Then, at the very bottom of the page, grant your app the rights to manage use the Azure Service Management API.<\/li>\n<li>Going back to the applications tab of your directory, select the app and click the \u2018view endpoints\u2019 button, copying the OAuth 2.0 Token Endpoint to the Flynn Installer.<\/li>\n<li>To finish things up, click the \u2018Authenticate\u2019 button in the Flynn Installer.<\/li>\n<\/ul>\n<p>Now that you have your own web app created on Azure and the Flynn Installer authenticated, you can select the specifics for your cluster. Feel free to change the size of individual instances, the number of machines, or the datacenter location for your cluster. As soon as you confirm your selection, Flynn will use \u2018Azure Resource Management\u2019 templates to have Azure create your cluster.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cse\/wp-content\/uploads\/sites\/55\/2020\/03\/2015-08-25-flynn-azure-cluster-flynn2.png\" alt=\"Flynn Installing a Cluster\" \/><\/p>\n<p>Depending on how big your cluster is, installation will take a while. You can either wait for it to complete or read on to learn about how apps are being deployed.<\/p>\n<h6 id=\"issues\">Issues<\/h6>\n<p>Flynn is still in active development, meaning that things can still very much break. In my case, I had to attempt installation a total of three times before my cluster spun up. If you happen to run into similar issues, just throw away your cluster and start again &#8211; once Flynn is up and running, it is a wonderful personal PaaS.<\/p>\n<h3 id=\"congrats-youre-running-flynn\">Congrats, you\u2019re running Flynn!<\/h3>\n<p>Flynn can run virtually anything, but it\u2019s <a href=\"https:\/\/flynn.io\/docs\">especially good at running Go, Java, Node.js, PHP, Python, and Ruby<\/a>. If you\u2019re already familiar with the incredible convenience of Heroku buildpacks, you\u2019ll be happy to hear that Flynn just uses those. If you\u2019re not, think of buildpacks like packages that contain your application, describing the environment and dependencies for your app. They are automatically created as soon as you push a repository\/app to Flynn.<\/p>\n<p>Once installation has completed, the Flynn Installer will ask you install a SSL root certificate used to encrypt the connection between you and your Flynn cluster. It will also give a URL and a passkey to the Flynn dashboard for your cluster, which should look like https:\/\/dashboard.p326.flynnhub.com. From there, deploying applications is crazy easy: You can connect the dashboard with GitHub and deploy and scale any application.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cse\/wp-content\/uploads\/sites\/55\/2020\/03\/2015-08-25-flynn-azure-cluster-flynn3.png\" alt=\"Flynn's Dashboard\" \/><\/p>\n<p>Fore more information, check out <a href=\"https:\/\/github.com\/flynn\/flynn\">Flynn\u2019s source code<\/a>, the <a href=\"https:\/\/flynn.io\">official website<\/a>, as well as <a href=\"https:\/\/flynn.io\/docs\">the documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flynn is a next-generation PaaS (Platform as a Service) solution that can deploy, run, and scale both twelve-factor apps as well as stateful services. In this post, we&#8217;re checking out the brand-new Flynn Azure Installer.<\/p>\n","protected":false},"author":21345,"featured_media":12740,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16],"tags":[60,181],"class_list":["post-2167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-azure","tag-flynn"],"acf":[],"blog_post_summary":"<p>Flynn is a next-generation PaaS (Platform as a Service) solution that can deploy, run, and scale both twelve-factor apps as well as stateful services. In this post, we&#8217;re checking out the brand-new Flynn Azure Installer.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/posts\/2167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/users\/21345"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/comments?post=2167"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/posts\/2167\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/media\/12740"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/media?parent=2167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/categories?post=2167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ise\/wp-json\/wp\/v2\/tags?post=2167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}