Tag Archive

Below you'll find a list of all posts that have been tagged as "Amazon Aws"
blogImage

A Complete Guide To Cloud Containers

This blog article briefs the current technological trends and advances made to enable cloud scale orchestration possible. VMware brought physical machine virtualization to commercial world about a decade ago. Today it is Containers based micro services that is doing it again. Docker, Kubernetes and Mesos are being discussed everywhere and are projected as the next big thing to watch out for.This article tries to explore this latest buzz around Containers.1 IntroductionPhysical machine virtualization has started off a great trend in many areas. Today virtualization is an umbrella term widely used everywhere. Any place, where a logical handle of a physical resource is provided, enabling sharing of the physical resource is deemed virtualized. Virtualization by extended definition enables higher utilization of deployed resources. There is not just compute [CPU] virtualization, there is storage and network virtualization too. It has been known for some time that CPU performance lay wasted, as its performance is far ahead than either the network or memory components. Therefore it was assumed virtualizing CPU would provide more benefits. The success of virtual machine adaptation in varied domain puts any argument against to rest, beyond any doubt.Companies widely posted their success stories to describe the scaling of their physical infrastructure and failure resolution. Industry got busy integrating virtual machines as part of standard workflow. But then there was Google, who were not just experimenting but deploying with great success in live networks another new model called Containers. In short, containers are lightweight totally isolated userland sandbox for running processes when compared to virtual machines 1.Before Software defined anything was even spoken about, Google had designed their very own Borg Cluster running and managing container based micro services. Google made lots of assumptions to begin with, and in hindsight some of them were great. This learning they had with container management is being used in the design and implementation of Kubernetes. The container lifecycle management by itself is done by Docker engine, part of Docker. And then there is Mesos.To understand and appreciate Kubernetes, Mesos and Docker engine, it will be worth the effort to look at their fundamental building blocks.Figure 1: VM vs Containers2 Some HistorySolaris projects/zones, BSD Jails and LXC containers all do userspace compartments. The basis for all this stems from chroot system call introduced way back in 1982! Although chroot accomplished a new root filesystem view for applications to run, it opened up the need for rest of the OS pieces to be virtualized too. And *bsd jails has been doing total container virtualization since time immemorial. But today, Linux seems to rule the world! With relatively recent advancements in Linux for control groups and namespaces, it enhanced Linux to have highly sandboxed environment for containers. And Docker Inc, opensourced a suite of tools, that provides a clean and easy workflow to distribute, create and run container based solutions.And Kubernetes and Mesos applications are built over native OS support on containerization. It would be prudent to note that only userspace virtualization is possible in container world. If different versions of OS, or different OS are needed, then virtual machines are needed still. And with Windows OS, also working with Docker for container integration, we sure will see many cloud services being run as containers on multiple OS’es.With that background out of our way, let us understand the major pieces that Docker has brought in today.3 Build, Ship and Run anywhereWhy does everyone love containers? It makes development, test and deployment easy, by recreating the same environment from development everywhere.Normally, requirements come from customers and an engineering team starts working on it. Once the application is signed off by dev team, then testing team tries to install the application, where all application dependencies needs to be satisfied. That is inhouse and the environment can be controlled. But deployment is never easy, because the customers environment can have conflicting set of applications running, and satisfying dependencies for the new application along with those existing, is to lightly put a nightmare. What does container world do here? Every application has its own set of libraries in the filesystem defined part of its image, and completely isolated from other processes/application in the system. Voila!! no more deployment nightmares. And setting up that entire applications based on containers has been nicely solved by Docker.4 Docker SuiteDocker comes out with a suite of tools that together help organize, manage and deploy easily containers for real life applications.4.1 Docker EngineDocker engine is the core technology that enables creating, destroying and deploying containers. They connect to Docker Registry to pull/push container images. Docker engine has two parts to it. Docker engine server is a daemon that manages container lifecycle methods and exposes its functionality through a REST endpoint. A Docker command line program exists that can run anywhere and manage containers by connecting to the REST endpoint over the network.4.2 Docker RegistryDocker Registry hosts container Images. These Registries are publicly available through Docker Hub. Additionally, these Registries can be setup inhouse as well. Docker Images are the containers filesystem. So, by defining a method for hosting these Images at a Registry, Docker has made is really easy to share Images across. Versioning of Docker images is also supported. Additionally, Docker Images are being developed inline with opencontainer initiative. https://www.opencontainers.org/4.3 Docker ComposeThis is a utility that helps setting up a multiple container application environment. With Docker Compose, a template can be defined that captures all the dependencies. This can then be passed along to Docker Compose, to create this environment repeatedly and easily everytime. As simple as running ”‘docker-compose up”’.Figure 2: CloudApplications4.4 Docker MachineDocker machine can create virtual machines that can be readily used for container deployment. It uses virtualbox, or other supported drivers https://docs.docker.com/build/builders/drivers/docker/ to create the virtual machine that is docker ready.4.5 KiteMaticKiteMatic is Docker native GUI for working with containers locally on personal machine. It is currently supported on Mac and will support Windows soon. It installs a virtualbox and provisions containers inside a virtual machine locally.4.6 Docker SwarmDocker Swarm supports managing a cluster of machines in a network that is running Docker engine. Swarm agents running on each machine, run a voting algorithm and elect a master node for the cluster. All operations on the cluster are routed to the swarm master node. A distributed kv store like etcd, zookeeper or consul is used to keep the swarm nodes in good health and recover from node failures.5 So what is Kubernetes and Mesos about?Kubernetes and Mesos are higher level software stack used for managing applications on a cluster built over containers.Just like the technology, applications 2 are changing too. We are so used to client-server applications where the applications were small and the servers powerful(consider databases, workflow apps etc). Those class of applications are fast changing. Today, cloud scale applications are another class of applications where the applications are resource hungry and individual servers can hardly satisfy them (think of youtube, twitter, facebook etc). So we should understand that LXC (linux containers) and docker engine play a key part in creating largerFigure 3: Kubernetes StackFigure 4: Mesos Cluster Configurationframeworks. But apart from using container technology as its basis, Kubernetes and Mesos approach cluster utilization in two different ways.Kubernetes 3 understands and manages container based application lifecyles great. While Docker engine can ease out sharing container images, creating and running containers; applications are a slew of containers, that needs to be constantly updated, bugs fixed and new enhancements brought it or downgraded for any critical issues that are found, provide fault tolerance etc. Kubernetes is very good at enforcing application lifecycle management. We could really appreciate the power Kubernetes brings to the table. Google has applied its vast experience in running containers to the design, and it shows. Try comparing Kubernetes with Docker Compose or the concept of PODs, Replication Controller or Services on Kubernetes which are non-existant in Docker. But not all applications are micro services that can easily be packaged as a containers.And that is where Mesos excels! Mesos 4 solves this other class of problems by integrating frameworks http://mesos.apache.org/documentation/latest/ mesos-frameworks/. Each of these frameworks are plugins to the Mesos. And these frameworks teach Mesos to handle new application classes, like mapreduce, MPI etc. Mesos natively only controls cluster membership and failovers.Figure 5: Mesosphere StackThe scheduling is offloaded to frameworks. Mesos slaves inform masters about resource availability, Mesos Master runs an Allocation Policy Module, which determines the framework to offer this resource. Frameworks decide to either accept or reject the offer. If accepted, then they provide details of the tasks to run, and the Mesos Master shares the task information to Mesos Slaves, that continue to run them and provide results and status as necessary.What if one were to integrate these two software stacks together to get the best of both worlds! Mesosphere 5 did just that, they call it Datacenter Operating Systems (DCOS). But that is a story for another day. ReferencesDocker Inc, https://www.docker.comKubernetes, https://kubernetes.ioMesos, http://mesos.apache.org/Linux Containers, https://en.wikipedia.org/wiki/LXCFreeBSD Jails, https://en.wikipedia.org/wiki/FreeBSD jailMesos, http://www.slideshare.net/Docker/building-web-scale-apps-withdocker-and-mesosMesosphere, http://www.slideshare.net/mesosphere/apache-mesos-andmesosphere-live-webcast-by-ceo-and-cofounder-florian-liMesos tech paper, http://mesos.berkeley.edu/mesos tech report.pdfKubernetes, http://www.slideshare.net/wattsteve/kubernetes-48013640Containers for masses, http://patg.net/containers,virtualization,docker/2014/06/05/dockerintro/

Aziro Marketing

blogImage

Learn How to orchestrate Your Infrastructure Fleet with Chef Provisioning

Chef Provisioning is a relatively new member in the Chef family. It can be used to build infrastructure topologies using the new machine resource. This blog post shows how this is done. You bring up and configure individual nodes with Chef all the time. Your standard workflow would be to bootstrap a node, register the node to a Chef server, and then run Chef client to install software and configure the node. You would rinse and repeat this step for every node that you want in your fleet. Maybe you have written a nice wrapper over Chef and Knife to manage your clusters using Chef. Until recently, Chef did not have any way to understand the concept of cluster or fleet. So if you were running a web application with some decent traffic,there would be a bunch of cookbooks and recipes to install and configure: web servers, DB server, background processor, load balancer, etc. Sometimes, you might have additional nodes for Redis or RabbitMQ. So let us say, your cluster consists of three web servers, one DB server, one server that does all the background processing, like generate PDFs or send emails etc., and one load balancer for the three web servers. Now if you wanted to bring such a cluster for multiple environments, say “testing”, “staging,” and “production,” you would have to repeat the steps for each environment; not to mention, your environments could possibly be powered by different providers–production and staging on AWS, Azure, etc. But testing could possible be on local infrastructure, maybe in VMs. This is not difficult, but it definitely makes you wonder whether you could do it better–if only you could describe your infrastructure as code that comes up with just one command. That is exactly what Chef Provisioning does. Chef Provisioning was introduced in Chef version 12. This helps you describe your cluster as code and build it at will as many times as you want and on various types of clouds, virtual machines, or even on bare metal. The Concepts Chef provisioning depends on two main pillars–machine resource and drivers. Machine Resource “machine” is an abstract concept of a node from your infrastructure topology. It could be an AWS EC2 instance or a node on some other cloud provider. It could be a Vagrant-based virtual machine, a Linux container, or a Docker instance. It could even be a real, physical bare-metal machine. “machine” and other related resources (like machine_batch, machine_image, etc.,) can be used to describe your cluster infrastructure. Each “machine” resource describes whatever it does using standard Chef recipes. General convention is to describe your fleet and its topologies using “machine” and other resources in a separate file. We will see this in detail soon, but for now here is how a machine is described. #setup-cluster.rb machine 'server' do recipe 'nginx' end machine 'db' do recipe 'mysql' end A recipe is one of a “machine” resource’s attributes. Later we will see a few more of these along with their examples. Drivers As mentioned earlier, with Chef Provisioning you can describe your clusters and their topologies and then deploy them across a variety of clouds, VMs, bare metal, etc. For each such cloud or machine that you would like to provision, there are drivers that do the actual heavy lifting. Drivers convert the abstract “machine” descriptions into physical reality. Drivers are responsible for acquiring the node data, connecting to them via required protocol, bootstrapping them with Chef, and running the recipes described in the “machine” resource. Provisioning drivers need to be installed separately as gems. Following shows how to install and use AWS driver via environment variables in your system. $ gem install chef-provisioning-aws $ export CHEF_DRIVER=aws Running Chef-client on the above recipe will create two instances in your AWS account referenced by your settings in “~/.aws/config.” We will see an example run later in the post. Driver can be set in your knife.rb if you so prefer. Here, we set the chef-provisioning-fog driver for AWS. driver 'fog:AWS' It is possible to set driver inline in the cluster recipe code. require 'chef/provisioning/aws_driver' with_driver 'aws' machine 'server' do recipe ‘web-server-app' end In the following example, Vagrant driver is given the driver attribute and a driver URL as the value. “/opt/vagrantfiles” will be looked up for Vagrantfiles in the following case. machine 'server' do driver 'vagrant:/opt/vagrantfiles' recipe 'web-server-app' end It’s a good practice to keep driver details and cluster code separate as it lets you use the same cluster descriptions with different provisioners by just changing the driver in the environment. It is possible to write your own custom provisioning drivers. But that is beyond the scope of this blog post. The Provisioner Node An interesting concept you need to understand is that Chef Provisioner needs a “provisioner-node” to provision all machines. This node could be a node in your infrastructure or simply your workstation. chef-client (or chef-solo / chef-zero) runs on this “provisioner node” against a recipe that defines your cluster recipe. Chef Provisioner then takes care of acquiring a node in your infrastructure, bootstrapping it with Chef, and then running the required recipes on the node. Thus, you will see that chef-client runs twice–once on the provisioner node and then on the node that is being provisioned. The Real Thing Let us dig a deeper now. Let us first bring up a single DB server. Using Chef knife you can upload your cookbooks to the Chef server (you could do it with chef-zero as well). Here I have put all my required recipes in a cookbook called “cluster” and uploaded it to a Chef server and set the “chef_server_url” in my “client.rb” and “knife.rb”. You can find all the examples here. Machine #recipes/webapp.rb require 'chef/provisioning' machine 'db' do recipe ‘database-server’ end machine 'webapp' do recipe 'web-app-stack' end To run the above recipe: sudo CHEF_DRIVER=aws chef-client -r "recipe["cluster::webapp"]" This should bring up two nodes in your infrastructure — a DB server and a web application server as defined by the web-app-stack recipe. The above command assumes that you have uploaded the cluster cookbook consisting of the required recipes to the Chef server. More Machine Goodies Like any other Chef resource, machine can have multiple actions and attributes that can be used to achieve different results. A “machine” can have a “chef_server” attribute, which means different machines can talk to different Chef servers. “from_image” attribute can be used to set a machine image that can be used to create a machine. You can read more about machine resource here. Parallelisation Using machine_batch Now if you would like to have more than one web application instances in your cluster and you need more web app servers, say 5 instances, what do you do? Run a loop over your machine resource. 1.upto(5) do |i| machine "webapp-#{i}" do recipe 'web-app-stack' end end The above code snippet, when run, should bring up and configure five instances in parallel. “machine” resource parallelizes by default. If you describe multiple “machine” resources consecutively with same actions, then Chef Provisioning combines them into a single (“machine_batch”, more about this later) resource and runs it in parallel. This is great because it saves a lot of time. The following will not parallelize because the actions are different. machine 'webapp' do action :setup end machine 'db' do action :destroy end Note: if you put other resources between “machine” resources, the automatic parallelization does not happen. machine 'webapp' do action :setup end remote_file 'somefile.tar.gz' do url 'https://example.com/somefile.tar.gz' end machine 'db' do action :setup end Also, you can explicitly turn off parallelization by setting “auto_batch_machines = false” in Chef config (knife.rb or client.rb). Using “machine_batch” explicitly, we can parallelize and speed up provisioning for multiple machines. machine_batch do action :setup machines 'web-app-stack', 'db' Machine Image It is even possible to define machine images using a “machine_image” resource which can be used to build machines by the “machine” resource. machine_image 'web_stack_image' do recipe ‘web-app-stack’ end The above code will launch a machine using your chosen driver, install and configure the node as per the given recipes, create an image from this machine, and finally destroy the machine. This is quite similar to how Packer tool launches a node, configures it, and then freezes it as image before destroying the node. machine 'web-app-stack' do from_image 'web_stack_image' end Here a machine “web-app-stack” when launched will already have everything in the recipe “web-app-stack”. This saves a lot of time when you want to spin up machines, which have common base recipes. Think of a situation where team members need machines with some common stuff installed, and different people install their own specific things as per requirement. In such a case, one could create an image with the basic packages e.g., build-essential, ruby, vim, etc., and that base image could use a source machine image for further work. Load Balancer A very common scenario is to put a bunch of machines, say web-application-servers, behind a load balancer thus achieving redundancy. Chef Provisioning has a resource specifically for load balancers, aptly called “load_balancer”. All you need to do is create the machine nodes and then pass the machines to a “load_balancer” as below. 1.upto(2) do |node_id| machine “web-app-stack-#{node_id}” end load_balancer "web-app-load-balancer" do machines %w(web-app-stack-1 web-app-stack-2) end The above code will bring up two nodes–webapp-stack-1 and webapp-stack-2 and put a load balancer in front of them. Final Thoughts If you are using the AWS driver, you can set machine_options as below. This is important if you want to use customized AMIs, users, security groups, etc. with_machine_options :ssh_username => '', :bootstrap_options => { :key_name => '', :image_id => ‘', :instance_type => ‘’, :security_group_ids => '' } If you don’t provide the AMI ID, the AWS driver defaults to a certain AMI per region. Whatever AMI you use, you have to use the correct ssh username for the respective AMI. [3] One very important thing to note would be that there exists a Fog driver (chef-provisioning-fog) for various cloud services including EC2. So, there are often different names for the parameters that you might want to use. For example, the chef-provisioning-aws driver that depends on AWS Ruby SDK uses “instance_type” where as the Fog driver uses “flavor_id”. Security Groups use the key “security_groups_ids” in the AWS driver and takes ID as value, but the Fog driver uses “groups” and takes the name of the Security Group as its value. This can at times lead to confusion if you are moving from one driver to another. At the time of writing this article, I could use the help of the documentation of various drivers. The best way to understand them would be to check the examples provided, run them and learn from them–maybe even read the source code of various drivers to understand how they work. Chef Provisioning recently got bumped to 1.0.0. I would highly recommend to keep an eye on the GitHub issues in case you face some trouble. References [1] https://docs.chef.io/provisioning.html [2] https://github.com/pradeepto/chef-provisioning-playground [3] http://alestic.com/2014/01/ec2-ssh-username [4] https://github.com/chef/chef-provisioning/issues  

