blob: 26b34d5dff6901679d9106206662ca34de9583f2 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Apache Cassandra | Apache Cassandra Documentation</title>
<link rel="stylesheet" href="../../assets/css/site.css">
<meta name="description" content="The Apache Cassandra Community">
<link rel="schema.dcterms" href="https://purl.org/dc/terms/">
<meta name="dcterms.subject" content="_">
<meta name="dcterms.identifier" content="master">
<meta name="generator" content="Antora 2.3.4">
<link rel="icon" href="../../assets/img/favicon.ico" type="image/x-icon">
<script>
const script = document.createElement("script");
const domain = window.location.hostname;
script.type = "text/javascript";
script.src = "https://plausible.cassandra.apache.org/js/plausible.js";
script.setAttribute("data-domain",domain);
script.setAttribute("defer",'true');
script.setAttribute("async",'true');
document.getElementsByTagName("head")[0].appendChild(script);
</script> </head>
<body class="single-post">
<div class="container mx-auto relative">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<meta property="og:type" content="website" />
<meta property="og:description" content="" />
<meta property="og:url" content="/" />
<meta property="og:site_name" content="Apache Cassandra" />
<header id="top-nav">
<div class="inner relative">
<div class="header-social-icons text-right">
<a href="https://twitter.com/cassandra?lang=en" target="_blank" styles="margin-left: 20px;"><img src="../../assets/img/twitter-icon-circle-white.svg" alt="twitter icon" width="24"></a>
<a href="https://www.linkedin.com/company/apache-cassandra/" target="_blank" styles="margin-left: 20px;"><img src="../../assets/img/LI-In-Bug.png" alt="linked-in icon" width="24"></a>
<a href="https://www.youtube.com/c/PlanetCassandra" target="_blank" styles="margin-left: 20px;"><img src="../../assets/img/youtube-icon.png" alt="youtube icon" width="24"></a>
</div>
<div class="cf">
<div class="logo left"><a href="/"><img src="../../assets/img/logo-white-r.png" alt="cassandra logo"></a></div>
<div class="mobile-nav-icon right">
<img class="toggle-icon" src="../../assets/img/hamburger-nav.svg">
</div>
<ul class="main-nav nav-links right flex flex-vert-center flex-space-between">
<li>
<a class="nav-link hide-mobile">Get Started</a>
<ul class="sub-menu bg-white">
<li class="pa-micro">
<a href="/_/cassandra-basics.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-basics.png" alt="cassandra basics icon">
</div>
<div class="sub-nav-text teal py-small">
Cassandra Basics
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/quickstart.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-rocket.png" alt="cassandra basics icon">
</div>
<div class="sub-nav-text teal py-small">
Quickstart
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/ecosystem.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-ecosystem.png" alt="cassandra basics icon">
</div>
<div class="sub-nav-text teal py-small">
Ecosystem
</div>
</a>
</li>
</ul>
</li>
<li><a class="nav-link" href="/doc/latest/">Documentation</a></li>
<li>
<a class="nav-link" href="/_/community.html">Community</a>
<ul class="sub-menu bg-white">
<li class="pa-micro">
<a href="/_/community.html#code-of-conduct">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-welcome.png" alt="welcome icon">
</div>
<div class="sub-nav-text teal py-small">
Welcome
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#discussions">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-discussions.png" alt="discussions icon">
</div>
<div class="sub-nav-text teal py-small">
Discussions
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#project-governance">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-governance.png" alt="Governance icon">
</div>
<div class="sub-nav-text teal py-small">
Governance
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#how-to-contribute">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-contribute.png" alt="Contribute icon">
</div>
<div class="sub-nav-text teal py-small">
Contribute
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#meet-the-community">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-community.png" alt="Meet the Community icon">
</div>
<div class="sub-nav-text teal py-small">
Meet the Community
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/cassandra-catalyst-program.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-catalyst.png" alt="Catalyst icon">
</div>
<div class="sub-nav-text teal py-small">
Catalyst Program
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/events.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-events.png" alt="Events icon">
</div>
<div class="sub-nav-text teal py-small">
Events
</div>
</a>
</li>
</ul>
</li>
<li>
<a class="nav-link hide-mobile">Learn</a>
<ul class="sub-menu bg-white">
<li class="pa-micro">
<a href="/_/Apache-Cassandra-5.0-Moving-Toward-an-AI-Driven-Future.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-basics.png" alt="Basics icon">
</div>
<div class="sub-nav-text teal py-small">
Cassandra 5.0
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/case-studies.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-case-study.png" alt="Case Studies icon">
</div>
<div class="sub-nav-text teal py-small">
Case Studies
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/resources.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-resources.png" alt="Resources icon">
</div>
<div class="sub-nav-text teal py-small">
Resources
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/blog.html">
<div class="sub-nav-icon">
<img src="../../assets/img/sub-menu-blog.png" alt="Blog icon">
</div>
<div class="sub-nav-text teal py-small">
Blog
</div>
</a>
</li>
</ul>
</li>
<li><a class="nav-link btn btn--filled" href="/_/download.html">Download Now</a></li>
</ul>
</div>
</div>
</header>
<div class="hero hero--home grad">
<div class="eye"></div>
<div id="home-content" class="text-center flex flex-center flex-column relative z2 ma-xlarge">
<h1>Cassandra on Kubernetes: A Beginners Guide</h1>
<h3>September 4, 2021 | The Apache Cassandra Community</h3>
</div>
</div>
<div id="blog-post" class="flex-center py-large arrow">
<div class="blog-breadcrumb mb-medium">
<div class="inner inner--narrow">
<a href="/_/blog.html">« Back to the Apache Cassandra Blog</a>
</div>
</div>
<div class="post-content">
<div class="inner inner--narrow">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Kubernetes is a hot technology, and while it seems like everyone is using it for automating deployment, scaling, and management of containerized applications, you’ll still face fundamental issues as you try to grow from a beginner to an intermediate Kubernetes Operator. One of these hurdles is the storage and control of data.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="where-and-how-to-store-kubernetes-data"><a class="anchor" href="#where-and-how-to-store-kubernetes-data"></a>Where and how to store Kubernetes data</h3>
<div class="paragraph">
<p>Kubernetes is an amazingly flexible and robust way to host stateless computation, but the data layer isn’t a straightforward solution. Traditionally computation would happen within a cluster, with every container in that cluster requesting and updating data from a traditionally stored database.</p>
</div>
<div class="paragraph">
<p>Running applications in Kubernetes with databases external to Kubernetes creates a mismatched architecture. This situation has limited developer productivity, duplicative stacks for monitoring applications and database infrastructure, and increased cloud computing costs.</p>
</div>
</div>
<div class="sect2">
<h3 id="what-is-cassandra"><a class="anchor" href="#what-is-cassandra"></a>What is Cassandra?</h3>
<div class="paragraph">
<p>Apache Cassandra is an open source NoSQL distributed database trusted by thousands of companies for scalability and high availability without compromising performance. Linear scalability and proven fault tolerance on commodity hardware or cloud infrastructure make it the perfect platform for mission-critical data. The latest version of Apache Cassandra</p>
</div>
<div class="paragraph">
<p>Cassandra merges the ease-of-use of NoSQL with the reliability of a mature open source project. Most importantly, for real-world applications, it’s designed with distributed architectures in mind.</p>
</div>
<div class="paragraph">
<p>"Distributed" means Cassandra can run on multiple machines while appearing to users as a unified whole. There is little point in running Cassandra as a single node, although it is constructive to help you get up to speed on how it works. But to get the maximum benefit out of Cassandra, you would run it on multiple machines.</p>
</div>
</div>
<div class="sect2">
<h3 id="apache-cassandra-and-kubernetes"><a class="anchor" href="#apache-cassandra-and-kubernetes"></a>Apache Cassandra and Kubernetes</h3>
<div class="paragraph">
<p>Kubernetes has emerged as the leading orchestration platform for deploying and managing containerized systems in the cloud. Since managing infrastructure has been standardizing around Kubernetes, many organizations are looking at the data plane as something that should be managed under the same umbrella.</p>
</div>
<div class="paragraph">
<p>Kubernetes simplifies distributed systems lifecycle management. It’s natural to use Kubernetes to build your flexible, distributed database with Cassandra.</p>
</div>
</div>
<div class="sect2">
<h3 id="the-challenge-of-kubernetes-complexity"><a class="anchor" href="#the-challenge-of-kubernetes-complexity"></a>The Challenge of Kubernetes: Complexity</h3>
<div class="paragraph">
<p>Kubernetes enables you to auto-scale whole containers: providing resources and spinning up new instances, along with load balancing, but without careful management: rather than removing the complexity of managing loads and containers, Kubernetes can increase the complexity of a system, making it even harder to manage.</p>
</div>
<div class="paragraph">
<p>Running Cassandra on Kubernetes can be difficult. Kubernetes has only a limited understanding or insight into database functionality. It is blind to key operational requirements of the database that’s in use and it requires significant effort to script and leverage existing Kubernetes functionality to run a production-grade Cassandra deployment.</p>
</div>
<div class="paragraph">
<p>To reduce those complexities, the Apache Cassandra community built <a href="https://github.com/datastax/cass-operator" target="_blank" rel="noopener">Cass Operator</a>, which is installed via Helm (see below). Operators take the process of describing many of the lower-level Kubernetes components and instead provide a more straightforward, logical interface for describing an application. They provide a translation layer between what Kubernetes needs to maintain services and the actual implementation by the database.</p>
</div>
<div class="paragraph">
<p>There are multiple Kubernetes operators to try and solve the same problem, including those from <a href="https://www.instaclustr.com/products/cassandra-kubernetes-operator/" target="_blank" rel="noopener">Instaclustr</a> and <a href="https://github.com/sky-uk/cassandra-operator" target="_blank" rel="noopener">Sky UK</a>, but the Cassandra community has coalesced around Cass Operator and is <a href="/blog/Cassandra-and-Kubernetes-SIG-Update-2.html">merging features from other operators, such as CassKop</a>, which Orange developed.</p>
</div>
<div class="paragraph">
<p>As with any Kubernetes operator, the goal is to create a robot that makes it easier to set up, maintain, and scale complex configurations of containers in Kubernetes.</p>
</div>
</div>
<div class="sect2">
<h3 id="how-to-simplify-deployment-apache-cassandra-as-a-helm-chart"><a class="anchor" href="#how-to-simplify-deployment-apache-cassandra-as-a-helm-chart"></a>How to simplify deployment: Apache Cassandra as a Helm Chart</h3>
<div class="paragraph">
<p>Helm is a package manager for Kubernetes. Helm is the Kubernetes’ equivalent of yum or apt. Helm deploys charts, which you can think of like a packaged application. It is a collection of all your versioned, pre-configured application resources, which can be deployed as one unit.</p>
</div>
<div class="paragraph">
<p>The goal when adopting Cassandra on Kubernetes should be to deploy it as a single helm chart. There are many <a href="https://bitnami.com/stack/cassandra/helm" target="_blank" rel="noopener">options here from multiple vendors</a>, and the open source K8ssandra project is one of many but in active development having reached v1.3, which supports the new Apache Cassandra 4.0 GA.</p>
</div>
</div>
<div class="sect2">
<h3 id="what-is-k8ssandra"><a class="anchor" href="#what-is-k8ssandra"></a>What is K8ssandra?</h3>
<div class="paragraph">
<p><a href="https://k8ssandra.io" target="_blank" rel="noopener">K8ssandra</a> is a cloud native, open source distribution of Apache Cassandra that runs on Kubernetes. Accompanying Cassandra is a suite of tools to ease and automate operational tasks, which includes metrics, data anti-entropy services for running repairs, and backup tooling. As part of K8ssandra’s installation process, all of these components are installed and wired together and frees your teams from performing the tedious plumbing of components.</p>
</div>
<div class="paragraph">
<p>Apache Cassandra can be deployed in many environments, including bare-metal hosts, virtual machines, and container platforms. Each deployment type has its pros and cons, but in all cases automation is leveraged to ensure that all nodes are configured homogeneously and without failure.</p>
</div>
</div>
<div class="sect2">
<h3 id="operator-problems"><a class="anchor" href="#operator-problems"></a>Operator Problems</h3>
<div class="paragraph">
<p>Site reliability engineering (SRE) expertise remains an essential resource for running distributed workloads. Challenges such as configuring throttles and scheduling backups, and managing edge case failures, for example concurrent socket problems, are all things that are not currently covered by automation.</p>
</div>
<div class="paragraph">
<p>While the tools available from multiple vendors for Kubernetes can simplify the process for deploying new workloads, you will still need a team that is excited to increase their Kubernetes expertise.</p>
</div>
<div class="paragraph">
<p>The particular tools you choose for solving the ‘data on Kubernetes’ problem will be your own, but the good news is that there are viable solutions from both the open source community around Apache Cassandra, and even fully-featured SaaS products that will spin up your cluster and handle data problems for you.</p>
</div>
</div>
</div>
</div>
</div>
<footer class="grad grad--two flex-center pb-xlarge">
<div class="inner text-center z2 relative">
<h2 class="white py-small">Get started with Cassandra, fast.</h2>
<a id="footer-cta" href="/_/quickstart.html" class="btn btn--filled ma-medium">Quickstart Guide</a>
</div>
<div class="inner flex flex-distribute-items mt-xlarge z2 relative">
<div class="col-2">
<div id="footer-logo" class="logo logo--footer mb-medium"><img src="../../assets/img/logo-white-r.png" alt="Cassandra Logo"></div>
<p>Apache Cassandra<img src="../../assets/img/registered.svg" alt="®" style="width:18px;"> powers mission-critical deployments with improved performance and unparalleled levels of scale in the cloud.</p>
<div class="footer-social-icons">
<a href="https://twitter.com/cassandra?lang=en" target="_blank"><img src="../../assets/img/twitter-icon-circle-white.svg" alt="twitter icon" width="24"></a>
<a href="https://www.linkedin.com/company/apache-cassandra/" target="_blank"><img src="../../assets/img/LI-In-Bug.png" alt="linked-in icon" width="24"></a>
<a href="https://www.youtube.com/c/PlanetCassandra" target="_blank"><img src="../../assets/img/youtube-icon.png" alt="youtube icon" width="24"></a>
</div>
</div>
<div class="col-2 flex flex-center">
<ul class="columns-2">
<li class="mb-small"><a href="/">Home</a></li>
<li class="mb-small"><a href="/_/cassandra-basics.html">Cassandra Basics</a></li>
<li class="mb-small"><a href="/_/quickstart.html">Quickstart</a></li>
<li class="mb-small"><a href="/_/ecosystem.html">Ecosystem</a></li>
<li class="mb-small"><a href="/doc/latest/">Documentation</a></li>
<li class="mb-small"><a href="/_/community.html">Community</a></li>
<li class="mb-small"><a href="/_/case-studies.html">Case Studies</a></li>
<li class="mb-small"><a href="/_/resources.html">Resources</a></li>
<li class="mb-small"><a href="/_/blog.html">Blog</a></li>
</ul>
</div>
</div>
</footer>
<div class="lower-footer bg-white pa-medium">
<div class="flex flex-row flex-vert-center">
<div class="pr-medium"><img src="../../assets/img//feather-small.png" alt="ASF" width="20"></div>
<div class="pr-medium"><a href="http://www.apache.org/" target="_blank">Foundation</a></div>
<div class="pr-medium"><a href="https://www.apache.org/events/current-event.html" target="_blank">Events</a></div>
<div class="pr-medium"><a href="https://www.apache.org/licenses/" target="_blank">License</a></div>
<div class="pr-medium"><a href="https://www.apache.org/foundation/thanks" target="_blank">Thanks</a></div>
<div class="pr-medium"><a href="https://www.apache.org/security" target="_blank">Security</a></div>
<div class="pr-medium"><a href="https://privacy.apache.org/policies/privacy-policy-public.html" target="_blank">Privacy</a></div>
<div class="pr-medium"><a href="https://www.apache.org/foundation/sponsorship" target="_blank">Sponsorship</a></div>
</div>
<p class="my-medium">© 2009-<script>document.write(new Date().getFullYear())</script> <a href="https://apache.org" target="_blank">The Apache Software Foundation</a> under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation.</p>
</div>
<div id="fade" class="hidden"></div>
<div id="modal" class="hidden">
<div id="close-modal" class="cursor-pointer"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></div>
<div id="mod-content" class="vid-mod-content resp-container"></div>
</div>
<script>
jQuery(function(){
var windowW = $(window).width();
$(document)
.on('click','.mobile-nav-icon',function(){
$('.main-nav').fadeIn();
})
.on('click','.main-nav',function(){
if(windowW <= 1000){
$(this).fadeOut();
}
})
.on('click','#version-toggle',function(){
$(this).toggleClass('active');
$(this).next().fadeToggle();
})
.on('click','#mobile-docs-nav-burger', function(){
$(this).toggleClass('active');
$('.docs-nav').toggleClass('active');
});
var url = window.location.pathname;
var isQuickstart = url.includes('quickstart.html');
if(isQuickstart){
var footerCTA = document.getElementById('footer-cta');
footerCTA.innerHTML = 'Get latest updates';
footerCTA.setAttribute('href', '/_/blog.html');
}
});
</script>
</div>
</body>
<script>
jQuery(function(){
});
</script>
</html>