<?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[appfleet - Medium]]></title>
        <description><![CDATA[Docker Hosting on the Edge - Medium]]></description>
        <link>https://medium.com/appfleet?source=rss----b6c4c2bbfcd6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>appfleet - Medium</title>
            <link>https://medium.com/appfleet?source=rss----b6c4c2bbfcd6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:06:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/appfleet" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[appfleet joins Cloudflare]]></title>
            <link>https://medium.com/appfleet/appfleet-joins-cloudflare-b51d2e407a11?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/b51d2e407a11</guid>
            <category><![CDATA[announcements]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 21:23:07 GMT</pubDate>
            <atom:updated>2021-08-03T21:23:07.335Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Summary:</strong></p><p>Due to a great synergy between our products, I am happy to announce that Cloudflare and appfleet are joining forces!</p><p>The appfleet platform is shutting down, with all clusters going offline on October 31st 2021.</p><p><strong>Long story:</strong></p><p>When we started working on appfleet our goal was to build an infinitely scalable edge compute platform while still offering an affordable and simple to use service. We embarked on our journey completely bootstrapped, a team of three developers and a lot of freelancers.</p><p>A year later we released a production-ready edge compute system. I am very proud of the work we did. We took a complex technology and made it simple to use for everyone, while staying affordable and accessible even by the smallest users.</p><p>And the market saw that: we had rapid growth of deployed clusters, deployments of new code and the underlying global VMs running the clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/0*BBkGkeYq72ixXg3J.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/0*QeagZlLRmxk9cuUP.png" /></figure><p>We were very happy and at the same time overwhelmed by the influx of new users, feedback and feature requests.</p><p>The venture capital firms (VCs) also noticed us. During some weeks I had multiple calls per day, every day, talking with different funds that were exploring the edge compute industry and really liked the idea of appfleet.</p><p>At the same time I was also working on migrating BootstrapCDN from the old infrastructure to the jsDelivr organization and a new CDN system.</p><p>Due to the huge size of BootstrapCDN I knew that only one CDN cared about the open source community enough to sponsor it for free — Cloudflare!</p><p>As we talked about the details of the new sponsorship, we touched upon the edge compute industry and the things we are doing with appfleet.</p><p>Cloudflare already has an incredible scale and made sure their Workers product was up to snuff. It’s an incredible service that allows anyone to run JS code globally in 200+ locations!</p><p>That’s a lot more than the five regions supported at appfleet.</p><p>Eventually we both saw that it made sense to join forces and continue working on this together to build the best edge compute platform out there.</p><p>At the end of the day the goal was to work with cool tech and build the perfect edge compute platform. And together with Cloudflare, this is something we are going to achieve while touching the lives of more developers and users than we ever could with appfleet.</p><p>So today I want to announce the incredible news that appfleet is going to join Cloudflare and continue building incredible tech, this time with access to the huge scale of Cloudflare and all of their available resources.</p><p>At the same time the appfleet platform is going to shut down with all clusters going offline on October 31st 2021. We will do our best to ensure zero downtime and will help all of our users to migrate away.</p><p>I am really excited about this and invite all of our users to explore Cloudflare Workers as an alternative to appfleet!</p><p><a href="https://dakulov.com/">Dmitriy Akulov</a>,</p><p>Founder of appfleet</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b51d2e407a11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/appfleet-joins-cloudflare-b51d2e407a11">appfleet joins Cloudflare</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 10 Container Orchestration Tools]]></title>
            <link>https://medium.com/appfleet/top-10-container-orchestration-tools-67c4d8d0d26e?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/67c4d8d0d26e</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 22 Mar 2021 19:17:06 GMT</pubDate>
            <atom:updated>2021-03-22T19:17:06.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q2ezs3YFk6SvC9mr.png" /></figure><h4>The Importance of Container Orchestration</h4><p>Containers have revolutionized how we distribute applications by allowing replicated test environments, portability, resource efficiency, scalability and unmatched isolation capabilities. While containers help us package applications for easier deployment and updating, we need a set of specialized tools to manage them.</p><p>To help with this, orchestration tools provide the framework through which we automate containerized workloads. Such tools help DevOps teams to manage the lifecycle of containers, and therefore implement their networking, load balancing, provisioning, scaling and more. As a result, orchestration tools help teams unlock the full benefits of containerization by offering application resilience, improved security and simplified operations.</p><p>Tasks performed using container orchestration tools include:</p><ul><li>Allocating resources among containers</li><li>Scaling containers up and down based on workloads</li><li>Routing traffic and balancing loads</li><li>Assigning services and applications to specific containers</li><li>Deployment and Provisioning</li></ul><p>In this article, let us find the some of the popular container orchestration tools that an organization can take use of.</p><h3>List of Top Container Orchestration Tools</h3><h4>1. <a href="https://kubernetes.io/">Kubernetes</a></h4><p>Kubernetes was developed by Google in 2008 and handed over to the Cloud Native Computing Foundation in 2014. As one of the most popular open-source container orchestration tool, Kubernetes offers a wide array of benefits, including auto-scaling and automated load balancing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HgLA8MkzcHQ32itx.png" /><figcaption>Image Source: <a href="https://kubernetes.io/">https://kubernetes.io/</a></figcaption></figure><p>The Kubernetes framework consists of four main components:</p><ul><li><strong>Node — </strong>In Kubernetes, a node is is responsible to run containerized workloads, and could either be physical or virtual. These machines serve as hosts for container runtimes, and also facilitate communication between containers and the Kubernetes service.</li><li><strong>Cluster — </strong>This is a set of nodes that share resources and run containerized applications.</li><li><strong>Replication Controllers — </strong>Intelligent agents responsible for scheduling and resource allocation among containers.</li><li><strong>Labels — </strong>These are tags that the Kubernetes service uses to identify containers that are members of a pod.</li></ul><p>Kubernetes continues to be a popular choice among developers being open-source platform of extensive tools that offers flexibility and ease of use by improving workflows and maximizing productivity. The platform also offers a large library of functionalities developed by communities all over the world, giving it unmatched microservice management capabilities. As a result, plenty of <em>managed out-of-the-box</em> orchestration solutions are developed based on the Kubernetes.</p><h4>2. <a href="https://www.openshift.com/">Red Hat OpenShift</a></h4><p>OpenShift was developed by Red Hat to provide a hybrid, enterprise-grade platform that extends Kubernetes functionalities to companies that require managed orchestration. The framework is built on an enterprise-grade Linux Operating System that lets you automate the lifecycle of your containerized application. This lets you easily manage all your workloads using a container to virtualize every host. More so, with its various templates and pre-built images, OpenShift lets you create databases, frameworks and other application services easily. As a result, you get a highly-optimized platform that standardizes production workflows, enables continuous integration and helps companies automate the management of releases. As an added advantage, the <a href="https://marketplace.redhat.com/en-us">Red Hat Marketplace</a> lets you purchase certified applications that can help in a range of areas, such as, billing, visibility, governance and responsive support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*XMurwV16xkGFupvF.png" /><figcaption>Image Source: <a href="https://www.openshift.com/">https://www.openshift.com</a></figcaption></figure><p>OpenShift offers both <strong>Platform-as-a-Service(PaaS)</strong> and <strong>Container-as-a-Service(CaaS)</strong> cloud service computing models. This essentially lets you either define your application source code in a Dockerfile or convert your source code to a container using a <strong>Source-to-Image</strong> builder.</p><h4>Key features of Redhat OpenShift include:</h4><ul><li>Built-in Jenkins pipelines streamline workflows, allowing faster production</li><li>Comes with an <strong>Integrated Container Runtime (CoreOS)</strong>, but also integrates well with <strong>Standard CRI-O</strong> and <strong>Docker Runtimes</strong></li><li>Supports SDN and validates integration with various networking solutions</li><li>Integrates various development and operations tools to offer <strong>Self-Service Container Orchestration</strong></li><li>Its <strong>Embedded Operator Hub</strong> grants administrators easy access to services such as Kubernetes Operators, third-party solutions and direct access to cloud service providers, such as AWS</li><li>OpenShift is an Open-Source, vendor-agnostic platform, without a vendor lock-in commitment</li></ul><h4>3. <a href="http://mesos.apache.org/">Apache Mesos</a></h4><p>Mesos is a cluster management tool developed by Apache that can efficiently perform container orchestration. The Mesos framework is open-source, and can easily provide resource sharing and allocation across distributed frameworks. It enables resource allocation using modern kernel features, such as <strong>Zones in Solaris</strong> and <strong>CGroups in Linux</strong>. Additionally, Mesos uses <strong><em>Chronos Scheduler </em></strong>to start and stop services, and the <strong><em>Marathon API </em></strong>to scale services and balance loads. To let developers define inter-framework policies, Mesos uses a pluggable application module .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/0*h4H6z1SQOVGZ6Q91.jpg" /><figcaption>Image Source: <a href="http://mesos.apache.org/">http://mesos.apache.org/</a></figcaption></figure><p>More details on the Mesos architecture can be found <a href="http://mesos.apache.org/documentation/latest/architecture/">here</a>.</p><h4>Key features of Apache Mesos include:</h4><ul><li>Linear scalability, allowing the deployment of 10,000s of nodes</li><li>Zookeeper integration for fault-tolerant master replication</li><li>APIs for developing new applications in Java, C++, etc.</li><li>Graphical User Interface for monitoring the state of your clusters</li><li>LXC isolation between tasks</li></ul><p>Advantages of using Mesos seem apparent as Apache claims to have build a number of software projects on Mesos, which include: Long running services such as <strong>Aurora, Marathon &amp; Singularity, Big Data Processing Solutions, Batch Scheduling</strong> and <strong>Data Storage Solutions</strong>.</p><h4>4. <a href="https://www.mirantis.com/software/docker/kubernetes/">Mirantis Kubernetes Engine</a></h4><p>Formerly known as Docker Enterprise Edition, Mirantis is an orchestration tool that lets you manage Kubernetes Clusters and Docker Swarms interchangeably to provide ultimate runtime flexibility. The solution offers multiple layers of security that include Role Based Access Control (RBAC) and built-in encryption, providing advanced authentication and access control. With its node-based isolation, Mirantis enables efficient multi-tenant architecture by offering a clear separation of resources. The Mirantis Engine uses Calico for Kubernetes networking and includes an Istio Ingress, enhancing load balancing and providing streamlined gateway controls. Mirantis allows development teams to ship code faster by providing a simple, consistent experience across all major cloud platforms, and offers a choice of various tools and frameworks you can use to improve application portability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PZQ2TbuEnUVTMdXq.png" /><figcaption>Image Source: <a href="https://www.mirantis.com/">https://www.mirantis.com/</a></figcaption></figure><p>Mirantis allows organizations to innovate and scale applications using its Drivetrain lifecycle management system. The tool integrates into the Mirantis Cloud platform to deliver regular updating and improvement of open-source software. Incremental updates are enabled via a Git repo, which reduces the cost and time of upgrades. Mirantis Drivetrain lifecycle enables a DevOps approach to development while also enabling a Continuous Delivery pipeline.</p><h4>Key features of Mirantis Kubernetes Engine include:</h4><ul><li>Easier management of containers using standard image builds</li><li>Mirantis isolation ensures security by having all applications running independently in different containers</li><li>Allows application portability across various platforms</li><li>Mirantis Drivetrain enables continuous integration for faster deployment</li></ul><h4>5. <a href="https://github.com/spotify/helios">Helios</a></h4><p>Developed by Spotify, Helios helps developers orchestrate Docker containers by deploying them across distributed servers. Helios is particularly popular with developers due to its pragmatic nature and its functionalities that enhance CI/CD pipelines. The platform also fits seamlessly with most DevOps workflows, that doesn’t require specific Operating Systems, Cloud Services or Network Topologies to manage containers. As an added advantage, Helios documents cluster history, with a log of events such as restarts, deployments and version changes. This essentially helps developers identify root causes or security vulnerabilities efficient using either a HTTP API Client or Command Line Interface.</p><h4>Key features of Helios include:</h4><ul><li>Easily integrates with DevOps philosophy</li><li>Vendor-agnostic, works well with any platform or network</li><li>Can run both single and multi-node instances</li><li>Does not require Apache Mesos as a prerequisite to run Helios</li><li>Does not depend on prescribed load balancers and routers</li></ul><h4>6. <a href="https://aws.amazon.com/ecs/">Amazon Elastic Container Service (Amazon ECS)</a></h4><p>With Amazon ECS, organizations can easily deploy and run container clusters on Amazon’s Elastic Container (EC2) instances. Amazon ECS offers a secure, reliable, and highly scalable orchestration platform, making it appropriate for sensitive and mission critical applications without wasting compute resources. Amazon ECS easily integrates with <a href="https://aws.amazon.com/fargate/">Amazon Fargate</a>, a serverless computing tool, that lets developers specify resource requirements and eliminates the need for server provision. This lets organizations to focus more on streamlining applications rather than managing infrastructure. It is also easy to cost-optimize your application using Fargate Spot tasks and EC2 Spot instances, cutting off up to 90% of your infrastructure provision fees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TFr-r3cddbuiRCdW.png" /><figcaption>Image Source: <a href="https://aws.amazon.com/">https://aws.amazon.com/</a></figcaption></figure><p>ECS allows you to use <strong>Network Access Control Lists (ACLs)</strong> and <strong>Amazon Virtual Private Clouds (VPCs)</strong> for resource isolation and security. Possibly one of the key features of ECS is that it is available in 69 availability zones and 22 regions globally, guaranteeing peace of mind regarding uptime, reliability, and low latency.</p><h4>Key features of AWS ECS include:</h4><ul><li>ECS Supports Fargate, a serverless AWS offering, that eliminates the need to manage servers</li><li>Includes Capacity Providers which dynamically determine compute resources required to run your application</li><li>Help optimize costs using spot instances for non-persistent workloads</li><li>ECS creates Amazon VPCs for your containers, ensuring no sharing of resources between tenants</li><li>Container Registry makes applications compatible within multiple environments</li></ul><h4>7. <a href="https://cloud.google.com/kubernetes-engine">Google Kubernetes Engine (GKE)</a></h4><p>GKE is a managed orchestration service that provides an easy-to-use environment to deploy, manage and scale Docker containers on the Google Cloud Platform. While doing so, the service engine lets you create agile and serverless applications without compromising security. With multiple release channels offering different node upgrade cadences, GKE makes it easier to streamline operations based on application needs. Through its enterprise-ready, pre-built deployment templates GKE enables enhanced developer productivity across multiple layers of a DevOps workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/0*eaNbnzJpMUAZoFGF.png" /><figcaption>Image Source: <a href="https://cloud.google.com/">https://cloud.google.com/</a></figcaption></figure><p>For developers, the service engine helps streamline every stage of the SDLC using native CI/CD tooling accelerators, while Site Reliability Engineers (SREs) may utilize GKE for ease of infrastructure management by monitoring resource usage, clusters and networks.</p><h4>Key features of GKE include:</h4><ul><li>GKE offers rapid, regular and stable release channels, allowing developers to streamline operations</li><li>The platform sets up the baseline functionality and automates cluster management for ease of use</li><li>Integrates native Kubernetes tooling so organizations can develop applications faster without compromising security</li><li>Google Site Reliability Engineers offer support in the management of infrastructure</li><li>Google consistently improves the GKE platform with new features and enhancements, making it robust and reliable</li><li>Well-documented platform, making all its features easy to learn and use</li></ul><h4>8. <a href="https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-overview">Azure Service Fabric</a></h4><p>Microsoft’s Azure Service Fabric is a <strong>Platform-as-a-Service</strong> solution that lets developers focus on business logic and application development by making container deployments, packaging and management a lot easier. Service Fabric lets companies deploy and manage microservices across distributed machines, allowing the management of both <strong>stateful</strong> and<strong> stateless </strong>services. It also integrates seamlessly with CI/CD tools to help manage application life cycles while letting you create and manage clusters across different environments, including Linux, Windows Server, Azure on-premises and other public cloud offerings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*31hxD7VqBwdXVONo.png" /><figcaption>Image Source: <a href="https://docs.microsoft.com/">https://docs.microsoft.com/</a></figcaption></figure><p>Service Fabric uses a .NET SDK to integrate with popular Windows Software Development Kits, such as PowerShell and Visual Studio. To integrate with Linux development solutions, such as Eclipse, it uses a Java SDK. Service Fabric is available across all Azure regions, and is included on all Azure Compliance Certifications.</p><h4>Key features of Azure Service Fabric include:</h4><ul><li>Service Fabric allows management of containerized applications on both <strong>stateful</strong> and <strong>stateless</strong> services</li><li>Can be used for <em>lift &amp; shift</em> migration using guest executables for legacy applications</li><li>Enables a Serverless Compute experience, so organizations don’t have to worry about backend provisioning</li><li>The Azure platform is data-aware, improving workload performance while reducing latency</li><li>Makes applications resilient by running different tracks for different servers hosting different microservices</li></ul><p>Azure Fabric Service can be teamed up with CI/CD services such as the Visual Studio Team Services to ensure successful migration of existing apps to the cloud. This makes it easy to debug applications remotely and seamless monitoring using the Operations Management Suite.</p><h4>9. <a href="https://aws.amazon.com/eks/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc&amp;eks-blogs.sort-by=item.additionalFields.createdDate&amp;eks-blogs.sort-order=desc">Amazon Elastic Kubernetes Service (EKS)</a></h4><p>Amazon EKS helps developers create, deploy and scale Kubernetes applications on-premises or in the AWS cloud. EKS automates tasks such as patching, updates and node provisioning, thereby helping organizations to ship reliable, secure and highly scalable clusters. While doing so, EKS takes away all the tedium and manual configuration tasks to manage Kubernetes clusters, helping to cut-down on efforts of performing repetitive tasks to run your applications.</p><p>Since EKS is an upstream offering of Kubernetes, you can use all existing Kubernetes plugins and tools for your application. This service automatically deploys Kubernetes with three master nodes across multiple availability zones for ultimate reliability and resilience. With Role Based Access Control (RBAC) and Amazon’s Identity and Access Management (IAM) entities, you can easily manage security in your AWS clusters using Kubernetes tools, such as <strong>kubectl. </strong>As one of its core features, EKS allows launching and managing Kubernetes clusters easy using a few easy steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YrRhMqXmESAcDfL9.png" /><figcaption>Image Source: <a href="https://aws.amazon.com/eks/">https://aws.amazon.com/eks/</a></figcaption></figure><h4>Key features of AWS EKS include:</h4><ul><li>EKS provides a flexible Kubernetes Control Plane available across all regions. This makes Kubernetes applications hosted on EKS highly available and scalable.</li><li>You can directly manage your applications from Kubernetes using AWS Controllers for Kubernetes</li><li>Extending the functionality of your Kubernetes cluster is simple thanks to EKS Add-ons</li><li>Easily scale, create, update and terminate nodes from your EKS cluster using a single command</li><li>Compatibility between EKS and Kubernetes clusters ensures a simple, code-free migration to AWS cloud</li><li>EKS implements automatic patches and identifies non-functioning masters, ensuring application reliability</li></ul><p>Amazon EKS prevents single failure points of Kubernetes cluster by running it across multiple availability zones. This makes the application reliable, resilient and secure since by reducing the Mean-time-to-Recovery (MTTR). Additionally, as a Managed Kubernetes platform, Amazon’s EKS makes your application optimized and scalable through a rich ecosystem of services that eases container management.</p><h4>10. <a href="https://docs.docker.com/engine/swarm/">Docker Swarm</a></h4><p>Swarm is the native container orchestration platform for Docker applications. In Docker, a <strong><em>Swarm </em></strong>is a group of machines (physical or virtual) that work together to run Docker applications. A Swarm Manager controls activities of the swarm, and helps manage the interactions of containers deployed on different host machines (nodes). Docker Swarm fully leverages the benefits of containers, allowing highly portable and agile applications while offering redundancy to guarantee high availability for your applications. Swarm managers also assign workloads to the most appropriate hosts, ensuring proper load balancing of applications. While doing so, the Swarm Manager ensures proper scaling by adding and removing worker tasks to help maintain a cluster’s desired state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*3OuNKCFORytayMvD.png" /><figcaption>Image Source: <a href="https://docs.docker.com/engine/swarm/">https://docs.docker.com/engine/swarm/</a></figcaption></figure><h4>Key features of Docker Swarm include:</h4><ul><li>Manager nodes help with load balancing by assigning tasks to the most appropriate hosts</li><li>Docker Swarm uses redundancy to enable high service availability</li><li>Swarm containers are lightweight and portable</li><li>Tightly integrated into the Docker Ecosystem, allowing easier management of containers</li><li>Does not require extra plugins for setup</li><li>Ensures high scalability by balancing loads and bringing up worker nodes when workload increases</li><li>Docker Swarm’s distributed environment allows for decentralized access and collaboration</li></ul><p>As Docker remains one of the most used container runtimes, Docker Swarm proves to be an efficient container orchestration tool. Swarm makes it easy to scale, update applications and balance workloads. This makes it perfect for application deployment and management even when dealing with extensive clusters.</p><h4>Conclusion</h4><p>As more cloud deployment technologies emerge, container orchestration tools will keep evolving. As with every technology, each option has its benefits and drawbacks. Managed Service Platforms, such as GKE, EKS and Mirantis, provide unmatched functionality while incurring little costs. Other offerings, like Kubernetes and Docker Swarm should be evaluated for the trade-offs in performance, complexity and flexibility before adoption.</p><p>With that in mind, it is equally important to note that orchestration tools are cost and effort intensive. An efficient alternative to this is<a href="https://appfleet.com/"> <strong>appfleet’s global edge platform</strong></a> for deploying and hosting containerized applications. With appfleet, you do not have to spend time building a team to manage a mammoth clustering framework, learning a new technology, or digging through thousands of lines of documentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67c4d8d0d26e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/top-10-container-orchestration-tools-67c4d8d0d26e">Top 10 Container Orchestration Tools</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[appfleet is now production ready!]]></title>
            <link>https://medium.com/appfleet/appfleet-is-now-production-ready-d2aa8c263fa?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/d2aa8c263fa</guid>
            <category><![CDATA[announcements]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 01 Mar 2021 09:55:31 GMT</pubDate>
            <atom:updated>2021-03-01T09:55:31.073Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-oJPt7Ud7LCXP3V0.png" /></figure><p>First of all what is appfleet? <a href="https://appfleet.com/">appfleet is an edge compute platform</a> that allows people to deploy their web applications globally. Instead of running your code in a single centralized location you can now run it everywhere, at the same time.</p><p>In simpler terms appfleet is a next-gen CDN, instead of being limited to only serving static content closer to your users you can now do the same thing for your whole codebase. Run the whole thing where just your cache used to be.</p><p>Check out our video explainer too <a href="https://www.youtube.com/watch?v=7n617ZF-oT4">https://www.youtube.com/watch?v=7n617ZF-oT4</a></p><p>This results in drastic performance improvement, lower latency, better uptime and an enormous amount of new use-cases and possibilities.</p><p>In part it’s because we are not limiting our users to HTTP services. You have complete freedom to run any kind of service over any protocol you want, on any port.</p><p>Do you want to build your own global nameservers? Deploy a container running a DNS server over UDP port 53. It takes only a few clicks. A globally distributed database? Sure thing. Or something simple like image optimization on the edge? No problem. How about a monstrous container running a web service, redis, ssh, DNS, MySQL and an admin service all on different ports, all at the same time? Who are we to stop you, go ahead!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WKk6rcsQHLoj35jF.png" /><figcaption>The appfleet dashboard showing your deployed applications</figcaption></figure><p>We launched our closed beta quite a while ago. And since then we have worked with many developers and business owners to improve our platform and support the many exciting use-cases that people kept coming up with.</p><p>And while the system was technically ready to accept real customers months ago, we decided it was best to stay in beta and ensure the stability of the platform.</p><p>Since then we have polished our user-experience, redesigned many parts of our UI multiple times and made sure our backend is ready for whatever people throw at it.</p><p>Do you know what is the first thing people run when given a container and asked to test it? They run a fork bomb. Of course we were ready for that and while the specific instance became unavailable it had no impact on our system or other clients. All thanks to the multiple layers of isolation we have built. And nowadays the instance won’t even go down, so fork-bomb away.</p><p>Each container runs in a virtualized box of its own, with its own resources, filesystem and security in place. Security and stability were top priorities for us and everything we built had that in mind.</p><p>Whenever we were working on a new feature we kept asking ourselves “What if?”. “What if this system goes down?”, “What if the user does something unexpected?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X6WHsmdj5KyXMqNR.png" /><figcaption>appfleet cluster creation process and region selection</figcaption></figure><p>appfleet is based on multiple services and modules interacting with each other. We made sure that even if something breaks, like our whole API goes down, or our DB, or anything else really, the already running applications would not feel a thing. Everything is built to run in standalone mode and if the worst happens to wait until things get better.</p><p>We also drew from our experience building and maintaining <a href="https://www.jsdelivr.com/">jsDelivr</a>, a free CDN for open source projects that currently serves 100 billion requests every month and more than 3 Petabytes of traffic! It is used by millions of websites all over the world and all of them trust us to ensure it never goes down. We integrated multiple levels of failover with multiple checks on every step to ensure the system can automatically handle different kinds of issues and fix itself.</p><p>The appfleet platform was built to be as simple as possible and make edge compute accessible to everyone, from open source projects, to solo developers and even big enterprises that need something that works without relying on an army of DevOps engineers. This is one of the reasons we decided to build on top of containers, this allows our users to easily migrate to or from appfleet and to even run legacy applications.</p><p>Today March 1st 2021 is the beginning of a long an exciting journey to make the web faster and accessible to all!</p><p><a href="https://dashboard.appfleet.com/register">Register now and get $10 of free credits</a> to use as you see fit. No need to enter your credit card until you are ready for production workloads.</p><p>And if you are a non-profit or an open source project let us know to get sponsored with free services. We even <a href="https://github.com/jsdelivr/jsdelivr/issues/18154">offer free design services</a></p><p>Join us and make sure you send us your feedback and ideas! Even better email the founder directly at d@appfleet.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2aa8c263fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/appfleet-is-now-production-ready-d2aa8c263fa">appfleet is now production ready!</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Practices and Considerations for Multi-Tenant SaaS Application Using AWS EKS]]></title>
            <link>https://medium.com/appfleet/best-practices-and-considerations-for-multi-tenant-saas-application-using-aws-eks-6281ae159cb?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/6281ae159cb</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Wed, 04 Nov 2020 20:41:10 GMT</pubDate>
            <atom:updated>2020-11-04T20:41:10.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NhUFhvliKfqifLXD.png" /></figure><p>Today, most organizations, large or small, are <a href="https://appfleet.com/">hosting</a> their SaaS application on the cloud using multi-tenant architecture. There are multiple reasons for this, but the most simple and straightforward reasons are cost and scalability. In a multi-tenant architecture, one instance of a software application is shared by multiple tenants (clients). These tenants share various resources such as databases, web servers, computing resources, etc., that make multi-tenant architecture cost-efficient while keeping scalability in mind.</p><p><a href="https://appfleet.com/blog/amazon-elastic-container-service-for-kubernetes-eks/"><strong>Amazon EKS</strong> (Elastic Kubernetes Service)</a> is one of the most popular container orchestration platforms offered by AWS, which is popularly used host multi-tenant SaaS applications. However, while adopting a multi-tenancy framework, it is also important to note the challenges that might prevail due to cluster resource sharing.</p><p>Let us delve into the best practices and considerations for multi-tenant SaaS applications using Amazon EKS in this article.</p><h4>Practice 1: Separate Namespaces for Each Tenant (Compute Isolation)</h4><p>Having separate namespaces remains an essential consideration while deploying a multi-tenant SaaS application, as it essentially divides a single cluster resource across multiple clients. Namespaces in a multi-tenant architecture are the primary unit of isolation in <a href="https://appfleet.com/blog/local-kubernetes-testing-with-kind/">Kubernetes</a>. As one of its core features, Amazon EKS helps you create a separate namespace for each tenant running the SaaS application. This attribute aids in isolating every tenant and its own environment within the corresponding Kubernetes cluster, thereby enforcing data privacy in the sense that you don’t have to create different clusters per tenant. This aspect eventually brings substantial cost reduction in compute resources and AWS hosting costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*OeG8zHUZUp57PmVE.png" /><figcaption>Source — <a href="https://aws.amazon.com/">https://aws.amazon.com/</a></figcaption></figure><h4>Practice 2: Setting ResourceQuota on Resource Consumption</h4><p>A multi-tenant SaaS application serves several tenants, with each of them accessing the same Kubernetes cluster resources concurrently. Often there would be scenarios where a particular tenant consume resources disproportionately to exhaust all the cluster resources on its own, without leaving resources to be used by other tenants. To avoid such instances of capacity downtime the <strong>ResourceQuota</strong> concept comes to rescue, with which you can set limit on the resources the containers (hosting the SaaS application) can use.</p><p>Here is an example:</p><pre>apiVersion: v1<br>kind: ResourceQuota<br>metadata:<br>  name: resourceQuotaSetting<br>  namespace: tenant1<br>spec:<br>  hard:<br>    requests.cpu: &quot;2&quot;<br>    requests.memory: &quot;1Gi&quot;<br>    limits.cpu: &quot;4&quot;<br>    limits.memory: &quot;2Gi&quot;</pre><p>To get the above in context, once you set up the above configuration on Amazon EKS for resource quota, a container can only request 2 CPUs at a time while in total it can have only 4 CPUs concurrently. Additionally, it can request 1 Gi memory at a time, with the maximum memory limit defined as 2Gi. With this you essentially limit the usage of resources while ensuring that a particular tenant does not end up consuming all resources.</p><h4>Practice 3: Network Isolation using Network Policies</h4><p>By default, the Kubernetes production cluster allows namespaces to talk to each other. But if your SaaS application is running in a multi-tenant architecture, you would like to avoid that to bring in the isolation between different namespaces. To do that, you can use tenant isolation network policy and network segmentation on Amazon EKS. As a best practice, you can install <strong>Calico</strong> on Amazon EKS and assign network policies to pods as shown below.</p><p>For reference, the following policy allows traffic only from the same-namespace while restricting other traffic. The pods with label app: api in tenant-a namespace will only receive traffic from same-namespace. The communication of tenant-a with other tenants and vice-versa is being denied here to achieve network isolation.</p><pre>apiVersion: projectcalico.org/v3<br>kind: NetworkPolicy<br>metadata:<br>  name: same-namespace<br>  namespace: tenant-a<br>spec:<br>  podSelector:<br>	matchLabels:<br>  	app: api<br>  policyTypes:<br>  - ingress<br>  - egress<br>  ingress:<br>  - from:<br>	- namespaceSelector:<br>    	    matchLabels:<br>      	 nsname: tenant-a<br>  egress:<br>  - to:<br>	- namespaceSelector:<br>    	    matchLabels:<br>      	 nsname: tenant-a</pre><h4>Practice 4: Storage Isolation using PersistentVolume and PersistentVolumeClaim</h4><p>As opposed to a single-tenant framework, a multi-tenant framework requires a different approach to managing application storage. On Amazon EKS, you can assign and manage storage for different tenants seamlessly using PersistentVolume (PV). On the other hand, a storage request sent by a tenant is called referred as PersistentVolumeClaim (PVC). Since PVC is a namespaced resource, you can bring isolation of storage among different tenants easily.</p><p>In the example below for tenant1, we have configured PVC with ReadWriteOnce access mode and storage space of 2 Gi.</p><pre>apiVersion: v1<br>kind: PersistentVolumeClaim<br>metadata:<br>  name: pvc-storage<br>  namespace: tenant1<br>spec:<br>  accessModes:<br>	- ReadWriteOnce<br>  resources:<br>	requests:<br>  	storage: 2Gi</pre><h4>Practice 5: Amazon IAM Integration with Amazon EKS for Setting RBAC</h4><p>Just like any other AWS service, EKS integrates with AWS IAM to administer Role-Based Access Control (RBAC) on a Kubernetes cluster. Through the AWS IAM authenticator, you can authenticate any tenant namespace to a Kubernetes cluster. To use IAM on multi-tenancy, you need to add the tenant’s (user) IAM role inside aws-auth configmap for authenticating the tenant&#39;s namespace. Once the authentication is successful by AWS IAM, defined <strong>Role </strong>(namespaced resource) and/or <strong>ClusterRole </strong>(non-namespaced resource) for a particular tenant&#39;s namespace will be implemented on the cluster. By provisioning <strong>ClusterRole</strong> and <strong>Role</strong> policies on the cluster, you can adopt a hardened security posture on a multi-tenant SaaS application.</p><h4>Practice 6: Manage Tenant Placement on Kubernetes nodes</h4><p>Similar to the default Kubernetes service, Amazon EKS provides <strong>Node Affinity</strong> and <strong>Pod Affinity</strong> for managing tenant placement on Kubernetes nodes through which you can use taint and toleration. Using Node Affinity, you can decide on which node you want to run a particular tenant’s pod. On the other hand, using Pod Affinity you can decide if tenant 1 and tenant 2 should be on the same or on different nodes.</p><p>With the command below, no pods will be scheduled on node 1 until it matches the toleration arguments, while the <em>key value</em> (client) must be tenant1. With this method, you can run pods on a particular node just for a particular tenant.</p><pre>kubectl taint nodes node1 client=tenant1:NoSchedule</pre><p>This is how a pod configuration looks like:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: ubuntu<br>  labels:<br>   env: prod<br>spec:<br>  containers:<br>  - name: ubuntu<br>	image: ubuntu<br>	imagePullPolicy: IfNotPresent<br>tolerations:<br>  - key: “client”<br>	operator: &quot;Equal&quot;<br>	value: “tenant1”<br>	effect: &quot;NoSchedule&quot;</pre><h4>Conclusion</h4><p>That was all about the best practices and considerations for running a multi-tenant SaaS application on Amazon EKS. A multi-tenant SaaS application on EKS provides you with multiple possibilities for compute, network, storage isolations, while keeping the workflow secured. Go ahead and try out these practices and let us know your experience.</p><p>Alternately, if you have any additional best practices to share, do let us know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6281ae159cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/best-practices-and-considerations-for-multi-tenant-saas-application-using-aws-eks-6281ae159cb">Best Practices and Considerations for Multi-Tenant SaaS Application Using AWS EKS</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Ansible and Docker for a CI/CD Pipeline Using Jenkins]]></title>
            <link>https://medium.com/appfleet/integrating-ansible-and-docker-for-a-ci-cd-pipeline-using-jenkins-5d6020bab2fb?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d6020bab2fb</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 12:01:08 GMT</pubDate>
            <atom:updated>2020-09-21T12:01:08.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SjyHMvNVOQFwZL_-.png" /></figure><p>In this guide, we will use Ansible as a Deployment tool in a Continuous Integration/Continuous Deployment process using Jenkins Job.</p><p>In the world of CI/CD process, Jenkins is a popular tool for provisioning development/production environments as well as application deployment through pipeline flow. Still, sometimes, it gets overwhelming to maintain the application’s status, and script reusability becomes harder as the project grows.</p><p>To overcome this limitation, Ansible plays an integral part as a shell script executor, which enables Jenkins to execute the workflow of a process.</p><p>Let us begin the guide by installing Ansible on our Control node.</p><h4>Install and Configure Ansible</h4><p><strong>Installing Ansible:</strong><br> Here we are using CentOS 8 as our Ansible Control Node. To install Ansible, we are going to use python2-pip, and to do so, first, we have to install python2. Use the below-mentioned command to do so:</p><pre># sudo yum update<br># sudo yum install python2</pre><p>After Python is installed on the system, use pip2 command to install Ansible on the Control Node:</p><pre># sudo pip2 install ansible<br># sudo pip2 install docker</pre><p>It might take a minute or two to complete the installation, so sit tight. Once the installation is complete, verify:</p><pre># ansible --version<br> <br>ansible 2.9.4<br>  config file = None<br>  configured module search path = [u&#39;/root/.ansible/plugins/modules&#39;, u&#39;/usr/share/ansible/plugins/modules&#39;]<br>  ansible python module location = /usr/lib/python2.7/site-packages/ansible<br>  executable location = /usr/bin/ansible<br>  python version = 2.7.16 (default, Nov 17 2019, 00:07:27) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]</pre><p>Through the above command, we notice that the config file path is missing, which we will create and configure later. For now, let’s move to the next section.</p><p><strong>Configuring Ansible Control Node User:</strong><br> The first thing we are going to do is create a user named ansadmin, as it is considered the best practice. So let’s create a user, by using the command adduser, which will create a new user to our system:</p><pre># useradd ansadmin</pre><p>Now, use the passwd command to update the ansadmin user’s password. Make sure that you use a strong password.</p><pre># passwd ansadmin<br><br>Changing password for user ansadmin.<br>New password: <br>Retype new password: <br>passwd: all authentication tokens updated successfully.</pre><p>Copy the password for user ansadmin and save it somewhere safe.</p><p>Once we have created the user, it’s time to grant sudo access to it, so it doesn’t ask for a password when we log in as root. To do so, follow the below-mentioned steps:</p><pre># nano /etc/sudoers</pre><p>Go to the end of the file and paste the below-mentioned line as it is:</p><pre>...<br>ansadmin ALL=(ALL)       NOPASSWD: ALL<br>...</pre><p>Before moving forward, we have one last thing to do. By default, SSH password authentication is disabled in our instance. To enable it, follow the below-mentioned steps:</p><pre># nano /etc/ssh/sshd_config</pre><p>Find PasswordAuthentication, uncomment it and replace no with yes, as shown below:</p><pre>...<br>PasswordAuthentication yes<br>...</pre><p>You will see why we are doing this in the next few steps. To reflect changes, reload the ssh service:</p><pre># service sshd reload</pre><p>Now, log in as an ansadmin user on your Control Node and generate ssh key, which we will use to connect with our remote or managed host. To generate the private and public key, follow the below-mentioned commands:</p><pre># su - ansadmin</pre><p>Use ssh-keygen command to generate key:</p><pre># ssh-keygen<br><br>Enter file in which to save the key (/home/ansadmin/.ssh/id_rsa): ansible-CN   <br>Enter passphrase (empty for no passphrase): <br>Enter same passphrase again: <br>Your identification has been saved in ansible-CN.<br>Your public key has been saved in ansible-CN.pub.<br>The key fingerprint is:<br>SHA256:6G0xzIrIsmsBwCakACI8CVr8AOuRR8v5F1p2+CsB6EY ansadmin@ansible-host<br>The key&#39;s randomart image is:<br>+---[RSA 3072]----+<br>|&amp;+o.             |<br>|OO* +   .        |<br>|Bo.E . = .       |<br>|o = o =++        |<br>|.. o o.oS.       |<br>| o.. o.o.o.      |<br>|. + . o.o.       |<br>| +     ..        |<br>|+.               |<br>+----[SHA256]-----+</pre><p>Usually, keys are generated in the .ssh/ directory. In our case, you can find keys at /home/ansadmin/.ssh/. Now let us configure our Managed Host for Ansible.</p><p><strong>Configuring Ansible Managed Host User:</strong><br> First, we will create a user on our managed host, so log in to your host and create a user with the same name and password.</p><p>As our managed host is an Ubuntu machine, therefore here we have to use the adduser command. Please make sure that the password for the username ansadmin is the same for Control and Managed Host.</p><pre># adduser ansadmin<br># su - ansadmin</pre><p>Other than this, it is also an excellent thing to cross-check if password authentication is enabled on the Managed Host as we need to copy the ssh public key from the control node to the Managed Host.</p><p>Switch to Control Node machine; to copy the public key to our Managed Host machine, we will use the command ssh-copy-id:</p><pre>$ su - ansadmin<br>$ ssh-copy-id -i .ssh/ansible-CN.pub ansadmin@managed-host-ip-here</pre><p>For the first time, it will ask for the password. Enter the password for ansadmin, and you are done. Now, if you wish, you can disable Password Authentication on both machines.</p><p><strong>Setting Ansible Inventory:</strong><br> Ansible allows us to manage multiple nodes or hosts at the same time. The default location for the inventory resides in /etc/ansible/hosts. In this file, we can define groups and sub-groups.</p><p>If you remember, earlier, the hosts’ file was not created automatically for our Ansible. So let’s create one:</p><pre># cd /etc/ansible<br># touch hosts &amp;&amp; nano hosts</pre><p>Add the following lines in your hosts’ file and save it:</p><pre>[docker_group]<br>docker_host ansible_host=your-managed-host-ip ansible_user=ansadmin ansible_ssh_private_key_file=/home/ansadmin/.ssh/ansible-CN ansible_python_interpreter=/usr/bin/python3<br>ansible_CN ansible_connection=local</pre><p>Make sure that you replace your-managed-host-ip with your host IP address.</p><p>Let’s break down the basic INI format:</p><ul><li>docker_group - Heading in brackets is your designated group name.</li><li>docker_host &amp; ansible_CN - The first hostname is docker_host, which points to our Managed Host. While the second hostname is ansible_CN, which is pointing towards our localhost, to be used in Ad-Hoc commands and Playbooks.</li><li>ansible_host - Here, you need to specify the IP address of our Managed Host.</li><li>ansible_user - We mentioned our Ansible user here.</li><li>ansible_ssh_private_key_file - Add the location of your private key.</li><li>ansible_python_interpreter - You can specify which Python version you want to use; by default, it will be Python2.</li><li>ansible_connection - This variable helps Ansible to understand that we are connecting the local machine. It also helps to avoid the SSH error.</li></ul><p>It is time to test our Ansible Inventory, which can be done through the following command. Here we are going to use a simple Ansible module <strong><em>PING</em></strong>:</p><pre># ansible all -m ping<br>ansible_CN | SUCCESS =&gt; {<br>    &quot;ansible_facts&quot;: {<br>        &quot;discovered_interpreter_python&quot;: &quot;/usr/libexec/platform-python&quot;<br>    }, <br>    &quot;changed&quot;: false, <br>    &quot;ping&quot;: &quot;pong&quot;<br>}<br>docker_host | SUCCESS =&gt; {<br>    &quot;ansible_facts&quot;: {<br>        &quot;discovered_interpreter_python&quot;: &quot;/usr/bin/python3&quot;<br>    }, <br>    &quot;changed&quot;: false, <br>    &quot;ping&quot;: &quot;pong&quot;<br>}</pre><p>It looks like the Ansible system can now communicate with our Managed Host as well as with the localhost.</p><h4>Install Docker:</h4><p>We need a Docker ready system to manage our process; for this, we have to install Docker on both systems. So follow the below-mentioned steps:</p><p><strong>For CentOS (Control Node):</strong><br> Run the following command on your Control Node:</p><pre># sudo yum install -y yum-utils device-mapper-persistent-data lvm2<br> <br># sudo yum-config-manager --add-repo \  https://download.docker.com/linux/centos/docker-ce.repo<br> <br># sudo yum install docker-ce docker-ce-cli containerd.io</pre><p>In case you encounter the below-mentioned error during installation:</p><pre>Error: <br> Problem: package docker-ce-3:19.03.5-3.el7.x86_64 requires containerd.io &gt;= 1.2.2-3, but none of the providers can be installed</pre><p>Next, run the following command:</p><pre># sudo yum install docker-ce docker-ce-cli containerd.io --nobest</pre><p><strong>For Ubuntu OS (Managed Host):</strong><br> Run the following command on your Managed Host, which is a Ubuntu-based machine:</p><pre>$ sudo apt-get remove docker docker-engine docker.io containerd runc<br> <br>$ sudo apt-get update &amp;&amp; sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common<br><br>$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -<br><br>$ sudo apt-get update &amp;&amp; sudo apt-get install docker-ce docker-ce-cli containerd.io</pre><p>That’s it for this section. Next, we are going to cover how to integrate Ansible with Jenkins.</p><h4>Integrating Ansible with Jenkins:</h4><p>In this section, we will integrate Ansible with Jenkins. Fire up your Jenkins, go to Dashboard &gt; Manage Jenkins &gt; Manage Plugins &gt; Available and then search for <em>Publish Over SSH</em> as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xJFH1JTpK1K5BaHw.png" /></figure><p>Now, go to <em>Configure System</em> and find <em>Publish over SSH</em>; under this section, go to <em>SSH Servers</em> and click on the <em>Add</em> button. Here we are going to add our Docker Server as well as Ansible Server, as shown in the image:</p><p>SSH server setting for Docker:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kAUFFMN7mAWYJelt.png" /></figure><p>SSH server setting for Ansible:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*R73vY4BqX_dnNRRS.png" /></figure><p>In the <em>Hostname</em> field, add your IP address or domain name of Docker and Ansible server. Before saving the setting, make sure that you test the connection before saving the configuration, by clicking on the Test Configuration button as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0bbkR-Hfg85Sngh9.png" /></figure><h4>Create Jenkins Job</h4><p>The next step is to create Jenkins jobs. The sole propose of this Job is to build, test, and upload the artifact to our Ansible Server. Here we are going to create Job as a Maven Project, as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tnykBO2EB9yQlNcS.png" /></figure><p>Next in Job setting page, go to the <em>Source Code Management</em> section and add your Maven project repo URL, as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m52m--ka6_PNF02g.png" /></figure><p>Find the <em>Build</em> section, and in <em>Root POM</em> field enter your pom.xml file name. Additionally in the <em>Goals and options</em> field enter clean install package:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/0*cUQtavLmyD0DGsHn.png" /></figure><p>After successful build completion, your goal is to send the <em>war</em> file to the specified directory to your Ansible server with the right permissions so that it doesn’t give us the writing permission by assigning ansadmin to the directory.</p><p>Right now, we don’t have such a directory, so let us create one. Follow the below-mentioned steps:</p><pre># sudo su<br># mkdir /opt/docker<br># chown ansadmin:ansadmin /opt/docker -R<br># ls -al /opt/docker/<br><br>total 0<br>drwxr-xr-x. 2 ansadmin ansadmin  6 Jan 31 16:57 .<br>drwxr-xr-x. 4 root     root     38 Jan 31 17:10 ..</pre><p>Directory /opt/docker will be used as our workspace, where Jenkins will upload the artifacts to Ansible Server.</p><p>Now, go to the <em>Post-build Actions</em> section and from the drop-down menu, select <em>Send build artifacts over SSH</em>, as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OEIYG0t6WqSzkgbX.png" /></figure><p>Make sure that in the <em>Remote Directory</em> field, you enter the pattern //opt//docker as it doesn’t support special characters. Apart from this, for now, we are going to leave the <em>Exec Command</em> field empty so that we can test whether our existing configuration works or not.</p><p>Now <em>Build</em> the project, and you will see the following output in your Jenkins’s console output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lGhWHffdB02DMrbn.png" /></figure><p>Go to your Ansible Server terminal and see if the artifact was sent with right user privileges:</p><pre># ls -al /opt/docker/<br><br>total 4<br>drwxr-xr-x. 2 ansadmin ansadmin   24 Feb  3 10:54 .<br>drwxr-xr-x. 4 root     root       38 Jan 31 17:10 ..<br>-rw-rw-r--. 1 ansadmin ansadmin 2531 Feb  3 10:54 webapp.war</pre><p>It looks like our webapp.war file was transferred successfully. In the following step, we will create an Ansible Playbook and Dockerfile.</p><h4>Creating Dockerfile and Ansible Playbook:</h4><p>To create a Docker Image with the webapp.war file, first, we will create a DockerFile. Follow the below-mentioned steps:</p><p>First, log in to your Ansible Server and go to directory /opt/docker and create a file named as Dockerfile:</p><pre># cd /opt/docker/<br># touch Dockerfile</pre><p>Now open the Dockerfile in your preferred editor, and copy the below-mentioned lines and save it:</p><pre>FROM tomcat:8.5.50-jdk8-openjdk<br>MAINTAINER Your-Name-Here<br>COPY ./webapp.war /usr/local/tomcat/webapps</pre><p>Here instructions are to pull a Tomcat image with tag 8.5.50-jdk8-openjdk and copying the webapp.war file to Tomcat default webapp directory., which is /usr/local/tomcat/webapps</p><p>With the help of this Dockerfile, we will create a Docker container. So let us create the Ansible Playbook, which will enable us to automate the Docker image build process and later run the Docker container out of it.</p><p>We are creating a Ansible Playbook, which does two tasks for us:</p><ol><li>Pull Tomcat’s latest version and build an image using webapp.war file.</li><li>Run the built image on the desired host.</li></ol><p>For this, we are going to create a new YAML format file for your Ansible Playbook:</p><pre># nano simple-ansible.yaml</pre><p>Now copy the below-mentioned line into your simple-ansible.yaml file:</p><pre>---<br>#Simple Ansible Playbook to build and run a Docker containers<br> <br>- name: Playbook to build and run Docker<br>  hosts: all<br>  become: true<br>  gather_facts: false<br> <br>  tasks:<br>    - name: Build a Docker image using webapp.war file<br>      docker_image:<br>        name: simple-docker-image<br>        build:<br>          path: /opt/docker<br>          pull: false<br>        source: build<br> <br>    - name: Run Docker container using simple-docker-image<br>      docker_container:<br>        name: simple-docker-container<br>        image: simple-docker-image:latest<br>        state: started<br>        recreate: yes<br>        detach: true<br>        ports:<br>          - &quot;8888:8080&quot;</pre><p>You can get more help here: <a href="https://docs.ansible.com/ansible/latest/modules/docker_image_module.html">docker_image</a> and <a href="https://docs.ansible.com/ansible/latest/modules/docker_container_module.html">docker_container</a>. Now, as our Playbook is created, we can run a test to see if it works as planned:</p><pre># cd /opt/docker<br># ansible-playbook simple-ansible-playbook.yaml --limit ansible_CN</pre><p>Here we have used the --limit flag, which means it will only run on our Ansible Server (Control Node). You might see the following output, in your terminal window:</p><pre>PLAY [Playbook to build and run Docker] <br>***************************************************************************<br> <br>TASK [Build Docker image using webapp.war file] <br>***************************************************************************<br>changed: [ansible_CN]<br> <br>TASK [Run Docker image using simple-docker-image]<br>***************************************************************************<br>changed: [ansible_CN]<br> <br>PLAY RECAP <br>***************************************************************************<br>ansible_CN                 : ok=2    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0</pre><p>Look’s like Playbook ran sccessfully and no error was detected during the Ansible Playbook check, so now we can move to Jenkins to complete our CI/CD process using Ansible.</p><h4>Run Ansible Playbook using Jenkins</h4><p>In this step, we would execute our Ansible Playbook (i.e., simple-ansible-playbook.yaml) file, and to do so let us go back to the <em>Project Configuration</em> page in Jenkins and find <strong>Post-build Actions</strong> there.</p><p>In this section, copy the below-mentioned command in the <em>Exec command</em> field:</p><pre>sudo ansible-playbook --limit ansible_CN /opt/docker/simple-ansible-playbook.yaml;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ao7iCru30X9PVPXG.png" /></figure><p>Now, let us try to build the project and see the Jenkins Job’s console output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NeMRq_-CWaOKsZVn.png" /></figure><p>In the output, you can see that our Ansible playbook ran successfully. Let us verify if at Ansible Server the image is created and the container is running:</p><p>For Docker Image list:</p><pre># docker images<br> <br>REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE<br>simple-docker-image   latest              d47875d99095        32 seconds ago      507MB<br>tomcat                latest              5692d26ea179        15 hours ago        507MB</pre><p>For Docker Container list:</p><pre># docker ps<br><br>CONTAINER ID        IMAGE                        COMMAND             CREATED             STATUS              PORTS                    NAMES<br>5a824d0a43d5        simple-docker-image:latest   &quot;catalina.sh run&quot;   15 seconds ago      Up 14 seconds       0.0.0.0:8888-&gt;8080/tcp   simple-docker-container</pre><p>It looks like Jenkins was able to run the Ansible Playbook successfully. Next, we are going to push Docker Image to Docker Hub.</p><h4>Pushing Docker Image to Docker Hub Using Ansible</h4><p>We are going to use Docker Hub public repository for this guide; in case you want to work on a live project, then you should consider using the Docker Hub private registry.</p><p>For this step, you have to create a Docker Hub account if you haven’t had one yet.</p><p>Our end goal for this step is to publish the Docker Image to Docker Hub using Ansible Playbook. So go to your Ansible Control Node and follow the below-mentioned steps:</p><pre># docker login<br> <br>Login with your Docker ID to push and pull images from Docker Hub. If you don&#39;t have a Docker ID, head over to https://hub.docker.com to create one.<br>Username: your-docker-hub-user<br>Password: <br>WARNING! Your password will be stored unencrypted in /root/.docker/config.json.<br>Configure a credential helper to remove this warning. See<br>https://docs.docker.com/engine/reference/commandline/login/#credentials-store<br> <br>Login Succeeded</pre><p>Make sure that you enter the right username and password.</p><p>Now it’s time to create a new Ansible Playbook which will build and push the Docker image to your Docker Hub account. Note that this image will be publicly available, so be cautious.</p><pre># nano build-push.yaml</pre><p>Create a new Ansible Playbook, which will build a Docker image and push it to our Docker Hub account:</p><pre>---<br>#Simple Ansible Playbook to build and push Docker image to Registry<br> <br>- name: Playbook to build and run Docker<br>  hosts: ansible_CN<br>  become: true<br>  gather_facts: false<br> <br>  tasks:<br>    - name: Delete existing Docker images from the Control Node<br>      shell: docker rmi $(docker images -q) -f <br>      ignore_errors: yes<br> <br>    - name: Push Docker image to Registry<br>      docker_image:<br>        name: simple-docker-image<br>        build:<br>          path: /opt/docker<br>          pull: true<br>        state: present<br>        tag: &quot;latest&quot;<br>        force_tag: yes<br>        repository: gauravsadawarte/simple-docker-image:latest<br>        push: yes<br>        source: build</pre><p>Let us run the playbook now and see what we get:</p><pre># ansible-playbook --limit ansible_CN build-push.yaml<br> <br>PLAY [Playbook to build and run Docker] <br>*****************************************************************************************<br> <br>TASK [Push Docker image to Registry] <br>*****************************************************************************************<br>changed: [ansible_CN]<br> <br>PLAY RECAP <br>*****************************************************************************************<br>ansible_CN                 : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0</pre><p>Go to your Docker Hub account and see if the image was pushed successfully, as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xH2DYSaq8cmUTV3R.png" /></figure><p>Next, let us modify our simple-ansible-playbook.yaml playbook, which we created earlier, as from here on, we are going to pull the Docker image from Docker Hub Account and create a container out of it.</p><pre>---<br>#Simple Ansible Playbook to pull Docker Image from the registry and run a Docker containers<br> <br>- import_playbook: build-push.yaml<br> <br>- name: Playbook to build and run Docker<br>  hosts: docker_host<br>  gather_facts: false<br> <br>  tasks:<br>    - name: Run Docker container using simple-docker-image<br>      docker_container:<br>        name: simple-docker-container<br>        image: gauravsadawarte/simple-docker-image:latest<br>        state: started<br>        recreate: yes<br>        detach: true<br>        pull: yes<br>        ports:<br>          - &quot;8888:8080&quot;</pre><p>Note that we have used the import_playbook statement at the top of the existing playbook, which means that we want to run the build-push.yaml playbook first along with our main playbook, and this way, we don’t have to run multiple playbooks manually.</p><p>Let us break the whole process into steps:</p><ol><li>With the help of build-push.yaml playbook, we are asking Ansible to build an image with the artifacts sent by Jenkins to our Control Node, and later push the built image (i.e., simple-docker-image) to our Docker Hub’s account or any other private registry like AWS ECR or Google’s Container Registry.</li><li>In the simple-ansible-playbook.yaml file, we have imported the build-push.yaml file, which is going to run prior to any statement present within the simple-ansible-playbook.yaml file.</li><li>Once build-push.yaml playbook is executed, Ansible will launch a container into our Managed Docker Host by pulling our image from our defined registry.</li></ol><p>Now, it’s time to build our job. So in the next step, we will deploy the artifact to our Control Node, where Ansible Playbook will build an image, push to Docker Hub and run the container in Managed Host. Let us get started!</p><h4>Jenkins Jobs to Deploy Docker Container Using Ansible</h4><p>To begin, go to <em>JenkinstoDockerUsingAnsible</em> configure page and change the <em>Exec command</em> in the <em>Post-build Actions</em> section.</p><p>Copy the below-mentioned command and add it as shown in the image below:</p><pre>sudo ansible-playbook /opt/docker/simple-ansible-playbook.yaml;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aI1IPPW19SKVh2hg.png" /></figure><p>Save the configuration and start the build; you will see the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zNBBczKE14kFEaQU.png" /></figure><p>Now go to your Control Node and verify if our images were built:</p><pre># docker images<br>REPOSITORY                            TAG                   IMAGE ID            CREATED             SIZE<br>gauravsadawarte/simple-docker-image   latest                9ccd91b55796        2 minutes ago       529MB<br>simple-docker-image                   latest                9ccd91b55796        2 minutes ago       529MB<br>tomcat                                8.5.50-jdk8-openjdk   b56d8850aed5        5 days ago          529MB</pre><p>It looks like Ansible Playbook was successfully executed on our Control Node. It’s time to verify if Ansible was able to launch containers on our Managed Host or not.</p><p>Go to your Managed Host and enter the following command:</p><pre># docker ps<br>CONTAINER ID        IMAGE                                        COMMAND                  CREATED             STATUS              PORTS                               NAMES<br>6f5e18c20a68        gauravsadawarte/simple-docker-image:latest   &quot;catalina.sh run&quot;        4 minutes ago       Up 4 minutes        0.0.0.0:8888-&gt;8080/tcp              simple-docker-container</pre><p>Now visit the following URL http://your-ip-addr:8888/webapp/ in your browser. Note that, Tomcat Server may take some time before you can see the output showing your project is successfully setup.</p><p>And you are done!</p><p>You successfully managed to deploy your application using Jenkins, Ansible, and Docker. Now, whenever someone from your team pushes code to the repository, Jenkins will build the artifact and send it to Ansible, from there Ansible will be responsible for publishing the application to the desired machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d6020bab2fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/integrating-ansible-and-docker-for-a-ci-cd-pipeline-using-jenkins-5d6020bab2fb">Integrating Ansible and Docker for a CI/CD Pipeline Using Jenkins</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Images Faster and Better With Multi-Stage Builds]]></title>
            <link>https://medium.com/appfleet/building-images-faster-and-better-with-multi-stage-builds-465eff7f4f5c?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/465eff7f4f5c</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 16:31:03 GMT</pubDate>
            <atom:updated>2020-09-07T16:31:03.890Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UF3oiJ2a1OS6-dDJ.png" /></figure><p>There is no doubt about the fact that Docker makes it very easy to deploy multiple applications on a single box. Be it different versions of the same tool, different applications with different version dependencies — Docker has you covered. But then nothing comes free. This flexibility comes with some problems — like <strong>high disk usage and large images</strong>. With Docker, you have to be careful about writing your Dockerfile efficiently in order to reduce the image size and also improve the build times.</p><p>Docker provides a set of <a href="https://docs.docker.com/develop/develop-images/dockerfile_best-practices/">standard practices</a> to follow in order to keep your image size small — also covers multi-stage builds in brief.</p><p><strong>Multi-stage</strong> builds are specifically useful for use cases where we build an <em>artifact, binary or executable</em>. Usually, there are lots of dependencies required for building the binary — for example — GCC, Maven, build-essentials, etc., but once you have the executable, you don’t need those dependencies to run the executable. Multi-stage builds use this to skim the image size. They let you build the executable in a separate environment and then build the final image only with the executable and minimal dependencies required to run the executable.</p><p>For example, here’s a <a href="https://github.com/go-training/helloworld">simple application</a> written in <em>Go</em>. All it does is to print “Hello World!!” as output. Let’s start without using multi-stage builds.</p><pre>Dockerfile<br>FROM golang<br>ADD . /app<br>WORKDIR /app<br>RUN go build # This will create a binary file named app<br>ENTRYPOINT /app/app</pre><ul><li>Build and run the image</li></ul><pre>docker build -t goapp .<br>~/g/helloworld ❯❯❯ docker run -it --rm goapp<br>Hello World!!</pre><ul><li>Now let us check the image size</li></ul><pre>~/g/helloworld ❯❯❯ docker images | grep goapp<br>goapp                                          latest              b4221e45dfa0        18 seconds ago      805MB</pre><ul><li>New Dockerfile</li></ul><pre># Build executable stage<br>FROM golang<br>ADD . /app<br>WORKDIR /app<br>RUN go build<br>ENTRYPOINT /app/app<br># Build final image<br>FROM alpine:latest<br>RUN apk --no-cache add ca-certificates<br>WORKDIR /root/<br>COPY --from=0 /app/app .<br>CMD [&quot;./app&quot;]</pre><ul><li>Re-build and run the image</li></ul><pre>docker build -t goapp .<br>~/g/helloworld ❯❯❯ docker run -it --rm goapp<br>Hello World!!</pre><ul><li>Let us check the image again</li></ul><pre>~/g/helloworld ❯❯❯ docker images | grep goapp<br>goapp                                          latest              100f92d756da        8 seconds ago       8.15MB<br>~/g/helloworld ❯❯❯</pre><p>We can see a massive reduction in the image size -&gt; From <strong>805 MB</strong> we are down to <strong>8.15MB</strong>. This is mostly because the <em>Golang</em> image has lots of dependencies which our final executable doesn’t even require for running.</p><p><strong>What’s happening here?</strong></p><p>We are building the image in two stages. First, we are using a <em>Golang</em> base image, copying our code inside it and building our executable file <em>App</em>. Now in the next stage, we are using a new <em>Alpine</em> base image and copying the binary which we built earlier to our new stage. Important point to note here is that the image built at each stage is entirely independent.</p><ul><li>Stage 0</li></ul><pre># Build executable stage<br>FROM golang<br>ADD . /app<br>WORKDIR /app<br>RUN go build<br>ENTRYPOINT /app/app</pre><ul><li>Stage 1</li></ul><pre># Build final image<br>FROM alpine:latest<br>RUN apk --no-cache add ca-certificates<br>WORKDIR /root/<br>COPY --from=0 /app/app .<br>CMD [&quot;./app”]</pre><p>Note the line <strong>COPY —from=0 /app/app</strong> -&gt; this lets you access data from inside the image built in previous image.</p><h4>How multi-stage builds work?</h4><p>If you look at the process carefully multi-stage builds are not much different from actual Docker builds. The only major difference is that you build multiple independent images (1 per stage) and you get the capability to copy artifacts/files from one image to another easily. The feature which multi-stage build is providing right now was earlier achieved through scripts. People used to create the build image — copy artifact from it manually — and then copy it to a new image with no additional dependencies. In the above example, we build one image in <em>Stage 0</em> and then in <em>Stage 1</em> we build another image, to which we copy files from the older image — nothing complicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*-xVS8gw8sBPAKygs" /></figure><p><em>NOTE: We are copying </em><em>/app from one image to another - not one container to another.</em></p><p>This can speed up deployments and save cost in multiple ways</p><ul><li>You build efficient lightweight images — hence you ship lesser data during deployment which saves both cost and time.</li><li>You can stop a multi-stage build at any stage — so you can use it to avoid the builder pattern with multi-stage builds. Have a single Dockerfile for both <em>dev</em>, <em>staging</em> and <em>deployment</em>.</li></ul><p>The above was just a small example, multi-stage builds can be used to improve Docker images of applications written in other languages as well. Also, multi-stage builds can help to avoid writing multiple Dockerfiles (builder pattern) — instead a single Dockerfile with multiple stages can be adapted to streamline the development process. If you haven’t explored it already — go ahead and do it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=465eff7f4f5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/building-images-faster-and-better-with-multi-stage-builds-465eff7f4f5c">Building Images Faster and Better With Multi-Stage Builds</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Open-Source Orchestration of Unikernels With Unik]]></title>
            <link>https://medium.com/appfleet/demystifying-open-source-orchestration-of-unikernels-with-unik-6bedf909fc01?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/6bedf909fc01</guid>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 20:15:05 GMT</pubDate>
            <atom:updated>2020-08-24T20:15:04.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZmMZ_Fc9dWmcmNwG.png" /></figure><h4>Abstract</h4><p>As the cloud-native ecosystem continues to evolve, many alternative solutions are popping-up, that challenges the status quo of application deployment methodologies. One of these solutions that is quickly gaining traction is <strong>Unikernels, which are executable images that can run natively on a hypervisor without the need for a separate operating system</strong>. <br><br>For cloud-native platforms to integrate unikernels into their ecosystem, they are required to provide unikernels with the same services they provide for containers. In this post, we are going to introduce <strong>UniK, an open-source orchestration system for unikernels. </strong><br><br>UniK (pronounced you-neek) is a tool for simplifying compilation and orchestration of unikernels. Similar to the way Docker builds and orchestrates containers, UniK automates compilation of popular languages (C/C++, Golang, Java, Node.js. Python) into unikernels. UniK deploys unikernels as virtual machines on various cloud platforms.</p><h4>UniK Design</h4><p>The UniK Daemon consists of 3 major components.</p><ul><li>The <strong>API server</strong></li><li><strong>Compilers</strong></li><li><strong>Providers</strong></li></ul><p>The <strong>API Server</strong> handles requests from the CLI or any HTTP Client, then determines which is the appropriate <strong>provider</strong> and/or <strong>compiler</strong> to service the request.</p><p>When the <strong>API Server</strong> receives a <em>build</em> request (POST /images/:image_name/create), it calls the specified <strong>compiler</strong> to build the raw image, and then passes the raw image to the specified <strong>provider</strong>, which processes the raw image with the Stage() method, turning it into an infrastructure-specific bootable image (e.g. an <em>Amazon AMI</em> on AWS)<br><br>Let&#39;s go ahead and try spinning up a unikernel ourselves.</p><h4>Deploying a GO HTTP daemon with UniK</h4><p>In this tutorial, we are going to be:</p><ol><li><a href="https://github.com/solo-io/unik/blob/master/docs/getting_started.md#installing-unik">Installing UniK</a></li><li><a href="https://github.com/solo-io/unik/blob/master/docs/getting_started.md#write-a-go-http-server">Writing a simple HTTP Daemon in Go</a></li><li><a href="https://github.com/solo-io/unik/blob/master/docs/getting_started.md#compile-an-image-and-run-on-virtualbox">Compiling to a unikernel and launching an instance on Virtualbox</a></li></ol><h4>Install, configure, and launch UniK</h4><p><strong>Prerequisites</strong></p><p>Ensure that each of the following are installed</p><ul><li><a href="http://www.docker.com/">Docker</a> installed and running with at least 6GB available space for building images</li><li><a href="https://stedolan.github.io/jq/">jq</a></li><li><a href="https://www.gnu.org/software/make/">make</a></li><li><a href="https://www.virtualbox.org/">Virtualbox</a></li></ul><p><strong>Install UniK</strong></p><pre>$ git clone https://github.com/solo-io/unik.git<br>$ cd unik<br>$ make binary</pre><p><strong>Note: </strong>make will take quite a few minutes the first time it runs. The UniK Makefile is pulling all of the Docker images that bundle UniK&#39;s dependencies.</p><p>Then, place the unik executable in your $PATH to make running UniK commands easier:</p><pre>$ mv _build/unik /usr/local/bin/</pre><p><strong>Configure a Host-only network on VirtualBox</strong></p><ol><li>Open Virtualbox.</li><li>Open <strong>Preferences &gt; Network &gt; Host-only Networks</strong>.</li><li>Click the green <em>Add</em> button on the right side of the UI.</li><li>Record the name of the new Host-only adapter (e.g. “vboxnet0”). You will need this in your UniK configuration.</li><li>Ensure that the Virtualbox DHCP Server is Enabled for this Host-only Network</li><li>With the Host-only Network selected, Click the edit button (screwdriver image)</li><li>In the <strong>Adapter</strong> tab, note the IPv4 address and netmask of the adapter.</li><li>In the <strong>DHCP Server</strong> tab, check the <strong>Enable Server</strong> box.</li><li>Set <strong>Server Address</strong> an IP on the same subnet as the Adapter IP. For example, if the adapter IP is 192.168.100.1, make set the DHCP server IP as 192.168.100.X, where X is a number between 2-254.</li><li>Set <strong>Server Mask</strong> to the netmask you just noted.</li><li>Set <strong>Upper/Lower Address Bound</strong> to a range of IPs on the same subnet. We recommend using the range X-254 where X is one higher than the IP you used for the DHCP server itself. E.g., if your DHCP server is 192.168.100.2, you can set the lower and upper bounds to 192.168.100.3 and 192.168.100.254, respectively.</li></ol><p><strong>Configure UniK daemon</strong></p><p>UniK configuration files are stored in $HOME/.unik. Create this directory, if it is not present:</p><pre>$mkdir $HOME/.unik</pre><p>Using a text editor, create and save the following to $HOME/.unik/daemon-config.yaml:</p><pre>providers:<br>  virtualbox:<br>    - name: my-vbox<br>      adapter_type: host_only<br>      adapter_name: NEW_HOST_ONLY_ADAPTER</pre><p>Replacing NEW_HOST_ONLY_ADAPTER with the name of the network adapter you created.</p><p><strong>Launch UniK and automatically deploy the <em>Virtualbox Instance Listener</em></strong></p><ul><li>Open a new terminal window/tab. This terminal will be where we leave the UniK daemon running.</li><li>cd to the _build directory created by make</li><li>run unik daemon --debug (the --debug flag is optional, if you want to see more verbose output)</li><li>UniK will compile and deploy its own 30 MB unikernel. This unikernel is the <a href="https://github.com/solo-io/unik/blob/master/docs/instance_listener.md">Unik Instance Listener</a>. The Instance Listener uses udp broadcast to detect (the IP address) and bootstrap instances running on Virtualbox.</li><li>After this is finished, UniK is running and ready to accept commands.</li><li>Open a new terminal window and type unik target --host localhost to set the CLI target to the your local machine.</li></ul><h4>Write a Go HTTP server</h4><p>Open a new terminal window, but leave the window with the daemon running. This window will be used for running UniK CLI commands.</p><p><strong>1. Create httpd.go file</strong></p><p>Create a file httpd.go using a text editor. Copy and paste the following code in that file:</p><pre>package main<br><br>import (<br>    &quot;fmt&quot;<br>    &quot;net/http&quot;<br>)<br><br>func main() {<br>    http.HandleFunc(&quot;/&quot;, handler)<br>    http.ListenAndServe(&quot;:8080&quot;, nil)<br>}<br><br>func handler(w http.ResponseWriter, r *http.Request) {<br>    fmt.Fprintf(w, &quot;my first unikernel!&quot;)<br>}</pre><p><strong>2. Run the code</strong></p><p>Try running this code with go run httpd.go. Visit <a href="http://localhost:8080/">http://localhost:8080/</a> to see that the server is running.</p><p><strong>3. Create a dummy </strong><strong>Godeps file</strong></p><p>We need to create a dummy Godeps file. This is necessary to tell the Go compiler how Go projects and their dependencies are structured. Fortunately, with this example, our project has no dependencies, and we can just fill out a simple Godeps file without installing <a href="https://github.com/tools/godep">godep</a>.</p><p>Note: For Go projects with imported dependencies, and nested packages, you will need to install Godeps and run GO15VENDOREXPERIMENT=1 godep save ./... in your project. See <a href="https://github.com/solo-io/unik/blob/master/docs/compilers/rump.md#golang">Compiling Go Apps with UniK</a> for more information.</p><p>To create the dummy Godeps file, create a folder named Godeps in the same directory as httpd.go. Inside, create a file named Godeps.json and paste the following inside:</p><pre>{<br>	&quot;ImportPath&quot;: &quot;my_httpd&quot;,<br>	&quot;GoVersion&quot;: &quot;go1.6&quot;,<br>	&quot;GodepVersion&quot;: &quot;v63&quot;,<br>	&quot;Packages&quot;: [<br>		&quot;./..&quot;<br>	],<br>	&quot;Deps&quot;: [<br>		{<br>			&quot;ImportPath&quot;: &quot;github.com/solo-io/unik/docs/examples&quot;,<br>			&quot;Rev&quot;: &quot;f8cc0dd435de36377eac060c93481cc9f3ae9688&quot;<br>		}<br>	]<br>}</pre><p>For the purposes of this example, what matters here is my_httpd. It instructs the Go compiler that the project should be installed from $GOPATH/src/my_httpd.</p><p><strong>4. Great! Now we’re ready to compile this code to a unikernel.</strong></p><h4>Compile an image to run on VirtualBox</h4><p><strong>1. Compile sources</strong></p><p>Run the following command from the directory where your httpd.go is located:</p><pre>unik build --name myImage --path ./ --base rump --language go --provider virtualbox</pre><p>This command will instruct UniK to compile the sources found in the working directory (./) using the rump-go-virtualbox compiler.</p><p><strong>2. Watch output</strong></p><p>You can watch the output of the build command in the terminal window running the daemon.</p><p><strong>3. Locate disk image</strong></p><p>When build finishes, the resulting disk image will reside at $HOME/.unik/virtualbox/images/myImage/boot.vmdk</p><p><strong>4. Run instance of disk image</strong></p><p>Run an instance of this image with:</p><pre>unik run --instanceName myInstance --imageName myImage</pre><p><strong>5. Check IP</strong></p><p>When the instance finishes launching, let’s check its IP and see if it is running our application. Run unik instances. The instance IP Address should be listed.</p><p><strong>6. View the instance!</strong></p><p>Direct your browser to http://instance-ip:8080 and see that your instance is running!</p><h4>Finishing up</h4><p>To clean up your image and the instance you created</p><pre>unik rmi --force --image myImage</pre><p>And we’re done. We hope you will benefit from this post and tutorial and stay tuned for future posts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bedf909fc01" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/demystifying-open-source-orchestration-of-unikernels-with-unik-6bedf909fc01">Demystifying Open-Source Orchestration of Unikernels With Unik</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Kubernetes-Native Backup and Recovery With Stash]]></title>
            <link>https://medium.com/appfleet/tutorial-kubernetes-native-backup-and-recovery-with-stash-8a86c263a4?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/8a86c263a4</guid>
            <category><![CDATA[stash]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 03 Aug 2020 20:14:05 GMT</pubDate>
            <atom:updated>2020-08-03T20:14:04.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mdu4nxJV9_KhHY1a.png" /></figure><h4>Intro</h4><p>Having a proper backup recovery plan is vital to any organization’s IT operation. However, when you begin to distribute workloads across data centers and regions, that process begins to become more and more complex. Container orchestration platforms such as Kubernetes have begun to ease this burden and enabled the management of distributed workloads in areas that were previously very challenging. <br><br>In this post, we are going to introduce you to a Kubernetes-native tool for taking backups of your disks, helping with the crucial recovery plan. <strong>Stash is a </strong><a href="https://restic.net/"><strong>Restic</strong></a><strong> Operator that accelerates the task of backing up and recovering your Kubernetes infrastructure</strong>. You can read more about the Operator Framework via <a href="https://appfleet.com/blog/first-steps-with-the-kubernetes-operator/">this blog post</a>.</p><h4>How does Stash work?</h4><p>Using Stash, you can backup Kubernetes volumes mounted in following types of workloads:</p><ul><li>Deployment</li><li>DaemonSet</li><li>ReplicaSet</li><li>ReplicationController</li><li>StatefulSet</li></ul><p>At the heart of Stash is a Kubernetes <a href="https://book.kubebuilder.io/basics/what_is_a_controller.html">controller</a> which uses <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">Custom Resource Definition (CRD)</a> to specify targets and behaviors of the backup and restore process in a Kubernetes native way. A simplified architecture of Stash is shown below:</p><h4>Installing Stash</h4><h4>Using Helm 3</h4><p>Stash can be installed via <a href="https://helm.sh/">Helm</a> using the <a href="https://github.com/stashed/installer/tree/v0.9.0-rc.6/charts/stash">chart</a> from <a href="https://github.com/appscode/charts">AppsCode Charts Repository</a>. To install the chart with the release name stash-operator:</p><pre>$ helm repo add appscode https://charts.appscode.com/stable/<br>$ helm repo update<br>$ helm search repo appscode/stash --version v0.9.0-rc.6<br>NAME            CHART          VERSION      APP VERSION DESCRIPTION<br>appscode/stash  v0.9.0-rc.6    v0.9.0-rc.6  Stash by AppsCode - Backup your Kubernetes Volumes<br><br>$ helm install stash-operator appscode/stash \<br>  --version v0.9.0-rc.6 \<br>  --namespace kube-system</pre><h4>Using YAML</h4><p>If you prefer to not use Helm, you can generate YAMLs from Stash chart and deploy using kubectl:</p><pre>$ helm repo add appscode https://charts.appscode.com/stable/<br>$ helm repo update<br>$ helm search repo appscode/stash --version v0.9.0-rc.6<br>NAME            CHART VERSION APP VERSION DESCRIPTION<br>appscode/stash  v0.9.0-rc.6    v0.9.0-rc.6  Stash by AppsCode - Backup your Kubernetes Volumes<br><br>$ helm template stash-operator appscode/stash \<br>  --version v0.9.0-rc.6 \<br>  --namespace kube-system \<br>  --no-hooks | kubectl apply -f -</pre><h4><strong>Installing on GKE Cluster</strong></h4><p>If you are installing Stash on a GKE cluster, you will need cluster admin permissions to install Stash operator. Run the following command to grant admin permission to the cluster.</p><pre>$ kubectl create clusterrolebinding &quot;cluster-admin-$(whoami)&quot; \<br>  --clusterrole=cluster-admin \<br>  --user=&quot;$(gcloud config get-value core/account)&quot;</pre><p>In addition, if your GKE cluster is a <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters">private cluster</a>, you will need to either add an additional firewall rule that allows master nodes access port 8443/tcp on worker nodes, or change the existing rule that allows access to ports 443/tcp and 10250/tcp to also allow access to port 8443/tcp. The procedure to add or modify firewall rules is described in the official GKE documentation for private clusters mentioned above.</p><h4>Verify installation</h4><p>To check if Stash operator pods have started, run the following command:</p><pre>$ kubectl get pods --all-namespaces -l app=stash --watch<br><br>NAMESPACE     NAME                              READY     STATUS    RESTARTS   AGE<br>kube-system   stash-operator-859d6bdb56-m9br5   2/2       Running   2          5s</pre><p>Once the operator pods are running, you can cancel the above command by typing Ctrl+C.</p><p>Now, to confirm CRD groups have been registered by the operator, run the following command:</p><pre>$ kubectl get crd -l app=stash<br><br>NAME                                 AGE<br>recoveries.stash.appscode.com        5s<br>repositories.stash.appscode.com      5s<br>restics.stash.appscode.com           5s</pre><p>With this, you are ready to take your first backup using Stash.</p><h4>Configuring Auto Backup for Database</h4><p>To keep everything isolated, we are going to use a separate namespace called demo throughout this tutorial.</p><pre>$ kubectl create ns demo<br>namespace/demo created</pre><h4>Prepare Backup Blueprint</h4><p>We are going to use <a href="https://stash.run/docs/v0.9.0-rc.6/guides/latest/backends/gcs">GCS Backend</a> to store the backed up data. You can use any supported backend you prefer. You just have to configure Storage Secret and spec.backend section of BackupBlueprint to match with your backend. Visit <a href="https://stash.run/docs/v0.9.0-rc.6/guides/latest/backends/overview">here</a> to learn which backends are supported by Stash and how to configure them.</p><p>For GCS backend, if the bucket does not exist, Stash needs Storage Object Admin role permissions to create the bucket. For more details, please check the following <a href="https://stash.run/docs/v0.9.0-rc.6/guides/latest/backends/gcs">guide</a>.</p><p><strong>Create Storage Secret:</strong></p><p>At first, let’s create a Storage Secret for the GCS backend,</p><pre>$ echo -n &#39;changeit&#39; &gt; RESTIC_PASSWORD<br>$ echo -n &#39;&lt;your-project-id&gt;&#39; &gt; GOOGLE_PROJECT_ID<br>$ mv downloaded-sa-json.key &gt; GOOGLE_SERVICE_ACCOUNT_JSON_KEY<br>$ kubectl create secret generic -n demo gcs-secret \<br>    --from-file=./RESTIC_PASSWORD \<br>    --from-file=./GOOGLE_PROJECT_ID \<br>    --from-file=./GOOGLE_SERVICE_ACCOUNT_JSON_KEY<br>secret/gcs-secret created</pre><p><strong>Create BackupBlueprint:</strong></p><p>Next, we have to create a BackupBlueprint CRD with a blueprint for Repository and BackupConfiguration object.</p><p>Below is the YAML of the BackupBlueprint object that we are going to create:</p><pre>apiVersion: stash.appscode.com/v1beta1<br>kind: BackupBlueprint<br>metadata:<br>  name: postgres-backup-blueprint<br>spec:<br>  # ============== Blueprint for Repository ==========================<br>  backend:<br>    gcs:<br>      bucket: appscode-qa<br>      prefix: stash-backup/${TARGET_NAMESPACE}/${TARGET_APP_RESOURCE}/${TARGET_NAME}<br>    storageSecretName: gcs-secret<br>  # ============== Blueprint for BackupConfiguration =================<br>  task:<br>    name: postgres-backup-${TARGET_APP_VERSION}<br>  schedule: &quot;*/5 * * * *&quot;<br>  retentionPolicy:<br>    name: &#39;keep-last-5&#39;<br>    keepLast: 5<br>    prune: true</pre><p>Note that we have used few variables (format: ${&lt;variable name&gt;}) in the spec.backend.gcs.prefix field. Stash will substitute these variables with values from the respective target. To learn which variables you can use in the prefix field, please visit <a href="https://stash.run/docs/v0.9.0-rc.6/concepts/crds/backupblueprint#repository-blueprint">here</a>.</p><p>Let’s create the BackupBlueprint that we have shown above.</p><pre>$ kubectl apply -f https://github.com/stashed/docs/raw/v0.9.0-rc.6/docs/examples/guides/latest/auto-backup/database/backupblueprint.yaml<br>backupblueprint.stash.appscode.com/postgres-backup-blueprint created</pre><p>With this, automatic backup is configured for PostgreSQL database. We just have to add an annotation to the AppBinding of the targeted database.</p><p><strong>Required Annotation for Auto-Backup Database:</strong></p><p>You have to add the following annotation to the AppBinding CRD of the targeted database to enable backup for it:</p><pre>stash.appscode.com/backup-blueprint: &lt;BackupBlueprint name&gt;</pre><p>This annotation specifies the name of the BackupBlueprint object where a blueprint for Repository and BackupConfiguration has been defined.</p><h4>Prepare Databases</h4><p>Next, we are going to deploy two sample PostgreSQL databases of two different versions using KubeDB. We are going to backup these two databases using auto-backup.</p><p><strong>Deploy First PostgreSQL Sample:</strong></p><p>Below is the YAML of the first Postgres CRD:</p><pre>apiVersion: kubedb.com/v1alpha1<br>kind: Postgres<br>metadata:<br>  name: sample-postgres-1<br>  namespace: demo<br>spec:<br>  version: &quot;11.2&quot;<br>  storageType: Durable<br>  storage:<br>    storageClassName: &quot;standard&quot;<br>    accessModes:<br>    - ReadWriteOnce<br>    resources:<br>      requests:<br>        storage: 1Gi<br>  terminationPolicy: Delete</pre><p>Let’s create the Postgres we have shown above:</p><pre>$ kubectl apply -f https://github.com/stashed/docs/raw/v0.9.0-rc.6/docs/examples/guides/latest/auto-backup/database/sample-postgres-1.yaml<br>postgres.kubedb.com/sample-postgres-1 created</pre><p>KubeDB will deploy a PostgreSQL database according to the above specification and it will create the necessary secrets and services to access the database. It will also create an AppBinding CRD that holds the necessary information to connect with the database.</p><p>Verify that an AppBinding has been created for this PostgreSQL sample:</p><pre>$ kubectl get appbinding -n demo<br>NAME                AGE<br>sample-postgres-1   47s</pre><p>If you view the YAML of this AppBinding, you will see it holds service and secret information. Stash uses this information to connect with the database.</p><pre>$ kubectl get appbinding -n demo sample-postgres-1 -o yaml</pre><pre>apiVersion: appcatalog.appscode.com/v1alpha1<br>kind: AppBinding<br>metadata:<br>  name: sample-postgres-1<br>  namespace: demo<br>  ...<br>spec:<br>  clientConfig:<br>    service:<br>      name: sample-postgres-1<br>      path: /<br>      port: 5432<br>      query: sslmode=disable<br>      scheme: postgresql<br>  secret:<br>    name: sample-postgres-1-auth<br>  secretTransforms:<br>  - renameKey:<br>      from: POSTGRES_USER<br>      to: username<br>  - renameKey:<br>      from: POSTGRES_PASSWORD<br>      to: password<br>  type: kubedb.com/postgres<br>  version: &quot;11.2&quot;</pre><p><strong>Deploy Second PostgreSQL Sample:</strong></p><p>Below is the YAML of the second Postgres object:</p><pre>apiVersion: kubedb.com/v1alpha1<br>kind: Postgres<br>metadata:<br>  name: sample-postgres-2<br>  namespace: demo<br>spec:<br>  version: &quot;10.6-v2&quot;<br>  storageType: Durable<br>  storage:<br>    storageClassName: &quot;standard&quot;<br>    accessModes:<br>    - ReadWriteOnce<br>    resources:<br>      requests:<br>        storage: 1Gi<br>  terminationPolicy: Delete</pre><p>Let’s create the Postgres we have shown above.</p><pre>$ kubectl apply -f https://github.com/stashed/docs/raw/v0.9.0-rc.6/docs/examples/guides/latest/auto-backup/database/sample-postgres-2.yaml<br>postgres.kubedb.com/sample-postgres-2 created</pre><p>Verify that an AppBinding has been created for this PostgreSQL database:</p><pre>$ kubectl get appbinding -n demo<br>NAME                AGE<br>sample-postgres-1   2m49s<br>sample-postgres-2   10s</pre><p>Here, we can see AppBinding sample-postgres-2 has been created for our second PostgreSQL sample.</p><h4><strong>Backup</strong></h4><p>Next, we are going to add auto-backup specific annotation to the AppBinding of our desired database. Stash watches for AppBinding CRD. Once it finds an AppBinding with auto-backup annotation, it will create a Repository and a BackupConfiguration CRD according to respective BackupBlueprint. Then, rest of the backup process will proceed as normal database backup as described <a href="https://stash.run/docs/v0.9.0-rc.6/guides/latest/addons/overview">here</a>.</p><h4><strong>Backup First PostgreSQL Sample</strong></h4><p>Let’s backup our first PostgreSQL sample using auto-backup.</p><p><strong>Add Annotations:</strong></p><p>At first, add the auto-backup specific annotation to the AppBinding sample-postgres-1:</p><pre>$ kubectl annotate appbinding sample-postgres-1 -n demo --overwrite \<br>  stash.appscode.com/backup-blueprint=postgres-backup-blueprint</pre><p>Verify that the annotation has been added successfully:</p><pre>$ kubectl get appbinding -n demo sample-postgres-1 -o yaml</pre><pre>apiVersion: appcatalog.appscode.com/v1alpha1<br>kind: AppBinding<br>metadata:<br>  annotations:<br>    stash.appscode.com/backup-blueprint: postgres-backup-blueprint<br>  name: sample-postgres-1<br>  namespace: demo<br>  ...<br>spec:<br>  clientConfig:<br>    service:<br>      name: sample-postgres-1<br>      path: /<br>      port: 5432<br>      query: sslmode=disable<br>      scheme: postgresql<br>  secret:<br>    name: sample-postgres-1-auth<br>  secretTransforms:<br>  - renameKey:<br>      from: POSTGRES_USER<br>      to: username<br>  - renameKey:<br>      from: POSTGRES_PASSWORD<br>      to: password<br>  type: kubedb.com/postgres<br>  version: &quot;11.2&quot;</pre><p>Following this, Stash will create a Repository and a BackupConfiguration CRD according to the blueprint.</p><p><strong>Verify Repository:</strong></p><p>Verify that the Repository has been created successfully by the following command:</p><pre>$ kubectl get repository -n demo<br>NAME                         INTEGRITY   SIZE   SNAPSHOT-COUNT   LAST-SUCCESSFUL-BACKUP   AGE<br>postgres-sample-postgres-1                                                                2m23s</pre><p>If we view the YAML of this Repository, we are going to see that the variables ${TARGET_NAMESPACE}, ${TARGET_APP_RESOURCE} and ${TARGET_NAME} has been replaced by demo, postgres and sample-postgres-1 respectively.</p><pre>$ kubectl get repository -n demo postgres-sample-postgres-1 -o yaml</pre><pre>apiVersion: stash.appscode.com/v1beta1<br>kind: Repository<br>metadata:<br>  creationTimestamp: &quot;2019-08-01T13:54:48Z&quot;<br>  finalizers:<br>  - stash<br>  generation: 1<br>  name: postgres-sample-postgres-1<br>  namespace: demo<br>  resourceVersion: &quot;50171&quot;<br>  selfLink: /apis/stash.appscode.com/v1beta1/namespaces/demo/repositories/postgres-sample-postgres-1<br>  uid: ed49dde4-b463-11e9-a6a0-080027aded7e<br>spec:<br>  backend:<br>    gcs:<br>      bucket: appscode-qa<br>      prefix: stash-backup/demo/postgres/sample-postgres-1<br>    storageSecretName: gcs-secret</pre><p><strong>Verify BackupConfiguration:</strong></p><p>Verify that the BackupConfiguration CRD has been created by the following command:</p><pre>$ kubectl get backupconfiguration -n demo<br>NAME                         TASK                   SCHEDULE      PAUSED   AGE<br>postgres-sample-postgres-1   postgres-backup-11.2   */5 * * * *            3m39s</pre><p>Notice the TASK field. It denotes that this backup will be performed using postgres-backup-11.2 task. We had specified postgres-backup-${TARGET_APP_VERSION} as task name in the BackupBlueprint. Here, the variable ${TARGET_APP_VERSION} has been substituted by the database version.</p><p>Let’s check the YAML of this BackupConfiguration.</p><pre>$ kubectl get backupconfiguration -n demo postgres-sample-postgres-1 -o yaml</pre><pre>apiVersion: stash.appscode.com/v1beta1<br>kind: BackupConfiguration<br>metadata:<br>  creationTimestamp: &quot;2019-08-01T13:54:48Z&quot;<br>  finalizers:<br>  - stash.appscode.com<br>  generation: 1<br>  name: postgres-sample-postgres-1<br>  namespace: demo<br>  ownerReferences:<br>  - apiVersion: v1<br>    blockOwnerDeletion: false<br>    kind: AppBinding<br>    name: sample-postgres-1<br>    uid: a799156e-b463-11e9-a6a0-080027aded7e<br>  resourceVersion: &quot;50170&quot;<br>  selfLink: /apis/stash.appscode.com/v1beta1/namespaces/demo/backupconfigurations/postgres-sample-postgres-1<br>  uid: ed4bd257-b463-11e9-a6a0-080027aded7e<br>spec:<br>  repository:<br>    name: postgres-sample-postgres-1<br>  retentionPolicy:<br>    keepLast: 5<br>    name: keep-last-5<br>    prune: true<br>  runtimeSettings: {}<br>  schedule: &#39;*/5 * * * *&#39;<br>  target:<br>    ref:<br>      apiVersion: v1<br>      kind: AppBinding<br>      name: sample-postgres-1<br>  task:<br>    name: postgres-backup-11.2<br>  tempDir: {}</pre><p>Notice that the spec.target.ref is pointing to the AppBinding sample-postgres-1 that we have just annotated with auto-backup annotation.</p><p><strong>Wait for BackupSession:</strong></p><p>Now, wait for the next backup schedule. Run the following command to watch BackupSession CRD:</p><pre>$ watch -n 1 kubectl get backupsession -n demo -l=stash.appscode.com/backup-configuration=postgres-sample-postgres-1<br><br>Every 1.0s: kubectl get backupsession -n demo -l=stash.appscode.com/backup-configuration=postgres-sample-postgres-1  workstation: Thu Aug  1 20:35:43 2019<br><br>NAME                                    INVOKER-TYPE          INVOKER-NAME                 PHASE       AGE<br>postgres-sample-postgres-1-1564670101   BackupConfiguration   postgres-sample-postgres-1   Succeeded   42s</pre><p>Note: Backup CronJob creates BackupSession CRD with the following label stash.appscode.com/backup-configuration=&lt;BackupConfiguration crd name&gt;. We can use this label to watch only the BackupSession of our desired BackupConfiguration.</p><p><strong>Verify Backup:</strong></p><p>When backup session is completed, Stash will update the respective Repository to reflect the latest state of backed up data.</p><p>Run the following command to check if a snapshot has been sent to the backend:</p><pre>$ kubectl get repository -n demo postgres-sample-postgres-1<br>NAME                         INTEGRITY   SIZE        SNAPSHOT-COUNT   LAST-SUCCESSFUL-BACKUP   AGE<br>postgres-sample-postgres-1   true        1.324 KiB   1                73s                      6m7s</pre><p>If we navigate to stash-backup/demo/postgres/sample-postgres-1 directory of our GCS bucket, we are going to see that the snapshot has been stored there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/0*y_TgCscgFXF0jsfT.png" /></figure><h4><strong>Backup Second Sample PostgreSQL</strong></h4><p>Now, lets backup our second PostgreSQL sample using the same BackupBlueprint we have used to backup the first PostgreSQL sample.</p><p><strong>Add Annotations:</strong></p><p>Add the auto backup specific annotation to AppBinding sample-postgres-2.</p><pre>$ kubectl annotate appbinding sample-postgres-2 -n demo --overwrite \<br>  stash.appscode.com/backup-blueprint=postgres-backup-blueprint</pre><p><strong>Verify Repository:</strong></p><p>Verify that the Repository has been created successfully by the following command:</p><pre>$ kubectl get repository -n demo<br>NAME                         INTEGRITY   SIZE        SNAPSHOT-COUNT   LAST-SUCCESSFUL-BACKUP   AGE<br>postgres-sample-postgres-1   true        1.324 KiB   1                2m3s                     6m57s<br>postgres-sample-postgres-2                                                                     15s</pre><p>Here, repository postgres-sample-postgres-2 has been created for the second PostgreSQL sample.</p><p>If we view the YAML of this Repository, we will see that the variables ${TARGET_NAMESPACE}, ${TARGET_APP_RESOURCE} and ${TARGET_NAME} have been replaced by demo, postgres and sample-postgres-2 respectively.</p><pre>$ kubectl get repository -n demo postgres-sample-postgres-2 -o yaml</pre><pre>apiVersion: stash.appscode.com/v1beta1<br>kind: Repository<br>metadata:<br>  creationTimestamp: &quot;2019-08-01T14:37:22Z&quot;<br>  finalizers:<br>  - stash<br>  generation: 1<br>  name: postgres-sample-postgres-2<br>  namespace: demo<br>  resourceVersion: &quot;56103&quot;<br>  selfLink: /apis/stash.appscode.com/v1beta1/namespaces/demo/repositories/postgres-sample-postgres-2<br>  uid: df58523c-b469-11e9-a6a0-080027aded7e<br>spec:<br>  backend:<br>    gcs:<br>      bucket: appscode-qa<br>      prefix: stash-backup/demo/postgres/sample-postgres-2<br>    storageSecretName: gcs-secret</pre><p><strong>Verify BackupConfiguration:</strong></p><p>Verify that the BackupConfiguration CRD has been created by the following command:</p><pre>$ kubectl get backupconfiguration -n demo<br>NAME                         TASK                   SCHEDULE      PAUSED   AGE<br>postgres-sample-postgres-1   postgres-backup-11.2   */5 * * * *            7m52s<br>postgres-sample-postgres-2   postgres-backup-10.6   */5 * * * *            70s</pre><p>Again, notice the TASK field. This time, ${TARGET_APP_VERSION} has been replaced with 10.6 which is the database version of our second sample.</p><p><strong>Wait for BackupSession:</strong></p><p>Now, wait for the next backup schedule. Run the following command to watch BackupSession CRD:</p><pre>$ watch -n 1 kubectl get backupsession -n demo -l=stash.appscode.com/backup-configuration=postgres-sample-postgres-2<br>Every 1.0s: kubectl get backupsession -n demo -l=stash.appscode.com/backup-configuration=postgres-sample-postgres-2  workstation: Thu Aug  1 20:55:40 2019<br><br>NAME                                    INVOKER-TYPE          INVOKER-NAME                 PHASE       AGE<br>postgres-sample-postgres-2-1564671303   BackupConfiguration   postgres-sample-postgres-2   Succeeded   37s</pre><p><strong>Verify Backup:</strong></p><p>Run the following command to check if a snapshot has been sent to the backend:</p><pre>$ kubectl get repository -n demo postgres-sample-postgres-2<br>NAME                         INTEGRITY   SIZE        SNAPSHOT-COUNT   LAST-SUCCESSFUL-BACKUP   AGE<br>postgres-sample-postgres-2   true        1.324 KiB   1                52s                      19m</pre><p>If we navigate to stash-backup/demo/postgres/sample-postgres-2 directory of our GCS bucket, we are going to see that the snapshot has been stored there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/0*KmQX6xfUz35KgiDO.png" /></figure><h4><strong>Cleanup</strong></h4><p>To cleanup the Kubernetes resources created by this tutorial, run:</p><pre>kubectl delete -n demo pg/sample-postgres-1<br>kubectl delete -n demo pg/sample-postgres-2<br><br>kubectl delete -n demo repository/postgres-sample-postgres-1<br>kubectl delete -n demo repository/postgres-sample-postgres-2<br><br>kubectl delete -n demo backupblueprint/postgres-backup-blueprint</pre><h4>Final thoughts</h4><p>You’ve now gotten a deep dive into setting up a Kubernetes-native disaster recovery and backup solution with Stash. You can find a lot of really helpful information on their documentation site <a href="https://stash.run/">here</a>. I hope you gained some educational knowledge from this post and will stay tuned for future tutorials!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a86c263a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/tutorial-kubernetes-native-backup-and-recovery-with-stash-8a86c263a4">Tutorial: Kubernetes-Native Backup and Recovery With Stash</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Helm with Kubernetes]]></title>
            <link>https://medium.com/appfleet/using-helm-with-kubernetes-59a40b58b4bf?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/59a40b58b4bf</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 20 Jul 2020 13:47:03 GMT</pubDate>
            <atom:updated>2020-07-20T13:47:03.811Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X9WCQu5RmPDmB3-E.png" /></figure><p>Kubernetes is a powerful orchestration system, however, it can be really hard to configure its deployment process. Specific apps can help you manage multiple independent resources like pods, services, deployments, and replica sets. Yet, each must be described in the YAML manifest file.</p><p>It’s not a problem for a single trivial app, but during production, it’s best to simplify this process: search, use, and share already implemented configurations, deploy these configurations, create configuration templates, and deploy them without effort. In other words, we need an extended version of a package manager like <em>APT</em> for Ubuntu or <em>PIP</em> for Python to work with the Kubernetes cluster. Luckily, we have Helm as a package manager.</p><h3>What is Helm?</h3><p><a href="https://www.helm.sh/">Helm</a> is an open-source package manager for Kubernetes that allows developers and operators to package, configure, and deploy applications and services onto Kubernetes clusters easily. It was inspired by Homebrew for macOS and now is a part of the Cloud Native Computing Foundation.</p><p>In this article, we will explore Helm 3.x which is the newest version at the time of writing this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*U1TLVVgajXPhlGRG" /></figure><p><em>Searches on Helm Hub for PostgreSQL from dozens of different repositories</em></p><p>Helm can install software and dependencies, upgrade software, configure software deployments, fetch packages from repositories, alongside managing repositories.</p><p><strong>Some key features of Helm include:</strong></p><ul><li>Role-based access controls (RBAC)</li><li>Golang templates which allows you to work with configuration as text</li><li>Lua scripts to process configuration as an object</li><li>Deployment versions control system</li></ul><p>Templates allow you to configure your deployments by changing few variable values without changing the template directly. Helm packages are called <strong>charts</strong>, and they consist of a few YAML configuration files and templates that are rendered into Kubernetes manifest files.</p><p><strong>The basic package (chart) structure:</strong></p><ul><li><strong>chart.yaml </strong>— a YAML file containing information about the chart</li><li><strong>LICENSE (optional) </strong>— a plain text file containing the license for the chart</li><li><strong>README.md</strong> <strong>(optional)</strong> — a human-readable README file</li><li><strong>values.yaml</strong> — the default configuration values for this chart</li><li><strong>values.schema.json (optional)</strong> — a JSON Schema for imposing a structure on the values.yaml file</li><li><strong>charts/</strong> — defines chart dependencies (recommended to use the <em>dependencies</em> section in chart.yaml)</li><li><strong>crds/</strong> — Custom Resource Definitions</li><li><strong>templates/ </strong>— directory of templates that when combined with values, will generate valid Kubernetes manifest files</li></ul><p>Templates give you a wide range of capabilities. You can use variables from context, apply different functions (such as ‘quote’, sha256sum), use cycles and conditional cases, and import other files (also other templates or partials).</p><h3>What are Helm’s abilities?</h3><ol><li>As you operate Helm though a Command Line Interface (CLI), the helm search command allows you to search for a package by keywords from the repositories.</li><li>You can inspect chart.yaml, values.yaml, and README.md for a certain package. along with creating your own chart with the helm create &lt;chart-name&gt; command. This command will generate a folder with a specified name in which you can find the mentioned structure.</li><li>Helm can install both folder or .tgz archives. To create a .tgz from your package folder, use the helm package &lt;path to folder&gt; command. This will create a &lt;package_name&gt; package in your working directory, using the name and version from the metadata defined in the chart.yaml file.</li><li>Helm has built-in support for installing packages from an HTTP server. Helm reads a repository index hosted on the server, which describes what chart packages are available and where they are located. This is how the default stable repository works.</li><li>You can also create a repository from your machine with helm serve. This eventually lets you create your own corporate repository or contribute to the official stable one.</li><li>You can also call the helm dependencies update &lt;package name&gt; command which verifies that the required charts, as expressed in chart.yaml, are present in charts/ and are in an acceptable version. It will additionally pull down the latest charts that satisfy the dependencies, and clean up the old dependencies.</li><li>Apart from <em>Chart</em> and <em>Repository</em> another significant concept you should know is <em>Release </em>which is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new Release is created. So, you can have multiple PostgreSQL in the same cluster, in which each Release will have its own release name. You can think of this like ‘multiple Docker containers from one image’.</li></ol><h3>How does it work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*L2ovhoyagCtH2G6P" /></figure><p><em>Source: </em><a href="https://developer.ibm.com/technologies/containers/blogs/kubernetes-helm-3/"><em>developer.ibm.com</em></a></p><p>Helm client is used for installing, updating and creating charts, as well as compiling and sending them to a Kubernetes API in an acceptable form. The previous version had a client-server architecture, using a program run on a cluster with Kubernetes, called Tiller. This software was responsible for deployment’s lifetime. But this approach led to some security issues which is one of the reasons why all functions are now handled by the client.</p><p>Installing Helm 3 is noticeably easier than the previous version since only the client needs to be installed. It is available for Windows, macOS, and Linux. You can install the program from binary releases, Homebrew, or through a configured installation script.</p><h3>Let’s try an example</h3><ol><li>Let’s start with installing Helm.</li></ol><pre>bash master $ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash<br><br>% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100  6794  100  6794    0     0  25961      0 --:--:-- --:--:-- --:--:-- 25931Error: could not find tillerHelm v3.1.2 is available. Changing from version .Downloading https://get.helm.sh/helm-v3.1.2-linux-amd64.tar.gzPreparing to install helm into /usr/local/binhelm installed into /usr/local/bin/helm</pre><p>2. Check if everything is installed properly.</p><pre>master $ helm version --short<br>V3.1.2+gd878d4d</pre><p>3. By default, Helm doesn’t have a connection to any of the repositories. Let’s add connection to the most common <em>stable</em> one. (You can check all the available repositories with helm repo list).</p><pre>master $ helm repo add stable <br><br>https://kubernetes-charts.storage.googleapis.com/<br>&quot;stable&quot; has been added to your repositories</pre><p>4. After adding the repository, we should let Helm get updated. The current local state of Helm is kept in your environment in the home location.</p><pre>master $ helm repo update<br><br>Hang tight while we grab the latest from your chart repositories...<br>...Successfully got an update from the &quot;stable&quot; chart repository<br>Update Complete. ⎈ Happy Helming!⎈</pre><blockquote>The Helm command defaults to discovering the host already set in ~/.kube/config. There is a way to change or override the host, but that&#39;s beyond the scope of this scenario.</blockquote><pre>master $ helm env<br><br>HELM_BIN=&quot;helm&quot;<br>HELM_DEBUG=&quot;false&quot;<br>HELM_KUBECONTEXT=&quot;&quot;<br>HELM_NAMESPACE=&quot;default&quot;<br>HELM_PLUGINS=&quot;/root/.local/share/helm/plugins&quot;<br>HELM_REGISTRY_CONFIG=&quot;/root/.config/helm/registry.json&quot;<br>HELM_REPOSITORY_CACHE=&quot;/root/.cache/helm/repository&quot;<br>HELM_REPOSITORY_CONFIG=&quot;/root/.config/helm/repositories.yaml&quot;</pre><p>5. Let’s search for a WordPress in the <a href="https://hub.helm.sh/">Helm Hub</a></p><pre>master $ helm search hub wordpress<br><br>URL                                                     CHART VERSION   APP VERSION     DESCRIPTION https://hub.helm.sh/charts/presslabs/wordpress-...      v0.8.4          v0.8.4          Presslabs WordPress Operator Helm Chart<br>https://hub.helm.sh/charts/presslabs/wordpress-...      v0.8.3          v0.8.3          A Helm chart for deploying a WordPress site on ...<br>https://hub.helm.sh/charts/bitnami/wordpress            9.0.3           5.3.2           Web publishing platform for building blogs and ...</pre><p>And also search in our repositories (we have only <em>stable</em> for now).</p><pre>master $ helm search repo wordpress<br><br>NAME                    CHART VERSION   APP VERSION     DESCRIPTION<br>stable/wordpress        9.0.2           5.3.2           DEPRECATED Web publishing platform for building...</pre><p>6. As mentioned earlier, you can inspect a Chart. For example, let’s take info from chart.yaml for the <em>Wordpress</em> chart. <br>You can also check helm show readme stable/wordpress and helm show values stable/wordpress.</p><pre>master $ helm show chart stable/wordpress<br><br>apiVersion: v1<br>appVersion: 5.3.2<br>dependencies:<br>- condition: mariadb.enabled<br>  name: mariadb<br>  repository: https://kubernetes-charts.storage.googleapis.com/<br>  tags:<br>  - wordpress-database<br>  version: 7.x.xdeprecated: truedescription: DEPRECATED Web publishing platform for building blogs and websites.<br>home: http://www.wordpress.com/<br>icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png<br>keywords:- wordpress- cms<br>- blog<br>- http- web- application<br>- php<br>name: wordpress<br>sources:<br>- https://github.com/bitnami/bitnami-docker-wordpress<br>version: 9.0.2</pre><p>7. Let’s create a namespace for WordPress and install a test chart.</p><pre>master $ kubectl create namespace wordpress<br><br>namespace/wordpress created</pre><pre>master $ helm install test-wordpress stable/wordpress --namespace wordpress</pre><p>The output of this command appears messy just because it’s so big.</p><p>You can also set variables, such as:</p><pre>helm install test-wordpress \<br>  --set wordpressUsername=admin \<br>  --set wordpressPassword=password \<br>  --set mariadb.mariadbRootPassword=secretpassword \<br>    stable/wordpress</pre><p>8. For now, let’s ensure that everything is deployed correctly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*GFYKmkVa_-5u5_YI" /></figure><p>As you can see, everything has been deployed properly.</p><h3>Conclusion</h3><p>Helm is a popular open-source package manager that offers users a more flexible way to manage Kubernetes cluster. You can either create your own, or use public packages from your own or external repositories. Each package is quite flexible and, in most cases, all you need is define the right constants from which the template will be compiled to suit your needs. To create your own chart, you can use the power of Go templates and/or Lua scripts. Each update will create a history unit to which you can rollback anytime you want. With Helm, you have all the power of Kubernetes. And, in the end, Helm allows you to work with role-based access, so you can manage your cluster in a team.</p><p>This brings us to the end of this brief article explaining the basics and features of Helm. We hope you enjoyed it and were able to make use of it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59a40b58b4bf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/using-helm-with-kubernetes-59a40b58b4bf">Using Helm with Kubernetes</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Amazon Elastic Container Service for Kubernetes (EKS)]]></title>
            <link>https://medium.com/appfleet/understanding-amazon-elastic-container-service-for-kubernetes-eks-44335ac9d69d?source=rss----b6c4c2bbfcd6---4</link>
            <guid isPermaLink="false">https://medium.com/p/44335ac9d69d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[appfleet team]]></dc:creator>
            <pubDate>Mon, 13 Jul 2020 13:46:05 GMT</pubDate>
            <atom:updated>2020-07-13T13:46:05.797Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*veqQGt2L17LB0X_m.png" /></figure><p>Amazon Elastic Container Service for Kubernetes or EKS provides a <em>Managed Kubernetes Service</em>. Amazon does the undifferentiated heavy lifting, such as provisioning the cluster, performing upgrades and patching. Although it is compatible with existing plugins and tooling, EKS is not a proprietary AWS fork of Kubernetes in any way. This means you can easily migrate any standard Kubernetes application to EKS without any changes to your code base. You’ll connect to your EKS cluster with kubectl in the same way you would have done in a <em>self-hosted</em> Kubernetes.</p><p>At this stage, EKS is very loosely integrated with other AWS services. This is definitely expected to change over time though, as EKS adoption increases. That, said, Kubernetes is much more popular than either Elastic Beanstalk or ECS.</p><h4>Managed Control Plane</h4><p>EKS provides a Managed Control Plane, which includes Kubernetes master nodes, API server and the etcd persistence layer. As part of the <em>highly-available</em> control plane, you get 3 masters, 3 etcd and 3 worker nodes, where AWS provisions automatic backup snapshotting of etcd nodes alongside automated scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/0*RNW24cpo26nRnf88.png" /></figure><p>With EKS, AWS is responsible for maintaining master nodes for you by provisioning these nodes in multiple high-availability zones to maintain redundancy. So, as your workload increases, AWS will add master nodes for you. If you were running your own Kubernetes cluster, you’d have to scale it up whenever you added a worker node.</p><h4>VPC Networking</h4><p>EKS runs a network topology that integrates tightly with a Virtual Private Network. EKS uses a <strong>Container Network Interface</strong> plugin that integrates the standard Kubernetes overlay network with VPC networking. This plugin allows you to treat your EKS deployment as just another part of your existing AWS infrastructure. Things like <strong>network access</strong>, <strong>control list</strong>, <strong>routing tables</strong> and <strong>subnets</strong> are all available in the Kubernetes applications running in EKS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/0*3IciOZYTphN3jB6b.png" /></figure><p>Each pod gets an IP address on an Elastic Network Interface, where these addresses belong to the block of the subnet where the worker node is deployed. In the diagram above, you can see the IP addresses assigned to the Virtual Ethernet Adapter on each pod. These pod IP addresses are <em>fully rideable</em> within the VPC, and they comply with all the policies and access controls at the network level. So, things like security groups and ACL remain in effect. On each EC2 instance or worker node, Kubernetes runs a daemon set that hosts the CNI plugin. This plugin is a thin layer that communicates with the network local control point. This network local control plane maintains a pool of available IP addresses. So, when the kubelet on a node schedules a pod, it asks the CNI plugin to allocate an IP address. At this point, the CNI plugin allocates an IP, grabs secondary IP address and associates it with the pod. It then hands that configuration back to the kubelet.</p><h4>EKS-Optimized AMI</h4><p>This thing is based on Amazon Linux too. It comes pre-configured to work with EKS out-of-the-box. It has all the required services pre-installed including Docker, the Kubelet and AWS IAM Authenticator. When you are provisioning your EKS worker nodes with the AWS supplied cloud formation template, it launches your worker nodes with some EC2 user data script which bootstraps the nodes with configuration allowing them to join your EKS cluster automatically.</p><h4>Conclusion</h4><p>Amazon EKS on AWS provides a great opportunity to create a self-hosted <em>managed</em> Kubernetes cluster. It is also compatible with open-source Kubernetes, and can be safely migrated to any other Kubernetes instance at any time. Worth to mention, that for users who use solutions for centralized management of Kubernetes clusters, it makes sense to go with EKS instead of any other option such as ECS, since EKS exposes the same API as an open-source Kubernetes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44335ac9d69d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/appfleet/understanding-amazon-elastic-container-service-for-kubernetes-eks-44335ac9d69d">Understanding Amazon Elastic Container Service for Kubernetes (EKS)</a> was originally published in <a href="https://medium.com/appfleet">appfleet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>