VMware K8s For Operators Ebook
VMware K8s For Operators Ebook
Operators
K U B E R N E T E S F O R O P E R AT O R S
Table of Contents
Containers and Kubernetes: Why Operators Should Care 3 Which Flavor of Kubernetes Should You Choose? 12
2
K U B E R N E T E S F O R O P E R AT O R S
Why Operators Should Care Move applications easily between environments in response to need
If you’re part of an operations team, you know that your company’s success or cost
depends on your team’s ability to operate digital services reliably at scale.
Enterprises are increasingly turning to cloud native technologies, including Cloud native technologies are new and evolving fast. A whole ecosystem of
containers and Kubernetes, to achieve this goal. solutions and services is emerging to address a wide variety of use cases
and needs. There’s a lot to learn. This eBook will help you map your
If you are contemplating this transition, you are likely under pressure from
company’s journey to containers and Kubernetes, including important
above and below. Executives are asking you to deliver more reliable services
questions your team should ask itself and an exploration of the most
at a lower price point, while development teams want containerized
common missteps.
infrastructure on which to create and deliver new applications.
Eliminate the need to manage application dependencies at the Infrastructure engineers, systems engineers, and site reliability
infrastructure level engineers (SREs)—anyone responsible for the infrastructure on which
Kubernetes will run—can benefit.
3
K U B E R N E T E S F O R O P E R AT O R S
Why Containers? database with some interesting features layered on top of it. Kubernetes uses
a set of controllers that each implement specific capabilities and work
together to produce the end result. Kubernetes controllers can be ripped out
One of the big challenges that operations teams face is the complexity of
and replaced to extend the system and adapt it to new requirements and
managing highly custom applications and the difficulty of moving applications
environments.
from one environment to another. By encapsulating all of an application’s
dependencies, containers make applications much more portable—and The diagram below shows the parts of a typical Kubernetes system. The core
therefore make an operator’s job simpler. A container can move from of the system is the database, etcd. The state of the cluster is stored there
development to QA to production—or from one cloud environment to (and only there). In front of etcd is the API Server. Nothing else in Kubernetes
another—without requiring any changes to the container—and with no talks to etcd directly. The API Server exposes a RESTful interface and
hardware and software reconfigurations in the target environment. provides the services necessary in a distributed system.
While many organizations are moving existing legacy applications into ALL interactions with Kubernetes are mediated via APIs. This approach
containers more or less as is, new application development makes use of can be a big change for both operations teams and developers.
containers in conjunction with a microservices architecture that breaks down
an application into component services. From an operational standpoint, there
are two critical things to understand about the microservices approach: Containers encapsulate an application in a form that’s
applications scale out instead of scaling up, and there are many more portable and easy to deploy. Containers can run on any
application components to manage compatible system—in any cloud—without changes.
Containers consume resources efficiently, enabling high
density and utilization.
A Kubernetes Primer
Kubernetes makes it possible to deploy and run complex
Container environments change more rapidly than VM environments. Having applications requiring multiple containers by clustering
a way to manage containerized applications effectively is an essential physical or virtual resources for application hosting.
element of cloud native and microservices architecture. Kubernetes has Kubernetes is extensible, self-healing, scales applications
emerged as the leading solution for orchestrating and managing automatically, and is inherently multi-cloud.
containerized applications.
Microservices architecture breaks down an application into
The components of Kubernetes “play off” each other to coordinate activities multiple component services, enabling greater parallelism
and react to events like musicians playing jazz. At its core, Kubernetes is a during both development and execution.
4
K U B E R N E T E S F O R O P E R AT O R S
make the state of the world match its configuration. If a controller can’t fully
achieve the desired state, it retries. Controllers are both patient and diligent,
resulting in a very stable distributed system pattern that is self-healing. If
MASTER NODE something goes wrong, a controller will work to fix it. If the desired state
changes while a controller is working, it changes course and works toward the
etcd API Server Kublet Docker new desired state. Controllers react to each other very quickly, making
Kubernetes extremely responsive. The actions of the system adapt to the
state of the world in real time.
NODE
Scheduler
Controller
Kublet Docker
How Kubernetes Helps Operators
Manager
Kubernetes Controllers
Kubernetes Controllers ensure that the observed state of the cluster is as close Portability Integration Community
as possible to your desired state. Each controller monitors its configuration, Run Kubenetes everywhere. Build on your SDDC Move in lockstep with the
infrastructure. community.
stored in the API Server. It then looks at the state of the world and tries to Leverage a common upstream
framework to run workloads Apply Kubernetes as a practical Work with a partner that
on-premises, in public clouds path to public cloud adoption demonstrates leadership in the
or hybrid cloud open source community.
5
K U B E R N E T E S F O R O P E R AT O R S
necessary tools to facilitate Operator creation. To make Cluster API work for a particular type of
If you are new to Kubernetes, there are two
environment, you need a provider for that
emerging elements of the environment that you
should know about. These two things are rapidly environment. Provider implementations are already
changing the way that operators interact with Cluster API Streamlines available for major public clouds as well as VMware
Kubernetes:
Kubernetes Provisioning and vSphere. GitHub has a list of many of the available
providers.
Operators. Custom Kubernetes Management
controllers that implement domain-
specific logic for an application Infrastructure-level management is an area of rapid Where to Learn More
evolution for Kubernetes. Cluster API is a
Cluster API. Declarative APIs that Kubernetes project to bring declarative, The What and the Why of the Cluster API
facilitate cluster creation, configuration, [blog]
Kubernetes-style APIs to cluster creation,
and management in the Kubernetes
ecosystem configuration, and management. It provides
Cluster API Gitbooks
additive functionality on top of core Kubernetes.
6
K U B E R N E T E S F O R O P E R AT O R S
Enable your stakeholders. Don’t ignore the needs of others that will
be using the platform. If developers are used to being able to access
system logs for debugging, make sure they still have access and
know how to take advantage of any new tools.
7
K U B E R N E T E S F O R O P E R AT O R S
8
K U B E R N E T E S F O R O P E R AT O R S
Question 3: How many clusters Persistent storage. A surprising number of teams get fairly far along in the
Kubernetes planning process without thinking about storage. Similar to
should I build? networking, Kubernetes provides storage flexibility through drivers that
conform to the Container Storage Interface (CSI). Many storage vendors offer
A question that comes up all the time is whether or not to have everything in drivers for compatibility with Kubernetes. You can view a list of available CSI
a single large cluster. You should think of Kubernetes as a multi-cluster drivers on GitHub.
solution and cultivate a multi-cluster mindset. Having multiple clusters
reduces the size of each failure domain and provides you with greater Connectivity. Plan ahead to make sure you have the appropriate
flexibility going forward. For example, you can stand up a new cluster with a infrastructure surrounding Kubernetes to support your application needs.
new feature and migrate services to that cluster to take advantage of the This may include things like load balancers and ingress controllers.
feature.
Security. A final item that’s hard to bolt-on to Kubernetes after the fact is
As a purely practical matter, the maximum “comfortable” size of a security. Be sure and involve your security team in Kubernetes planning.
Kubernetes cluster is around 500 nodes. Beyond that, you will have to start
tuning Kubernetes itself to continue scaling; that’s an arduous process..
Question 5: What about security?
Question 4: What about underlying The security model is an area that people often overlook during Kubernetes
planning phases:
infrastructure?
Multi-team vs. Multi-tenant. This distinction can be useful to think about
There are several infrastructure “plumbing” considerations that you definitely during security planning:
need to think about and understand before you begin to deploy. These may
be difficult to change after the fact: Multi-team. You need infrastructure to support different teams within the
same organization so there is a certain level of trust.
Container networking. Kubernetes gives you flexibility regarding networking
through Container Network Interface (CNI) plugins. There are a variety of CNI Multi-tenant. You need infrastructure to support separate organizations
plugins that support various approaches to software-defined networking where there is no trust relationship.
(SDN) and various network options. If you have to have a particular network
This distinction affects your approach to security. Kubernetes does not have
capability (for example multicast) you’ll need a CNI that supports that
a hard multi-tenancy design. Multi-tenancy can be enabled, but it doesn’t
feature. You can view a list of available CNI plugins on GitHub.
come right out of the box.
9
K U B E R N E T E S F O R O P E R AT O R S
Authentication/authorization. Use something like OIDC and connect your Kubernetes projects in areas ranging from database to key management to
existing authentication system to Kubernetes from the beginning. It’s simple observability, making it a little easier to identify the ones that you want to
to do and worth the effort. either adopt immediately or track for possible future use. Be warned,
however, that the number of items in the landscape is already a little
Policies. People often deploy Kubernetes and forget to configure things overwhelming.
like resource quotas and pod security policies. These are essential both to
secure your cluster and to achieve high levels of utilization.
10
K U B E R N E T E S F O R O P E R AT O R S
11
K U B E R N E T E S F O R O P E R AT O R S
The major cloud providers all offer Kubernetes platforms that provide an However, this is the option that gives you the most flexibility and the greatest
easy, turnkey solution that you can use to get up and running with control. Our opinion is that it’s not as hard as people think and you shouldn’t
Kubernetes in a managed environment. The hosted cloud solutions have all simply rule it out. We continue to believe that this is the best option for many
committed to maintaining compatibility with upstream Kubernetes. However, organizations.
if portability is important to your operations, you still need to be careful to
avoid incorporating other services that are only available in a particular cloud.
12
K U B E R N E T E S F O R O P E R AT O R S
Avoiding Missteps
The following table describes some of the most
common missteps that we see organizations
make as they move to adopt Kubernetes—along
with tips on how to avoid them.
It’s awesome to no longer have to manage With platforms that aren’t extensible, if you This misstep is a corollary to the previous
your control pane. However, there are don’t start out with a capability, it’s hard to one. You can waste a lot of cycles guessing
downsides associated with not having full add later. Kubernetes turns this paradigm on about future requirements and trying to build
control. Some limitations may be its head. Designing solutions for problems an ideal solution. If you narrow your scope,
showstoppers. with tips on how to avoid you think may arise in the future just adds you can finish deployment more quickly and
them. complexity and delays deployment. start gaining operational experience.
13
K U B E R N E T E S F O R O P E R AT O R S
If you look at the CNCF landscape, there are The burden to support open source software It is easy to add workloads to an existing
a lot of interesting technologies. Resist the falls on you. Be diligent in evaluating a cluster, but new apps may require changes
temptation to bet your business on project before adopting it: How many stars that have undesired effects elsewhere, even
technology that’s brand new. Track does it have? How healthy is its community? compromising security. It’s better to have
interesting projects and give them time to Are people responsive? Are pull requests multiple smaller clusters. Managed
mature. reviewed and merged? Are there guidelines Kubernetes makes it fast and easy to add
for contributors? new clusters for unique requirements.
Federation is a hard problem, and current To increase resource utilization, you must Operators are becoming the preferred way
tools likely won’t meet your needs. Instead, implement resource quotas that ensure that for managing domain-specific knowledge
ensure you have copies of application no one person or application consumes too and simplifying application management in
containers and data where they can be used many Kubernetes resources. This allows you Kubernetes. Take advantage of existing
for DR. A modest substitution of human to do tighter bin packing on each node. operators when they are available and
effort for fancy federation insulates you from modify or build your own operators when
outages that span zones. necessary.
14
K U B E R N E T E S F O R O P E R AT O R S
Consider downloading one of the development tools mentioned earlier and kick the
tires, or install minikube on your local machine to get more familiar with Kubernetes. In
addition, VMware has a variety of resources for everyone on the Kubernetes journey:
TGIK
Every Friday at 1PM Pacific Time, VMware holds an informal hangout session focusing
on a specific Kubernetes-related topic. You can see the archive of past sessions on
YouTube and subscribe to view the live sessions.
Read our regular blog to find out the latest. Posts cover diverse topics and new blogs
are posted regularly.
Learn about Cluster API, how it works, its current state, and why it’s crucial for the
future of Kubernetes.
And be sure and follow @cloudnativeapps on Twitter to keep up with all the latest
cloud native developments.
15