Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Running Redis Enterprise Kubernetes Service

DZone's Guide to

Running Redis Enterprise Kubernetes Service

The benefits of containerization are well-known, so let's see how you can run Redis Enterprise on Kubernetes with this handy service.

· Database Zone ·
Free Resource

Running out of memory? Learn how Redis Enterprise enables large dataset analysis with the highest throughput and lowest latency while reducing costs over 75%! 

Containerization enables development teams to move fast, deploy software efficiently, and operate at scale. Kubernetes provides automated container orchestration and the management of containers in a highly available, distributed environment. The platform handles scaling, configuration and deployment of new versions of images and simplifies application deployment and management. At Redis Labs, we are actively developing a Kubernetes-based deployment built on Redis Enterprise 5.x.

What to Expect From This Article

In previous blog posts, I talked about Kubernetes primitives and local Kubernetes development. In this post, I'll walk you through the simple 4-step process of deploying cloud-native Redis Enterprise on Kubernetes:

  1. Deploy a Redis Enterprise service with StatefulSet and a headless service to handle the DNS resolution of pods in the deployment.
  2. Leverage Kubernetes secrets primitives to store Redis Enterprise license information.
  3. Bootstrap a three-pod Redis Enterprise cluster using Kubernetes secrets and expose the Redis Enterprise UI on a public IP.
  4. Deploy the infrastructure and create a Redis database. The deployment will automatically publish the database endpoint in the Kubernetes service catalog.

Detailed Walkthrough

For this demo, we will use a managed Kubernetes cluster running on Google Cloud.

Once a cluster is created, store the license information using Kubernetes secrets primitives. In this example, we will set up a Kubernetes secret object called rp-secret. The command to create the secret object is shown below:

kubectl create secret generic rp-secret \

 --from-file=license=<MY_REDIS_ENTERPRISE_LICENSE.txt \

 --from-literal=username=<MY_USERNAME> \

 --from-literal=password=<MY_PASSWORD>


The command should output the following:

Next, deploy the headless service, controller and Redis statefulset manifests using YAML files* as shown in the following screenshots:

*We will publish the YAML files when Redis Enterprise for Kubernetes is made generally available.

A Redis Enterprise three-node cluster with all running Kubernetes resources will look like this:

Upon successfully deploying Redis Enterprise on the Kubernetes cluster, create a database using the web interface.

Once the database is created using the web interface, the Redis Enterprise service controller will publish the endpoint of the database in the Kubernetes service catalog, as shown in the screenshot below for the database db-k8demo:

Using the published endpoint of the database in the Kubernetes service catalog, we perform a load test on our Redis database using a benchmarking tool called memtier_benchmark . The memtier tool is a command-line utility useful for generating and benchmarking NoSQL key-value databases. The load generated by the benchmark tool can be seen in the metrics section of the web interface of Redis Enterprise. The screenshot below shows the load generated by the memtier_benchmark tool on db-k8demo database.

Summing Up

As organizations begin to use containers at large scale, orchestration frameworks become necessary to manage the increased complexity. While Kubernetes was initially developed to run stateless services, it's also made running a stateful service such as the Redis Enterprise database much easier. With the rapid migration to cloud-native architectures and microservices, the combination of Kubernetes and a super performant and highly available Redis Enterprise database will help organization innovate faster in the new era of application development and delivery. We'd love to hear more about how you would like to see Redis Enterprise in Kubernetes-please feel free to contact me directly for feedback.

For more information about Redis Enterprise, please visit our technical documentation and or release notes page.

Running out of memory? Never run out of memory with Redis Enterprise databaseStart your free trial today.

Topics:
redis ,kubernetes cluster ,cloud native ,containerization ,database ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}