* fix: Solve the issue where Sentinel fails to work when starting 1 Master Replication
Signed-off-by: tcxdgit <tiancuixia92@163.com>
* fix: Fix failure to get monitorAddr in reconcileSentinel for single instance
Signed-off-by: tcxdgit <tiancuixia92@163.com>
---------
Signed-off-by: tcxdgit <tiancuixia92@163.com>
feat: Add SecurityContext to Redis init containers in tests and configurations when behind GenerateConfigInInitContainer feature flag
Signed-off-by: Jeffrey Böhm <hello@jeffrey-boehm.de>
- Introduced a new Makefile target `generate-api-docs` to automate API documentation generation using the `crd-ref-docs` tool.
- Added a new script `build.sh` for generating API documentation, including configuration for the documentation process.
- Created new documentation files for API reference, detailing the Redis API groups and resource types.
- Removed the obsolete Redis API documentation index file to streamline the documentation structure.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* Update Release History
Signed-off-by: Michel Zehnder <MichelZ@users.noreply.github.com>
* Update Release History v0.15.1
Signed-off-by: Michel Zehnder <MichelZ@users.noreply.github.com>
* Update Release History
Signed-off-by: Michel Zehnder <MichelZ@users.noreply.github.com>
* Update Release History
Signed-off-by: Michel Zehnder <MichelZ@users.noreply.github.com>
---------
Signed-off-by: Michel Zehnder <MichelZ@users.noreply.github.com>
* feat: enable periodic reconciliation for Redis Sentinel to handle pod restarts and lost endpoints
* reconcile on event
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: yangw <wuyangmuc@gmail.com>
This update allows users to enable and configure pprof for better performance monitoring of the redis-operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* refactor: introduce common constants and finalizer utilities for Redis controllers
- Added a new `constants.go` file to define common constants used across Redis controllers, including annotation keys and port numbers.
- Introduced `finalizer.go` to implement finalizer management functions for graceful deletion of Redis resources.
- Updated various Redis controller files to utilize the new common constants and finalizer functions, enhancing code consistency and maintainability.
This update improves the organization of shared constants and finalizer logic, streamlining the development of Redis controllers.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix for lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* refactor: remove dynamic client usage and streamline Kubernetes client interactions
- Eliminated the dynamic Kubernetes client from the codebase, simplifying client creation and usage across controllers and utility functions.
- Updated relevant functions and method signatures to use the standard Kubernetes client interface, enhancing code clarity and maintainability.
- Adjusted controller logic to ensure proper handling of Redis cluster and sentinel operations without the dynamic client.
This refactor improves the overall architecture and reduces complexity in client management.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Updated the redis-operator version in Chart.yaml to 0.21.1.
- Added a conditional statement in service.yaml to include webhook configuration based on user-defined values.
fix#1440
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Introduced a new `sync-crds` target in the Makefile to sync CRDs to the chart directory.
- Added `charts/redis-operator/crds/crds.yaml` to define the Redis CRD.
- Removed outdated CRD YAML files for Redis resources to streamline the codebase.
This update enhances the management of CRDs within the Redis operator, ensuring they are properly synced and organized.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: add auto max memory configuration for Redis instances
- Introduced MaxMemoryPercentOfLimit field in RedisConfig to specify the percentage of container memory limit to be used as maxmemory.
- Updated CRD definitions to include validation for MaxMemoryPercentOfLimit with minimum and maximum constraints.
- Enhanced container parameter generation to utilize MaxMemoryPercentOfLimit for Redis cluster, replication, and standalone configurations.
- Added e2e tests to verify maxmemory settings for Redis instances.
This feature improves memory management for Redis deployments, allowing for better resource utilization.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix test
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix command
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: add bus port configuration for Redis cluster services
- Introduced new methods in KubernetesConfig to determine if the bus port should be included for headless and additional services.
- Updated ServiceConfig and Service structs to include an optional IncludeBusPort field.
- Enhanced service creation logic to conditionally add the bus port based on the new configuration.
- Updated CRD definitions to reflect the new IncludeBusPort field and its description.
- Modified e2e tests to validate the inclusion of the bus port in service configurations.
This enhancement allows for better customization of Redis service configurations, particularly for Redis cluster mode.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix test
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: enhance Redis healing capabilities with role label updates
- Introduced UpdateRedisRoleLabel method in the Healer interface to update pod role labels based on their master/slave status.
- Updated RedisReplication and RedisSentinel controllers to utilize the new role label updating functionality.
- Refactored the setup of controllers to use a single instance of Healer for consistency.
This enhancement improves the management of Redis pod roles within the cluster, ensuring accurate labeling and better operational reliability.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix update not label
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: enhance Redis cluster role management with common label updates
- Added a new common package to define Redis setup types and label management functions.
- Integrated role label updates in the RedisCluster and RedisReplication controllers to ensure accurate pod role labeling during failover scenarios.
- Updated the RedisCluster service creation to include a common cluster label for better identification.
- Enhanced e2e tests to validate the new role update functionality and service configurations.
This update improves the operational reliability and observability of Redis clusters by ensuring consistent labeling across components.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
* add sleep
Signed-off-by: yangw <wuyangmuc@gmail.com>
* remove useless
Signed-off-by: yangw <wuyangmuc@gmail.com>
* refactor
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Introduced a new configuration generation system for Redis and Sentinel, encapsulated in the `bootstrap` package.
- Added `Task` struct to manage configuration generation based on the selected mode (Redis or Sentinel).
- Implemented `GenerateConfig` functions for both Redis and Sentinel, allowing for dynamic configuration based on environment variables.
- Updated command structure to use `CMD()` methods for agent and manager commands, enhancing command organization.
- Removed deprecated `generate_config.go` file to streamline the codebase.
This update enhances the flexibility and configurability of the Redis operator, allowing for better integration with Kubernetes environments.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: implement Redis health check and healing mechanisms
- Added Checker and Healer interfaces to manage Redis replication and sentinel health.
- Introduced methods for checking master status and resetting sentinels.
- Updated RedisSentinelReconciler to utilize the new health check and healing functionalities.
This enhancement improves the reliability and self-healing capabilities of the Redis operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix Lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix nil
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix name
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix client closed
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix test
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Updated Chart.yaml to version 0.17.0.
- Added livenessProbe and readinessProbe configurations to values.yaml for both leader and follower.
- Updated _helpers.tpl to include livenessProbe and readinessProbe in the rendered templates.
This update enhances the Redis cluster's health monitoring capabilities.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix: reduce uncessary requeue when skip reconcile annotation exists
- Added a new package `common` with a function `IsSkipReconcile` to check for skip-reconcile annotations on Redis, RedisCluster, RedisReplication, and RedisSentinel resources.
- Updated Redis, RedisCluster, RedisReplication, and RedisSentinel controllers to utilize the skip-reconcile logic.
- Introduced unit tests to validate the skip-reconcile behavior for each resource type.
This enhancement allows for more flexible reconciliation management in the Redis operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Added a note emphasizing that the `redisReplicationName` parameter must reference an existing RedisReplication resource.
- Included a reminder to deploy a RedisReplication resource before installing Sentinel to ensure proper functionality.
This update clarifies the prerequisites for using Redis Sentinel effectively.
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Increased the weight of the Feature Gates section from 30 to 40 to adjust its prominence in the documentation hierarchy.
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Introduced a new workflow that triggers on tag pushes matching 'v*'.
- Configured steps to check for existing releases, generate release notes, and create a new GitHub release if none exists.
- This automation streamlines the release process for the Redis operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* refactor: reorganize Redis API structure and update paths
- Updated the paths for Redis, RedisCluster, RedisReplication, and RedisSentinel APIs to reflect the new directory structure.
- Added new group version files for Redis, RedisCluster, RedisReplication, and RedisSentinel.
- Implemented conversion and webhook functionalities for the new API versions.
- Removed deprecated v1beta2 API files to streamline the codebase.
This refactor enhances the organization and maintainability of the Redis operator's API structure.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Added new KubernetesConfig and ServiceConfig types to define Redis configurations.
- Implemented methods for service type and annotations retrieval.
- Created unit tests for ShouldCreateAdditionalService logic in KubernetesConfig.
- Removed deprecated v1beta2/common_types.go file and migrated relevant code to the new structure.
This update enhances the configuration management for Redis in the operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: add Redis Sentinel validation webhook for clusterSize
- Implemented a validation webhook for Redis Sentinel to ensure the cluster size is an odd number for proper leader election.
- Added test cases for the validation webhook to verify successful and failed creation scenarios.
- Updated webhook configuration in manifests to include the new validation rules.
This enhances the reliability of Redis Sentinel configurations in the operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* refactor: reorganize command structure for Redis operator
- Moved command definitions for agent and manager into separate files for better organization.
- Introduced new bootstrap command for initializing Redis and Sentinel configurations.
- Updated main command to utilize the new command structure.
This refactor enhances the maintainability and clarity of the command handling in the Redis operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: add feature gates support for Redis Operator
- Introduced feature gates in values.yaml to enable alpha/experimental features.
- Updated operator-deployment.yaml to include FEATURE_GATES environment variable based on the configured feature gates.
- Added documentation for feature gates, including configuration and lifecycle details.
These changes enhance the configurability of the Redis Operator by allowing users to enable experimental features.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* docs
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: add data assertion generation and enhance Redis configuration commands
- Updated Makefile to include new targets for generating data assertions and metrics documentation.
- Enhanced main.go in data-assert to support a new flag for Redis sentinel password.
- Added new test cases for Redis high availability setup, including master IP consistency checks and data assertions.
These changes improve the testing capabilities and configuration management for Redis deployments.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* debug
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* remove debug
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
- Bumped operator version to 0.20.0 in Makefile and Chart.yaml.
- Simplified GitHub Actions workflow by renaming jobs and removing unnecessary comments.
- Added hostPort field to CRDs for Redis resources to support additional configuration.
- Deleted unused sidecar.go file to clean up the codebase.
These changes improve versioning clarity and streamline the CI/CD process.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
- Added IMG argument to Dockerfile for dynamic image handling.
- Updated LDFLAGS in Dockerfile to set operator image during build.
- Modified Makefile to pass IMG as a build argument in Docker commands.
- Introduced internal package for operator image retrieval.
- Removed hardcoded operator image reference from const.go.
These changes improve the flexibility and maintainability of the operator image configuration.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: add feature gates for Redis configuration generation in init container
- Introduced a new feature gate to enable generating Redis configuration using an init container.
- Updated the main.go to parse feature gates from command-line flags.
- Enhanced statefulset definition to conditionally include init containers based on feature gate status.
- Added necessary volume and volume mount definitions for configuration management.
This change improves flexibility in Redis operator deployment configurations.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* feat: guarantee to avoid bad master ip on Sentinel
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
* feat: guarantee to avoid bad master ip on Sentinel
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
* feat: guarantee to avoid bad master ip on Sentinel
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
* feat: guarantee to avoid bad master ip on Sentinel
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
* feat: guarantee to avoid bad master ip on Sentinel
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
* fix ut
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: yangw <yang.wu@daocloud.io>
Co-authored-by: yangw <wuyangmuc@gmail.com>
* Add support for setting role-anti-affinity annotation + make issuer creation optional to use cert-amanger
Signed-off-by: Andrea Dolfi <andrea.dolfi.e@thalesdigital.io>
* Update Readme files.
Signed-off-by: Andrea Dolfi <andrea.dolfi.e@thalesdigital.io>
* Fix charts readme.
Signed-off-by: Andrea Dolfi <andrea.dolfi.e@thalesdigital.io>
---------
Signed-off-by: Andrea Dolfi <andrea.dolfi.e@thalesdigital.io>
Co-authored-by: Andrea Dolfi <andrea.dolfi.e@thalesdigital.io>
* feat: update Dockerfile and Makefile for unified operator binary
- Removed the BUILD_TARGET argument from Dockerfile to simplify the build process.
- Updated Dockerfile to build a single binary named 'operator' instead of separate manager and agent binaries.
- Modified Makefile to remove references to BUILD_TARGET, streamlining Docker image build commands.
- Adjusted entry point in deployment YAML to use the new operator binary.
This change enhances the build process and aligns with the new command structure in the main.go file.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix e2e
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix version
Signed-off-by: yangw <wuyangmuc@gmail.com>
* change version
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix: update references from master to main in configuration and workflow files
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
* fix: update Trivy action references from main to master in workflow file
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
* fix: update Gosec action reference from main to master in CI workflow
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
---------
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
* refactor: update Dockerfile and Makefile for agent support
- Modified Dockerfile to support building both manager and agent binaries using a build argument.
- Updated Makefile to include targets for building, pushing, and loading agent Docker images.
- Removed the agent-specific Dockerfile as its functionality is now integrated into the main Dockerfile.
This change enhances the flexibility of the build process by allowing the selection of the build target.
Signed-off-by: yangw <wuyangmuc@gmail.com>
* keep target clean
Signed-off-by: yangw <wuyangmuc@gmail.com>
* fix syntax
Signed-off-by: yangw <wuyangmuc@gmail.com>
* Update Makefile
Co-authored-by: Shubham Gupta <69793468+shubham-cmyk@users.noreply.github.com>
---------
Signed-off-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: Shubham Gupta <69793468+shubham-cmyk@users.noreply.github.com>
- Implemented `generatePreStopCommand` to add a `preStop` hook for Redis Cluster mode.
- Added `generateAuthAndTLSArgs` to construct authentication and TLS parameters.
- Developed `generateClusterPreStop` to execute controlled failover before pod termination.
- Ensured that only `cluster` mode applies the `preStop` logic to avoid unnecessary rolling updates.
- Added unit tests for `generateAuthAndTLSArgs` and `generatePreStopCommand` to validate their correctness.
Ref: #1262
Signed-off-by: fengyinqiao <fengyinqiao@shizhuang-inc.com>
Co-authored-by: fengyinqiao <fengyinqiao@shizhuang-inc.com>
- Updated RedisClusterStatusHealth function to use cr.Spec.Port instead of hardcoded 6379 port.
Co-authored-by: fengyinqiao <fengyinqiao@shizhuang-inc.com>
* refactor: remove v1beta1 API version and migrate to v1beta2
This commit removes the v1beta1 API version across the entire project, including:
- Deleting v1beta1 API type definitions
- Removing v1beta1 CRD configurations
- Updating example manifests to use v1beta2
- Cleaning up test suite configurations
- Updating documentation references
The migration focuses on consolidating the project to use only the v1beta2 API version, simplifying the codebase and reducing maintenance overhead.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Add a GitHub Actions workflow to enable automatic rebasing of pull requests via comment commands `/rebase` and `/autosquash`
The workflow allows repository collaborators to trigger a rebase of a pull request by commenting `/rebase` or perform an autosquash rebase with `/autosquash`.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: add dynamic Redis configuration support for Redis Cluster
- Added `DynamicConfig` field to `RedisConfig` struct in common types
- Implemented `GetRedisDynamicConfig()` method in RedisCluster spec
- Created `SetRedisClusterDynamicConfig()` utility function to apply dynamic configuration
- Updated reconciliation process to set dynamic configuration when cluster is ready
- Added e2e test to verify dynamic configuration application
This feature allows users to dynamically configure Redis instances at runtime with top-level configuration parameters.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: enhance Redis HA and node scheduling strategy
- Updated e2e test to simulate node shutdown instead of pod deletion
- Added pod anti-affinity configuration for Redis replication and sentinel nodes
- Removed unnecessary StatefulSet readiness check in Redis replication controller
- Improved node scheduling to distribute Redis pods across different worker nodes
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
fix: improve pod label patching with error handling and retry mechanism
- Added JSON pointer escaping for label keys
- Implemented retry mechanism for label patching
- Enhanced error handling and logging
- Added validation for empty labels
- Created utility function for JSON pointer escaping in util package
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
- Introduced `Additional` service configuration in `ServiceConfig` struct
- Added `Enabled` field to `Service` struct with default value of true
- Implemented `ShouldCreateAdditionalService()` method to control additional service creation
- Updated CRD bases to include additional service configuration
- Modified service creation logic in Redis cluster and standalone services to respect additional service configuration
- Added unit test for `ShouldCreateAdditionalService()` method
This enhancement provides more flexibility in configuring additional services for Redis deployments.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: add headless service configuration support
- Introduced a new `Headless` service configuration in `ServiceConfig` struct
- Added method `GetHeadlessServiceAnnotations()` to retrieve headless service annotations
- Updated CRD bases to include headless service configuration
- Modified service creation logic in Redis cluster and standalone services to support headless service annotations
- Added e2e test cases for standalone Redis with headless service configuration
This enhancement provides more flexibility in configuring headless services for Redis deployments.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* test: enhance Redis cluster testing with data assertion scripts
- Added new steps in the e2e test for Redis cluster to apply a data assertion tool, `data-assert`, for generating and validating data in the Redis cluster.
- Replaced the previous Redis GET/SET checks with a more comprehensive data generation and validation process using the `data-assert` tool.
- Introduced additional assertions to ensure data consistency after scaling operations.
This update improves the reliability of e2e tests by ensuring data integrity in Redis clusters.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* path
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* password
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* password
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* password
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* ha
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* update
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Updated the version in Chart.yaml to reflect the new release of the redis-operator chart. This change ensures that users are aware of the latest updates and improvements in the chart.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: check data consistent by external tool
- Added a new command-line tool `data-assert` for managing Redis data, including commands to generate data, check data consistency, and create resource YAML files.
- Introduced `go.mod` and `go.sum` for dependency management, incorporating Redis and Cobra libraries.
- Created a template for generating Kubernetes resources, including a ConfigMap and Pod specifications.
- Updated e2e tests to utilize the new data-assert functionality for data generation and validation.
This enhancement improves the management and verification of data in Redis clusters.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* generate
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* ignore
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* docs
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: add data-assert tool for Redis data management
- Introduced a new command-line tool `data-assert` to manage data in Redis.
- Implemented commands to generate data, check data consistency, and generate resource YAML files.
- Added `go.mod` and `go.sum` for dependency management, including Redis and Cobra libraries.
- Created a template for generating Kubernetes resources, including a ConfigMap and Pod specifications.
- Updated documentation to include information about the new data-assert functionality.
This addition enhances the ability to manage and verify data in Redis clusters effectively.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
- Updated version and appVersion for redis, redis-cluster, redis-replication, and redis-sentinel charts to 0.16.5, 0.16.7, and 0.16.9 respectively.
- Introduced `serviceMonitor.extraLabels` in values.yaml and README.md for all Redis charts, allowing users to add custom labels to the ServiceMonitor when enabled.
- Updated templates to utilize the new `extraLabels` configuration for ServiceMonitor.
This change enhances the flexibility of monitoring configurations for Redis deployments.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: enhance RedisCluster resource management by introducing separate resource handling for leader and follower
- Added methods to retrieve resources for Redis leader and follower, allowing for more granular resource management.
- Updated RedisClusterSpec to deprecate the unified resources field in favor of individual configurations for leader and follower.
- Adjusted related tests and YAML configurations to reflect these changes, ensuring consistency and correctness in resource allocation.
This update improves the flexibility and efficiency of resource management in RedisCluster deployments.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix verify-codegen
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix codegen
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat: use client.Client instead of K8sClient in finalizer
- Eliminated the K8sClient field from the Reconciler struct in Redis-related controller files, including redis_controller.go, redis_controller_suite_test.go, and redisreplication_controller.go, as it was not utilized.
- Updated finalizer handling functions to remove K8sClient parameters, simplifying the function signatures and improving code clarity.
- Adjusted related test cases to reflect these changes, ensuring consistency across the codebase.
This refactor enhances maintainability by streamlining the code and removing unnecessary dependencies.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* remove which can ensure by chainsaw test `setup`
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* refactor: remove unused Scheme references in Redis controller files
- Removed the Scheme field from the Reconciler struct in rediscluster_controller.go, main.go, and rediscluster_controller_suite_test.go as it was not being utilized.
- This cleanup enhances code clarity and maintainability by eliminating unnecessary components.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* feat(cluster): add event recording functionality for RedisCluster controller
- Introduced a new events package to manage event recording, including a Recorder struct and methods for adding and retrieving events.
- Updated the RedisCluster controller to utilize the event recorder, allowing it to log downscale events.
- Enhanced the main function to initialize the event recorder for the RedisCluster controller.
This update improves observability capabilities for RedisCluster operations.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* update
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* test: enhance Redis controllers' test cases with testdata and validation checks
- Updated Redis, RedisCluster, RedisReplication, and RedisSentinel controller tests to utilize YAML testdata files for improved clarity and maintainability.
- Added validation checks for resource creation, owner references, and specifications in the respective test cases.
- Introduced new testdata files for Redis and RedisCluster to streamline test setup and ensure consistent testing across different configurations.
- Enhanced error handling and logging for better debugging during test execution.
This update improves the robustness and reliability of the Redis operator's testing framework.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: yangw <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: yangw <wuyangmuc@gmail.com>
feat: enhance RedisSentinel reconciliation logic and update workflow.
- Added new reconciler functions for handling finalizers, annotations, replication, and sentinel management in the RedisSentinel controller.
- Improved error handling and logging for better debugging during reconciliation.
- Updated GitHub Actions workflow to include new job types: standalone, replication, sentinel, and cluster.
This update enhances the functionality and maintainability of the RedisSentinel operator.
Signed-off-by: yangw <wuyangmuc@gmail.com>
<!--
Please read
https://github.com/OT-CONTAINER-KIT/redis-operator/blob/master/CONTRIBUTING.md
before submitting
your pull request. Please fill in each section below to help us better
prioritize your pull request. Thanks!
-->
**Description**
<!-- Please provide a summary of the change here. -->
Support PDB in redisreplication
**Type of change**
<!-- Please delete options that are not relevant. -->
* Bug fix (non-breaking change which fixes an issue)
* New feature (non-breaking change which adds functionality)
* Breaking change (fix or feature that would cause existing
functionality to not work as expected)
**Checklist**
- [ ] Tests have been added/modified and all tests pass.
- [ ] Functionality/bugs have been confirmed to be unchanged or fixed.
- [x] I have performed a self-review of my own code.
- [ ] Documentation has been updated or added where necessary.
**Additional Context**
<!--
Is there anything else you'd like reviewers to know?
For example, any other related issues or testing carried out.
-->
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from
2.20.1 to 2.22.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/onsi/ginkgo/releases">github.com/onsi/ginkgo/v2's
releases</a>.</em></p>
<blockquote>
<h2>v2.22.0</h2>
<h2>2.22.0</h2>
<h3>Features</h3>
<ul>
<li>Add label to serial nodes [0fcaa08]</li>
</ul>
<p>This allows serial tests to be filtered using the
<code>label-filter</code></p>
<h3>Maintenance</h3>
<p>Various doc fixes</p>
<h2>v2.21.0</h2>
<h2>2.21.0</h2>
<h3>Features</h3>
<ul>
<li>add support for GINKGO_TIME_FORMAT [a69eb39]</li>
<li>add GINKGO_NO_COLOR to disable colors via environment variables
[bcab9c8]</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>increase threshold in timeline matcher [e548367]</li>
<li>Fix the document by replacing <code>SpecsThatWillBeRun</code> with
<code>SpecsThatWillRun</code>
[c2c4d3c]</li>
</ul>
<h3>Maintenance</h3>
<ul>
<li>bump various dependencies [7e65a00]</li>
</ul>
<h2>v2.20.2</h2>
<h2>2.20.2</h2>
<p>Require Go 1.22+</p>
<h3>Maintenance</h3>
<ul>
<li>bump go to v1.22 [a671816]</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md">github.com/onsi/ginkgo/v2's
changelog</a>.</em></p>
<blockquote>
<h2>2.22.0</h2>
<h3>Features</h3>
<ul>
<li>Add label to serial nodes [0fcaa08]</li>
</ul>
<p>This allows serial tests to be filtered using the
<code>label-filter</code></p>
<h3>Maintenance</h3>
<p>Various doc fixes</p>
<h2>2.21.0</h2>
<h3>Features</h3>
<ul>
<li>add support for GINKGO_TIME_FORMAT [a69eb39]</li>
<li>add GINKGO_NO_COLOR to disable colors via environment variables
[bcab9c8]</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>increase threshold in timeline matcher [e548367]</li>
<li>Fix the document by replacing <code>SpecsThatWillBeRun</code> with
<code>SpecsThatWillRun</code>
[c2c4d3c]</li>
</ul>
<h3>Maintenance</h3>
<ul>
<li>bump various dependencies [7e65a00]</li>
</ul>
<h2>2.20.2</h2>
<p>Require Go 1.22+</p>
<h3>Maintenance</h3>
<ul>
<li>bump go to v1.22 [a671816]</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9e2f337b10"><code>9e2f337</code></a>
v2.22.0</li>
<li><a
href="0fcaa0841d"><code>0fcaa08</code></a>
Add label to serial nodes</li>
<li><a
href="38febf2d66"><code>38febf2</code></a>
docs: remove extra erroneous backtick</li>
<li><a
href="7e753c4a3c"><code>7e753c4</code></a>
fix: minor doc fixes</li>
<li><a
href="21765a2752"><code>21765a2</code></a>
fix: missing commas</li>
<li><a
href="b101e0c573"><code>b101e0c</code></a>
Fix some typos in docs</li>
<li><a
href="75120215ca"><code>7512021</code></a>
fix: remove trailing comma</li>
<li><a
href="9d33507ba0"><code>9d33507</code></a>
fix: grammar</li>
<li><a
href="55f3de13e5"><code>55f3de1</code></a>
fix: typos</li>
<li><a
href="3d6e16d18f"><code>3d6e16d</code></a>
fix: missing comma</li>
<li>Additional commits viewable in <a
href="https://github.com/onsi/ginkgo/compare/v2.20.1...v2.22.0">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
* feat: enhance RedisReplication controller and CRD with additional status columns and refactor reconciliation logic
- Added new printer columns "Master" and "Age" to the RedisReplication CRD for better visibility of the master node and resource age.
- Refactored the reconciliation logic in the RedisReplication controller to improve clarity and maintainability by introducing a reconciler struct for handling different reconciliation tasks.
- Updated the e2e tests to validate the HA setup of Redis Replication and Sentinel, ensuring consistency in master IP across different sources.
- Removed obsolete test files and replaced them with a new HA setup configuration.
This update improves the usability and reliability of the Redis replication feature.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* fix lint
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* lint
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* upgrade go
* add
* disable
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* update
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* disable
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* update
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* update
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
- Added new printer columns "Master" and "Age" to the RedisReplication CRD for better visibility of the master node and resource age.
- Refactored the reconciliation logic in the RedisReplication controller to improve clarity and maintainability by introducing a reconciler struct for handling different reconciliation tasks.
- Updated the e2e tests to validate the HA setup of Redis Replication and Sentinel, ensuring consistency in master IP across different sources.
- Removed obsolete test files and replaced them with a new HA setup configuration.
This update improves the usability and reliability of the Redis replication feature.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
- Bumped version and appVersion for redis, redis-cluster, redis-replication, and redis-sentinel charts to 0.16.4, 0.16.4, 0.16.6, and 0.16.8 respectively.
- Enhanced initContainer properties in templates to include the 'enabled' field for better configuration management.
This update ensures consistency across the Redis charts and improves template rendering.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
fix: update initContainer and sidecar property references
- Updated version and appVersion for redis, redis-cluster, redis-replication, and redis-sentinel charts.
- Modified initContainer and sidecar property references in templates to include the current context.
This update ensures consistency across the Redis charts and improves template rendering.
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
fix bad indentation on redis standalone additional configs
It was incorrectly being nested under the redis exporter config key.
Signed-off-by: Daniel Schaaff <daniel@danielschaaff.com>
* fix: should get the really leader count when scale in
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* fix timeout
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* fix test
Signed-off-by: drivebyer <yang.wu@daocloud.io>
---------
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* Delete unnecessary brackets wrapping the IPv6 address
Signed-off-by: Jami Karvanen <jami@karvanen.fi>
* Extract redis address formatting into separate getRedisServerAddress function
Signed-off-by: Jami Karvanen <jami@karvanen.fi>
* Add tests for getRedisServerAddress
Signed-off-by: Jami Karvanen <jami@karvanen.fi>
* Use getRedisServerAddress also in cluster-scaling.go
Signed-off-by: Jami Karvanen <jami@karvanen.fi>
---------
Signed-off-by: Jami Karvanen <jami@karvanen.fi>
* add cr filed, default port to 6379
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* replace with custom port
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* service custom port
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* make default to 6379 when reconcile old cluster
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* add e2e
Signed-off-by: drivebyer <yang.wu@daocloud.io>
---------
Signed-off-by: drivebyer <yang.wu@daocloud.io>
* ut for redis replication
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* ut for redis sentinel
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* ut for redis cluster
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
* remove useless field
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
---------
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
# NOTE: This is a workaround for the issue where the default storage class does not support volume expansion.
# Since we don't require PVC resizing (unlike physical disks), we can simply ensure that the requested PVC size is met.
- name:Setup k8s Kind Cluster
run:|
DEFAULT_SC=$(kubectl get storageclass -o=jsonpath='{.items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")].metadata.name}')
# Configuration for stale action workflow - https://github.com/actions/stale
name:Manage stale issues and PRs
on:
schedule:
# Run hourly
- cron:'30 1 * * *'
workflow_dispatch:
permissions:
issues:write
pull-requests:write
jobs:
stale:
runs-on:ubuntu-latest
permissions:
issues:write
pull-requests:write
steps:
- uses:actions/stale@v9
with:
repo-token:${{ secrets.GITHUB_TOKEN }}
ascending:true
# --- Issues & PRs ---
# Number of days of inactivity before an issue or PR becomes stale
days-before-stale:365
# Number of days of inactivity before a stale issue or PR is closed
days-before-close:30
# API calls per run
operations-per-run:1000
# --- Issues ---
stale-issue-label:"stale"
# Comment to post when marking an issue as stale
stale-issue-message:>
This issue has been automatically marked as stale.
**Ifthis issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open.
We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
# Comment to post when closing a stale issue
close-issue-message:>
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!
# Issues with these labels will never be considered stale
exempt-issue-labels:"enhancement,good first issue,help wanted"
# --- PRs ---
stale-pr-label:"stale"
# Comment to post when marking a pull request as stale
stale-pr-message:>
This pull request has been automatically marked as stale.
**Ifthis pull request is still relevant, please leave any comment** (for example, "bump"), and we'll keep it open.
We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
# Comment to post when closing a stale pull request
close-pr-message:>
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!
# PRs with these labels will never be considered stale
github_token:$GITHUB_TOKEN# A token generated on GitHub allowing Travis to push code on your repository. Set in the Travis settings page of your repository, as a secure variable
- Update Dockerfile and Makefile for unified operator binary #1294
- Add support for anti affinity configuration in helm charts #1296
- Guarantee to avoid bad master ip on Sentinel #1289
- Add feature gates for sentinel configuration generation in init container #1300
- Support redis configuration generation in init container #1303
#### :beetle: Bug Fixes
- Replace hardcoded Redis port 6379 with configurable port from cr.Spec.Port #1261
- Update references from master to main in docs and workflow files #1288
- Svc finalizer removed #1297
- Race condition resulting in permanently broken Redis cluster #1298
### v0.19.1
##### February 19, 2024
#### :warning: Deprecation Notice
The v1beta1 API version will be removed in next release. Users are strongly encouraged to migrate to v1beta2, which offers enhanced features and improved stability.
#### :tada: Features
- Add data-assert tool for Redis data management #1204
- Check data consistent by external tool #1205
- Added actions to publish charts to github container registry #1201
- Add headless service configuration support #1219
For development and testing of operator on local system, we need to set up a [Minikube](https://minikube.sigs.k8s.io/docs/start/) or local Kubernetes cluster.
For development and testing of operator on local system, we need to set up a [Minikube](https://minikube.sigs.k8s.io/docs/start/) 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:
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](https://github.com/OT-CONTAINER-KIT/redis/blob/master/Dockerfile) and [Redis Exporter](https://github.com/OT-CONTAINER-KIT/redis/blob/master/Dockerfile.exporter)
In the repository, we have `Dockerfile` for [Redis](https://github.com/OT-CONTAINER-KIT/redis/blob/main/Dockerfile) and [Redis Exporter](https://github.com/OT-CONTAINER-KIT/redis/blob/main/Dockerfile.exporter)
For building the docker image for redis and redis exporter, there are simple make commands:
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq(,$(shellgoenvGOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
# ===========================
# Targets
# ===========================
# Default target
all:manager
# Run tests
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
.PHONY:test
test:generatefmtvetmanifests
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.0/hack/setup-envtest.sh
source${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
# Build manager binary
.PHONY:manager
manager:generatefmtvet
go build -o bin/manager main.go
go build -ldflags $(LDFLAGS) -o bin/manager cmd/main.go
# Build agent binary
.PHONY:agent
agent:generatefmtvet
go build -o bin/agent cmd/agent/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config
A Golang based redis operator that will make/oversee Redis standalone and cluster mode setup on top of the Kubernetes. It can create a redis cluster setup with best practices on Cloud as well as the Bare metal environment. Also, it provides an in-built monitoring capability using redis-exporter.
A Golang-based Redis operator that will make/oversee Redis standalone and cluster mode setup on top of Kubernetes. It can create a Redis cluster setup with best practices on Cloud as well as the bare metal environment. Also, it provides an in-built monitoring capability using redis-exporter.
For documentation, please refer to https://ot-redis-operator.netlify.app/
For documentation, please refer to <https://redis-operator.opstree.dev/>
Organizations that are using Redis Operator to manage their redis workload can be found [here](./USED_BY_ORGANIZATIONS.md). If your organization is also using Redis Operator, please free to add by creating a [pull request](https://github.com/OT-CONTAINER-KIT/redis-operator/pulls)
Organizations that are using Redis Operator to manage their Redis workload can be found [here](./USED_BY_ORGANIZATIONS.md). If your organization is also using Redis Operator, please feel free to add by creating a [pull request](https://github.com/OT-CONTAINER-KIT/redis-operator/pulls)
This operator only supports versions of redis `=>6`.
This operator only supports versions of Redis `>=6`.
## Architecture
@ -39,95 +39,94 @@ This operator only supports versions of redis `=>6`.
## Purpose
There are multiple problems that people face while setting up redis setup on Kubernetes, specially cluster type setup. The purpose of creating this opperator is to provide an easy and production ready interface for redis setup that include best-practices, security controls, monitoring, and management.
There are multiple problems that people face while setting up Redis setup on Kubernetes, especially cluster type setup. The purpose of creating this operator is to provide an easy and production-ready interface for Redis setup that includes best-practices, security controls, monitoring, and management.
## Supported Features
Here the features which are supported by this operator:-
Here are the features which are supported by this operator:
- Redis cluster and standalone mode setup
- Redis cluster failover and recovery
- Inbuilt monitoring with redis exporter
- Password and password-less setup of redis
- Password and password-less setup of Redis
- TLS support for additional security layer
- Ipv4 and Ipv6 support for redis setup
- Detailed monitoring grafana dashboard
## Getting Started
If you want to deploy redis-operator from scratch to a local Minikube cluster, begin with the [Getting started](https://ot-container-kit.github.io/redis-operator/#/quickstart/quickstart) document. It will guide your through the setup step-by-step.
The configuration of Redis setup should be described in [CRD definitions](config/crd/bases). All the examples related to redis standalone and cluster setup can be found inside [example](./example) folder.
- IPv4 and IPv6 support for Redis setup
- Detailed monitoring Grafana dashboard
## Prerequisites
Redis operator requires a Kubernetes cluster of version `>=1.18.0`. If you have just started with Operators, it's highly recommended using the latest version of Kubernetes.
Redis Operator requires a Kubernetes cluster of version `>=1.18.0`. If you have just started with Operators, it's highly recommended using the latest version of Kubernetes.
## Image Compatibility
The following table shows the compatibility between the Operator Version, Redis Image, Sentinel Image, and Exporter Image:
If you want to customize the value file by yourself while initializing the helm command, the values files for reference are present [here](https://github.com/OT-CONTAINER-KIT/helm-charts/tree/main/charts/redis-setup).
If you want to customize the values file by yourself while initializing the Helm command, the values files for reference are present [here](https://github.com/OT-CONTAINER-KIT/helm-charts/tree/main/charts/redis-setup).
## Monitoring with Prometheus
To monitor redis performance we will be using prometheus. In any case, extra prometheus configuration will not be required because we will be using the Prometheus service discover pattern. For that we already have set these annotations:-
To monitor Redis performance we will be using Prometheus. In any case, extra Prometheus configuration will not be required because we will be using the Prometheus service discovery pattern. For that we already have set these annotations:
```yaml
annotations:
@ -148,4 +147,4 @@ Please see our [CHANGELOG.md](./CHANGELOG.md) for details.
This project is managed by [OpsTree Solutions](http://opstree.com). For any queries or suggestions, you can reach out to us at [opensource@opstree.com](mailto:opensource@opstree.com).
# Phase 1: Feature Expansion and Advanced Configuration (0-6 months)
- Advance Backup and Restore
- Automated Backup Policies: Users can define more complex backup strategies (e.g., time-based, event-triggered, incremental backups).
- Backup on Redis Persistence Options: Integrate support for Redis persistence modes like RDB snapshots and AOF (Append-Only File).
- Redis Stream and Pub/Sub Support
- Add support for Redis Streams and Pub/Sub messaging patterns, allowing users to manage Redis Stream-based applications directly through the operator.
- Valkey Support
- Adding support for Valkey standalone.
- Adding support for Valkey replication.
- Adding support for Valkey cluster mode.
- Adding TLS-based authentication.
- Adding password-based authentication support.
- Encryption support.
- Persistence support.
- Monitoring feature.
- Different Kubernetes native support like PDB, sidecar, tolerations, upgrade strategy.
Redis is a key-value based distributed database, this helm chart is for redis cluster setup. This helm chart needs [Redis Operator](../redis-operator) inside Kubernetes cluster. The redis cluster definition can be modified or changed by [values.yaml](./values.yaml).
| redisCluster.enableMasterSlaveAntiAffinity | bool | `false` | Enable pod anti-affinity between leader and follower pods by adding the appropriate label. Notice that this requires the operator to have its mutating webhook enabled, otherwise it will only add an annotation to the RedisCluster CR. Default is false. |
| redisCluster.recreateStatefulSetOnUpdateInvalid | bool | `false` | Some fields of statefulset are immutable, such as volumeClaimTemplates. When set to true, the operator will delete the statefulset and recreate it. Default is false. |
Redis is a key-value based distributed database, this helm chart is for redis cluster setup. This helm chart needs [Redis Operator](../redis-operator) inside Kubernetes cluster. The redis cluster definition can be modified or changed by [values.yaml](./values.yaml).
This Helm chart deploys the redis-operator into your Kubernetes cluster. The operator facilitates the deployment, scaling, and management of Redis clusters and other Redis resources provided by the OpsTree Solutions team.
> Note: If `certificate.secretName` is not provided, the operator will generate a self-signed certificate and use it for webhook server.
---
> Note : If you want to disable the webhook you have to pass the `--set webhook=false` and `--set certmanager.enabled=false` while installing the redis-operator.
---
> Note: If you want to use an existing `ClusterIssuer` to sign the webhook certificate, you can pass `--set issuer.create=false`, `--set issuer.kind=ClusterIssuer` and `--set issuer.name=cluster-issuer-name-here` while installing the operator.
### 4. Patch the CA Bundle (if using cert-manager)
Cert-manager injects the CA bundle into the webhook configuration.
This Helm chart deploys the redis-operator into your Kubernetes cluster. The operator facilitates the deployment, scaling, and management of Redis clusters and other Redis resources provided by the OpsTree Solutions team.
> Note: If `certificate.secretName` is not provided, the operator will generate a self-signed certificate and use it for webhook server.
---
> Note : If you want to disable the webhook you have to pass the `--set webhook=false` and `--set certmanager.enabled=false` while installing the redis-operator.
---
> Note: If you want to use an existing `ClusterIssuer` to sign the webhook certificate, you can pass `--set issuer.create=false`, `--set issuer.kind=ClusterIssuer` and `--set issuer.name=cluster-issuer-name-here` while installing the operator.
### 4. Patch the CA Bundle (if using cert-manager)
Cert-manager injects the CA bundle into the webhook configuration.