Aziro Marketing

EXPLORE ALL TAGS
2019 dockercon
Advanced analytics
Agentic AI
agile
AI
AI ML
AIOps
Amazon Aws
Amazon EC2
Analytics
Analytics tools
AndroidThings
Anomaly Detection
Anomaly monitor
Ansible Test Automation
apache
apache8
Apache Spark RDD
app containerization
application containerization
applications
Application Security
application testing
artificial intelligence
asynchronous replication
automate
automation
automation testing
Autonomous Storage
AWS Lambda
Aziro
Aziro Technologies
big data
Big Data Analytics
big data pipeline
Big Data QA
Big Data Tester
Big Data Testing
bitcoin
blockchain
blog
bluetooth
buildroot
business intelligence
busybox
chef
ci/cd
CI/CD security
cloud
Cloud Analytics
cloud computing
Cloud Cost Optimization
cloud devops
Cloud Infrastructure
Cloud Interoperability
Cloud Native Solution
Cloud Security
cloudstack
cloud storage
Cloud Storage Data
Cloud Storage Security
Codeless Automation
Cognitive analytics
Configuration Management
connected homes
container
Containers
container world 2019
container world conference
continuous-delivery
continuous deployment
continuous integration
Coronavirus
Covid-19
cryptocurrency
cyber security
data-analytics
data backup and recovery
datacenter
data protection
data replication
data-security
data-storage
deep learning
demo
Descriptive analytics
Descriptive analytics tools
development
devops
devops agile
devops automation
DEVOPS CERTIFICATION
devops monitoring
DevOps QA
DevOps Security
DevOps testing
DevSecOps
Digital Transformation
disaster recovery
DMA
docker
dockercon
dockercon 2019
dockercon 2019 san francisco
dockercon usa 2019
docker swarm
DRaaS
edge computing
Embedded AI
embedded-systems
end-to-end-test-automation
FaaS
finance
fintech
FIrebase
flash memory
flash memory summit
FMS2017
GDPR faqs
Glass-Box AI
golang
GraphQL
graphql vs rest
gui testing
habitat
hadoop
hardware-providers
healthcare
Heartfullness
High Performance Computing
Holistic Life
HPC
Hybrid-Cloud
hyper-converged
hyper-v
IaaS
IaaS Security
icinga
icinga for monitoring
Image Recognition 2024
infographic
InSpec
internet-of-things
investing
iot
iot application
iot testing
java 8 streams
javascript
jenkins
KubeCon
kubernetes
kubernetesday
kubernetesday bangalore
libstorage
linux
litecoin
log analytics
Log mining
Low-Code
Low-Code No-Code Platforms
Loyalty
machine-learning
Meditation
Microservices
migration
Mindfulness
ML
mobile-application-testing
mobile-automation-testing
monitoring tools
Mutli-Cloud
network
network file storage
new features
NFS
NVMe
NVMEof
NVMes
Online Education
opensource
openstack
opscode-2
OSS
others
Paas
PDLC
Positivty
predictive analytics
Predictive analytics tools
prescriptive analysis
private-cloud
product sustenance
programming language
public cloud
qa
qa automation
quality-assurance
Rapid Application Development
raspberry pi
RDMA
real time analytics
realtime analytics platforms
Real-time data analytics
Recovery
Recovery as a service
recovery as service
rsa
rsa 2019
rsa 2019 san francisco
rsac 2018
rsa conference
rsa conference 2019
rsa usa 2019
SaaS Security
san francisco
SDC India 2019
SDDC
security
Security Monitoring
Selenium Test Automation
selenium testng
serverless
Serverless Computing
Site Reliability Engineering
smart homes
smart mirror
SNIA
snia india 2019
SNIA SDC 2019
SNIA SDC INDIA
SNIA SDC USA
software
software defined storage
software-testing
software testing trends
software testing trends 2019
SRE
STaaS
storage
storage events
storage replication
Storage Trends 2018
storage virtualization
support
Synchronous Replication
technology
tech support
test-automation
Testing
testing automation tools
thought leadership articles
trends
tutorials
ui automation testing
ui testing
ui testing automation
vCenter Operations Manager
vCOPS
virtualization
VMware
vmworld
VMworld 2019
vmworld 2019 san francisco
VMworld 2019 US
vROM
Web Automation Testing
web test automation
WFH

LET'S ENGINEER

Your Next Product Breakthrough

Book a Free 30-minute Meeting with our technology experts.

Aziro has been a true engineering partner in our digital transformation journey. Their AI-native approach and deep technical expertise helped us modernize our infrastructure and accelerate product delivery without compromising quality. The collaboration has been seamless, efficient, and outcome-driven.

Customer Placeholder
CTO

Fortune 500 company