[Infrastructure as Code (IaC) Pulumi] Use Pulumi kubernetes (K8S) Helm Chart to deploy Bitnami Redis Cluster
Bitnami Redis Cluster
Bitnami makes it easy to get your favorite open source software up and running on any platform, including your laptop, Kubernetes and all the major clouds. In addition to popular community offerings, Bitnami, now part of VMware, provides IT organizations with an enterprise offering that is secure, compliant, continuously maintained and customizable to your organizational policies.
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
This article is about how to use Pulumi, kubernetes (K8S) provider, Helm Chart and TypeScript SDK to deploy Bitnami Redis within Kubernetes (K8S).
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
See Getting started | Kubernetes - https://kubernetes.io/docs/setup/ to leanr more.
Pulumi - Modern Infrastructure as Code - https://www.pulumi.com/
Pulumi is a modern infrastructure-as-code platform that allows you to use common programming languages, tools, and frameworks, to provision, update, and manage cloud infrastructure resources.
Install the Pulumi - https://www.pulumi.com/ CLI.
Mac OS X
brew install pulumi
See Download and Install | Pulumi - https://www.pulumi.com/docs/get-started/install/ to learn more about others OS.
Node.js - https://nodejs.org/en/
Install Node.js - https://nodejs.org/en/ CLI.
Mac OS X
brew install node
See Node.js - https://nodejs.org/en/ to learn more about others OS.
Create the workspace directory.
mkdir -p col-example-pulumi-typescript-bitnami-redis-cluster
Pulumi login into local file system.
pulumi login file://.
Pulumi new a project with kubernetes-typescript SDK.
pulumi new kubernetes-typescript
The above command will create some files within the current directory.
tree . -L 1
js-yaml package to load and parse yaml file.
npm i js-yaml
By default, Pulumi will look for a kubeconfig file in the following locations, just like kubectl:
The environment variable:
Or in current user’s default kubeconfig directory:
If the kubeconfig file is not in either of these locations, Pulumi will not find it, and it will fail to authenticate against the cluster. Set one of these locations to a valid kubeconfig file, if you have not done so already.
Edit values.yaml and replace content within
See and modify main.ts file.
Run pulumi up to create the namespace and pods.
See pods about bitnami-redis-cluster.
kubectl get pods -n bitnami-redis-cluster
Destroy all resources created by Pulumi.
I have no [email protected]:/$ redis-cli -h redis-cluster
Connect Redis with Cluster mode
 charts/bitnami/redis at master · bitnami/charts - https://github.com/bitnami/charts/tree/master/bitnami/redis
 charts/values.yaml at master · bitnami/charts - https://github.com/bitnami/charts/blob/master/bitnami/redis/values.yaml
 Bitnami: Packaged Applications for Any Platform - Cloud, Container, Virtual Machine - https://bitnami.com/
 Kubernetes Getting Started | Pulumi - https://www.pulumi.com/docs/get-started/kubernetes/
 Pulumi - Modern Infrastructure as Code - https://www.pulumi.com/
 Kubernetes - https://kubernetes.io/