-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Add custom redis.conf support to RedisCluster CRD #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@copilot hi |
|
@copilot 안녕? 너의 사용법에 대해서 알려줘 |
Co-authored-by: jaehanbyun <80397512+jaehanbyun@users.noreply.github.com>
Co-authored-by: jaehanbyun <80397512+jaehanbyun@users.noreply.github.com>
안녕하세요! 👋
안녕하세요! 저는 GitHub Copilot으로, PR의 코드 리뷰와 수정을 도와드립니다. 주요 기능:
사용 방법:
현재 이 PR에서는 custom redis.conf 지원 기능을 구현했습니다. 추가로 수정이나 개선이 필요한 부분이 있으시면 말씀해주세요! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for custom redis.conf configurations to the Redis Operator, enabling users to specify Redis settings through the RedisCluster CRD while maintaining backward compatibility.
- Introduces a new
redisConfigfield to the RedisClusterSpec for custom Redis configurations - Implements ConfigMap-based configuration management with automatic merging of essential cluster settings
- Updates Helm charts and sample configurations to support the new feature
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
api/v1beta1/rediscluster_types.go |
Added RedisConfig field to RedisClusterSpec |
api/v1beta1/zz_generated.deepcopy.go |
Updated deepcopy methods for RedisConfig field |
k8sutils/utils.go |
Implemented ConfigMap generation, management, and pod configuration logic |
config/crd/bases/redis.redis_redisclusters.yaml |
Updated CRD schema to include redisConfig field |
charts/redis-operator/values.yaml |
Added redisConfig field with documentation and examples |
charts/redis-operator/templates/rediscluster.yaml |
Updated template to pass redisConfig from values |
charts/redis-operator/crds/redis.redis_redisclusters.yaml |
Updated Helm CRD with redisConfig field |
config/samples/redis_v1beta1_rediscluster_with_custom_config.yaml |
Added sample CR demonstrating custom configuration |
config/samples/redis_v1beta1_rediscluster.yaml |
Updated basic sample with commented redisConfig examples |
README.md |
Added comprehensive documentation for the custom configuration feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
This PR adds support for custom
redis.confconfigurations to the Redis Operator, allowing users to specify Redis settings tailored to their specific environment requirements through the RedisCluster CRD.Motivation
Different environments require different Redis configurations (memory policies, persistence settings, timeouts, etc.). Previously, users were limited to the default settings provided by the operator. This enhancement enables users to customize their Redis clusters while maintaining cluster functionality.
Changes
1. CRD Enhancement
Added a new
redisConfigfield to theRedisClusterSpec:2. Implementation Details
ConfigMap-based Approach:
redisConfigis specified, the operator creates a ConfigMap namedrediscluster-{name}-configredis.conffile generated from user settings/redis-configand start withredis-server /redis-config/redis.confSmart Configuration Merging:
port(derived from basePort)cluster-enabled yescluster-port(port + 10000)cluster-node-timeout 5000maxmemory(from spec.maxMemory)protected-mode noNew Functions:
GenerateRedisConfigMap()- Creates ConfigMap from user configurationCreateOrUpdateRedisConfigMap()- Manages ConfigMap lifecycleGenerateRedisPodDef()- Handles both ConfigMap and command-line based configurations3. Helm Chart Integration
Updated
values.yamlto support the new field:4. Documentation
Backward Compatibility
✅ No breaking changes - Existing RedisCluster deployments without
redisConfigcontinue to work exactly as before, using command-line arguments for Redis configuration.Testing
Files Modified
api/v1beta1/rediscluster_types.go- Added RedisConfig fieldapi/v1beta1/zz_generated.deepcopy.go- Updated deepcopy methodsk8sutils/utils.go- Implemented ConfigMap management and pod configuration logiccharts/redis-operator/values.yaml- Added redisConfig field with examplescharts/redis-operator/templates/rediscluster.yaml- Updated template to pass redisConfigconfig/crd/bases/redis.redis_redisclusters.yaml- Updated CRD manifestcharts/redis-operator/crds/redis.redis_redisclusters.yaml- Updated Helm CRDconfig/samples/*- Added sample CRsREADME.md- Comprehensive documentationCloses #[issue-number]
Original prompt
Fixes #9
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.