Contribute
Prerequisites
Local Kubernetes Cluster
For development and testing of operator on local system, we need to set up a Minikube or local Kubernetes cluster.
Minikube is a single node Kubernetes cluster that generally gets used for the development and testing on Kubernetes. For creating a Minkube cluster we need to simply run:
Cloud Kubernetes Cluster
For cloud based Kubernetes cluster we can use any type of platforms like Amazon Web Service, Azure Cloud, or Google Cloud Platform. We have provided an eks-cluster.yaml file for creating an Elastic Kubernetes Service(EKS) using eksctl.
eksctl
is a cli tool to create a Kubernetes cluster on EKS by a single command. It supports creation of Ipv4 and Ipv6 based Kubernetes clusters for development.
For setting up the Ipv4 or Ipv6 cluster with eksctl, we need to modify this configuration in the eks-cluster.yaml:
Operator structure
The structure for Redis operator includes different module’s directory. The codebase include these major directories:
As part of the development, generally, we modify the codebase in API, controllers, and k8sutils. The API modules hold the interface and structure for CRD definition, the controllers are the watch controllers that create, update, and delete the resources. The k8sutils is a module in which all the Kubernetes resources(Statefulsets, Services, etc.) codebase is present.
Building Operator
For building operator, we can execute make command to create binary and docker image:
For any change inside the api
module, we need to recreate the CRD schema because of interface changes. To generate the CRD manifest and RBAC policies updated by operator:
Deploying Operator
The operator deployment can be done via helm
cli, we just need to define the custom image name and tag for testing the operator functionality:
Docker Image Development
Development of redis docker image is maintained inside a different repository - https://github.com/OT-CONTAINER-KIT/redis. To make any change or suggestion related to Redis docker image, please refer to this repository and make required changes.
In the repository, we have Dockerfile
for Redis and Redis Exporter
For building the docker image for redis and redis exporter, there are simple make commands: