Containers 101: What is container technology, what is Kubernetes and why do you need them?
Richard Harris, Joel Nelson
What are containers?
Containers make it possible for an application to run consistently and reliably, regardless of the operating system or infrastructure environment. Containers do this by bundling up everything a service needs to run — code, runtime, system tools, system libraries and settings — creating a portable, standalone, executable package.
What is a container used for?
- Modernizing existing applications in the cloud
- Creating new applications that maximize the benefits of containers
- Isolating, deploying, scaling and supporting microservices and distributed apps
- Boosting DevOps efficiency/effectiveness through streamlined build/test/deployment
- Providing developers with consistent production environments, isolated from other applications and processes
- Simplifying and accelerating repetitive functions
- Facilitating hybrid and multicloud computing environments, since containers are able to run consistently anywhere
What is containerization?
Containerization — the act of creating a container — involves pulling out just the application/service you need to run, along with its dependencies and configuration, and abstracting it from the operating system and the underlying infrastructure. The resulting container image can then be run on any container platform. Multiple containers can be run on the same host and share the same OS with other containers, each running isolated processes within its own secured space. Because containers share the base OS, the result is being able to run each container using significantly fewer resources than if each was a separate virtual machine (VM).
What are the benefits of containers?
- Containers are lightweight: Because they’re isolated from the OS layer, containers are efficient and light on resources compared to virtual machines.
- Containers are portable: Since the container includes all of the dependencies and configurations, you can write once and move between environments.
- Containers are scalable: Due to their small size, containers rapidly spin up, scale on the fly, spin down when not in use and quickly restart when necessary.
- Containers can be cost-effective: Through reduced resource demands and smart scaling, containers offer a solution that is resilient, fast-paced and cost-efficient.
- Containers require you to manage less infrastructure: Containers force you to get to the nuts-and-bolts of what you really need, to deliver an experience that best serves your customers. This makes managing infrastructure easier — because there’s less infrastructure to manage.
- Containers enable focus: IT teams will spend less time with guest operating systems and physical hardware, enabling them to engage with business-critical projects.
- Containers accelerate development: Containers provide a stable, predictable environment, where CPU/memory is optimized and code is abstracted from infrastructure for portability.
- Containers unlock modern architecture: Using containers, developers can break applications into microservices, which can speed up development and, when deployed, be scaled individually.
What are the challenges of containers?
- Containers are relatively new: Kubernetes was first released in 2014 and has rapidly gained market acceptance. Being a “hot tech” can make it challenging to find experienced technologists who know how to work within containerized environments.
- Not all services are containerized: If your application relies on services that aren’t containerized, you might need to heavily invest to transform it into a container solution.
- Containers require process and skills changes: Containers can accelerate your transition to more agile, efficient development, but this can mean major changes to your current development, deployment, reviewing and monitoring processes. Similarly, existing teams might need to be adjusted and retrained.
- The technology is evolving at speed: This isn’t unique to containers, but the fast-paced nature of container technology means you need people on hand (or partners) to make sound decisions, reduce risk and ensure implementation isn’t stymied by corporate inertia.
- Containers aren’t a magic bullet: Skim a benefits list and containers might look ideal, but any transition requires serious thought. You must understand what you have to work with, what will work and what won’t — or find someone to help you through it.
Containers vs. virtual machines
Containers and virtual machines are both “packages.” A container is a package that includes your application and everything it needs to run, aside from the operating system. A virtual machine is a package that includes your application and everything it needs to run, including the operating system itself.
You can run multiple containers on a single operating system. And you can run multiple virtual machines on a single piece of hardware. You can even run containers on virtual machines.
One key advantage containers have over virtual machines is that, because they don’t include the operating system, containers require fewer system resources and less overhead. They also tend to be faster to start/stop and they’re ultra-portable across environments. But they still take up infrastructure capacity when they’re idle, which can run up unnecessary costs.
Docker vs. Kubernetes
Docker technology makes it possible to create and run containers — and it’s the industry standard for what defines a “container.” Kubernetes (abbreviated as k8s) makes it possible to manage (or “orchestrate”) all of your containerized workloads, including provisioning, networking, load balancing, securing and scaling. Docker can be run standalone without Kubernetes, but Kubernetes cannot function without a container service like Docker.
As of 2021, Docker has virtually all of the market share of the containerization space. There are many competing Kubernetes products in the marketplace, with self-managed Kubernetes installed in 50% of companies surveyed by StackRox. The top five are self-managed Kubernetes (50%), Amazon EKS (44%), Azure AKS (31%), RedHat OpenShift (22%) and Amazon ECS (20%).
What is container orchestration?
If you have just a handful of containers and two or three applications, container orchestration might not be necessary. But once the numbers grow, things become complicated. Container orchestration from Kubernetes makes it possible to deploy, scale and manage thousands of containerized applications, automatically.
Benefits of Kubernetes container orchestration include:
- Service discovery and load balancing
- Automatically mount storage systems of your choice
- Automated rollouts and rollbacks
- Optimal use of resources
- Self-healing Kubernetes (restart failed containers; kill those that don’t respond to user-defined health checks)
- Store and manage sensitive information
- Deploy and update configurations without rebuilding container images
What are the main container tools and technologies?
Docker and Kubernetes are the big names in the container space. Docker is an open source container platform. Kubernetes is the most popular option for container orchestration — although alternatives exist, such as Docker Swarm and VMware Tanzu. Major cloud providers — including AWS, Google and Microsoft Azure — offer containers as a service (CaaS) products as well.
When are containers the best option and when should you consider something different?
Containers are a great option if you’re building a new application from scratch, are looking to apply a microservices-based architecture, or are looking for an ultra-portable, build-once-deploy-anywhere solution. But what about your existing, monolithic applications?
Just as some physical machines don’t translate to virtual machines, applications that demand a lot of resources might not be good candidates for containerization. To make a CPU and RAM hungry application into a container, you’d need to break up how it works. This would require development time and money for little or no benefit and therefore would not be justified.
Container solutions from Rackspace Technology
The experts at Rackspace Technology have extensive experience architecting and designing containerization platform solutions. We take an agnostic approach, using the container orchestration platform that will provide you with the most value — across Kubernetes, DockerSwarm and Rancher, and cloud-native tooling such as ECS, EKS, AKS and GKE. From the outset of your containerization initiative, our specialists will work closely with you to understand your application architecture, then design and build a complete container solution that integrates networking, volumes, compute resources and more. Start your containerization journey today.
Are You Realizing the Cloud Optimization Benefits of Kubernetes and Containers?
September 22nd, 2023
Google Cloud Next ’23 Highlights— AI and Beyond
September 14th, 2023
Why You Need an MLOps Framework for Standardizing AI and Machine Learning Operations
September 12th, 2023