Skip to content

fix: improve pod label patching with error handling and retry mechanism#1231

Merged
drivebyer merged 1 commit intoOT-CONTAINER-KIT:masterfrom
drivebyer:improve
Feb 2, 2025
Merged

fix: improve pod label patching with error handling and retry mechanism#1231
drivebyer merged 1 commit intoOT-CONTAINER-KIT:masterfrom
drivebyer:improve

Conversation

@drivebyer
Copy link
Collaborator

  • 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

Description

#1217
Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Tests have been added/modified and all tests pass.
  • Functionality/bugs have been confirmed to be unchanged or fixed.
  • I have performed a self-review of my own code.
  • Documentation has been updated or added where necessary.

Additional Context

…chanism

- 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>
@codecov
Copy link

codecov bot commented Feb 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.

Project coverage is 28.83%. Comparing base (60ef5a2) to head (69851dd).
Report is 41 commits behind head on master.

Files with missing lines Patch % Lines
pkg/k8sutils/pod.go 0.00% 30 Missing ⚠️
pkg/util/strings.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1231      +/-   ##
==========================================
- Coverage   30.20%   28.83%   -1.37%     
==========================================
  Files          55       58       +3     
  Lines        6294     6700     +406     
==========================================
+ Hits         1901     1932      +31     
- Misses       4200     4609     +409     
+ Partials      193      159      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@drivebyer drivebyer merged commit 2099316 into OT-CONTAINER-KIT:master Feb 2, 2025
16 of 19 checks passed
@drivebyer drivebyer deleted the improve branch February 2, 2025 14:25
@drivebyer drivebyer added the bug Something isn't working label Feb 2, 2025
@trynocoding
Copy link

@drivebyer Hello, has this patch fixed the #1217?
I tried to fail the master node, the sentinel has been failover, but the label of the pod on the new master node is not being updated.

[root@master redis]# kubectl get po --show-labels
NAME                        READY   STATUS    RESTARTS   AGE    LABELS
redis-replication-0         0/2     Pending   0          1s     app=redis-replication,controller-revision-hash=redis-replication-66cccc9c9c,redis_setup_type=replication,role=replication,statefulset.kubernetes.io/pod-name=redis-replication-0
redis-replication-1         2/2     Running   0          102m   app=redis-replication,controller-revision-hash=redis-replication-66cccc9c9c,redis-role=slave,redis_setup_type=replication,role=replication,statefulset.kubernetes.io/pod-name=redis-replication-1
redis-replication-2         2/2     Running   0          101m   app=redis-replication,controller-revision-hash=redis-replication-66cccc9c9c,redis-role=slave,redis_setup_type=replication,role=replication,statefulset.kubernetes.io/pod-name=redis-replication-2
redis-sentinel-sentinel-0   1/1     Running   0          97m    app=redis-sentinel-sentinel,controller-revision-hash=redis-sentinel-sentinel-6944bf47f6,redis_setup_type=sentinel,role=sentinel,statefulset.kubernetes.io/pod-name=redis-sentinel-sentinel-0
redis-sentinel-sentinel-1   1/1     Running   0          96m    app=redis-sentinel-sentinel,controller-revision-hash=redis-sentinel-sentinel-6944bf47f6,redis_setup_type=sentinel,role=sentinel,statefulset.kubernetes.io/pod-name=redis-sentinel-sentinel-1
redis-sentinel-sentinel-2   1/1     Running   0          95m    app=redis-sentinel-sentinel,controller-revision-hash=redis-sentinel-sentinel-6944bf47f6,redis_setup_type=sentinel,role=sentinel,statefulset.kubernetes.io/pod-name=redis-sentinel-sentinel-2
[root@master ~]# 
[root@master ~]# kubectl exec -it redis-replication-1 bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
Defaulted container "redis-replication" out of: redis-replication, redis-exporter
redis-replication-1:/data$ redis-cli -p 6379 info replication
# Replication
role:master
connected_slaves:1
slave0:ip=10.0.1.246,port=6379,state=online,offset=1146098,lag=0
master_failover_state:no-failover
master_replid:fca285fdb30572800c1377bc731bb19720eb0382
master_replid2:bbf34d5e1c5cb30bd7874a0a87fe910edfed58de
master_repl_offset:1146098
second_repl_offset:37532
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:81761
repl_backlog_histlen:1064338
redis-replication-1:/data$ exit
exit
[root@master ~]# kubectl exec -it redis-replication-2 bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
Defaulted container "redis-replication" out of: redis-replication, redis-exporter
^[[Aredis-replication-2:/daredis-cli -p 6379 info replicationtion
# Replication
role:slave
master_host:10.0.2.16
master_port:6379
master_link_status:up
master_last_io_seconds_ago:1
master_sync_in_progress:0
slave_read_repl_offset:1148919
slave_repl_offset:1148919
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:fca285fdb30572800c1377bc731bb19720eb0382
master_replid2:bbf34d5e1c5cb30bd7874a0a87fe910edfed58de
master_repl_offset:1148919
second_repl_offset:37532
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:81761
repl_backlog_histlen:1067159
redis-replication-2:/data$ 

operator log

{"level":"info","ts":"2025-02-05T16:29:24+08:00","msg":"StatefulSet not ready yet, requeuing","controller":"redisreplication","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"RedisReplication","RedisReplication":{"name":"redis-replication","namespace":"default"},"namespace":"default","name":"redis-replication","reconcileID":"e71400cc-7e76-4750-b0ed-93c8bddd8086","namespace":"default","name":"redis-replication"}
{"level":"info","ts":"2025-02-05T16:29:25+08:00","msg":"StatefulSet not ready yet, requeuing","controller":"redisreplication","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"RedisReplication","RedisReplication":{"name":"redis-replication","namespace":"default"},"namespace":"default","name":"redis-replication","reconcileID":"cec8bfd8-0c6b-4985-9fbe-7cfcf770541d","namespace":"default","name":"redis-replication"}
{"level":"info","ts":"2025-02-05T16:29:26+08:00","msg":"StatefulSet not ready yet, requeuing","controller":"redisreplication","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"RedisReplication","RedisReplication":{"name":"redis-replication","namespace":"default"},"namespace":"default","name":"redis-replication","reconcileID":"816fd418-7140-4a5a-9191-011184275ebe","namespace":"default","name":"redis-replication"}
{"level":"info","ts":"2025-02-05T16:29:27+08:00","msg":"StatefulSet not ready yet, requeuing","controller":"redisreplication","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"RedisReplication","RedisReplication":{"name":"redis-replication","namespace":"default"},"namespace":"default","name":"redis-replication","reconcileID":"7c9bd3d0-6ef0-46b9-9aa5-535131e8f3c8","namespace":"default","name":"redis-replication"}

@drivebyer
Copy link
Collaborator Author

@trynocoding Thanks for your report :) This will be fixed by the next release.

drivebyer added a commit that referenced this pull request Mar 6, 2025
#1263)

* Added support for hostPort and updated helmcharts

* removed changed from helm chart

* feat: Add hostPort support to Redis CRDs and update deepcopy methods

* feat: sentinel support hostname resolve and annonce (#1247)

* feat: Sentinel - support hostname resolve and annonce master

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>

* fix

Signed-off-by: yangw <wuyangmuc@gmail.com>

* fix

Signed-off-by: yangw <wuyangmuc@gmail.com>

---------

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>
Signed-off-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: yangw <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Added support for hostPort and updated helmcharts

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#1256)

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump sigstore/cosign-installer from 3.7.0 to 3.8.1 (#1255)

Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.7.0 to 3.8.1.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](sigstore/cosign-installer@v3.7.0...v3.8.1)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add redis agent with bootstrap configuration generation (#1254)

* move main

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* feat: add redis agent with bootstrap configuration generation

- Introduced new agent package for Redis and Sentinel configuration management
- Added Cobra CLI support for agent bootstrap command
- Implemented configuration generation for Sentinel with environment-based customization
- Created Dockerfile for agent image
- Added utility functions for environment variable handling
- Prepared foundation for Redis and Sentinel configuration bootstrapping

Signed-off-by: Redis Operator Team
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>
Signed-off-by: Redis Operator Team
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Implement comprehensive Redis configuration generation for agent bootstrap (#1260)

* feat: Implement comprehensive Redis configuration generation for agent bootstrap

This commit adds a detailed implementation of Redis configuration generation with support for:
- Cluster and standalone modes
- TLS configuration
- ACL setup
- Persistence options
- Port and network configurations
- Dynamic IP and hostname resolution
- External configuration file inclusion

The implementation uses environment variables to customize Redis configuration dynamically and handles various deployment scenarios.

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* fix

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

---------

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* removed changed from helm chart

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Add hostPort support to Redis CRDs and update deepcopy methods

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add dynamic Redis configuration support for Redis Cluster (#1241)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: configurable operator maxConcurrentReconciles (#1242)

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

---------

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* ci: add GitHub workflow for automatic PR rebase (#1243)

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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Bump operator version

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* refactor: remove v1beta1 API version and migrate to v1beta2 (#1245)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: sentinel support hostname resolve and annonce (#1247)

* feat: Sentinel - support hostname resolve and annonce master

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>

* fix

Signed-off-by: yangw <wuyangmuc@gmail.com>

* fix

Signed-off-by: yangw <wuyangmuc@gmail.com>

---------

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>
Signed-off-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: yangw <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Added support for hostPort and updated helmcharts

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#1256)

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump sigstore/cosign-installer from 3.7.0 to 3.8.1 (#1255)

Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.7.0 to 3.8.1.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](sigstore/cosign-installer@v3.7.0...v3.8.1)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add redis agent with bootstrap configuration generation (#1254)

* move main

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* feat: add redis agent with bootstrap configuration generation

- Introduced new agent package for Redis and Sentinel configuration management
- Added Cobra CLI support for agent bootstrap command
- Implemented configuration generation for Sentinel with environment-based customization
- Created Dockerfile for agent image
- Added utility functions for environment variable handling
- Prepared foundation for Redis and Sentinel configuration bootstrapping

Signed-off-by: Redis Operator Team
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>
Signed-off-by: Redis Operator Team
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Implement comprehensive Redis configuration generation for agent bootstrap (#1260)

* feat: Implement comprehensive Redis configuration generation for agent bootstrap

This commit adds a detailed implementation of Redis configuration generation with support for:
- Cluster and standalone modes
- TLS configuration
- ACL setup
- Persistence options
- Port and network configurations
- Dynamic IP and hostname resolution
- External configuration file inclusion

The implementation uses environment variables to customize Redis configuration dynamically and handles various deployment scenarios.

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* fix

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

---------

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* removed changed from helm chart

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Add hostPort support to Redis CRDs and update deepcopy methods

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Added support for hostPort and updated helmcharts

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* removed changed from helm chart

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Add hostPort support to Redis CRDs and update deepcopy methods

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* fix: replace hardcoded Redis port 6379 with configurable port from cr.Spec.Port (#1261)

- Updated RedisClusterStatusHealth function to use cr.Spec.Port instead of hardcoded 6379 port.

Co-authored-by: fengyinqiao <fengyinqiao@shizhuang-inc.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* test: enhance testing with data assertion scripts (#1209)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add headless service configuration support (#1219)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* fix: add missing topologySpreadConstraint on RedisCluster follower (#1218)

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: update redis-operator cert manager configuration. (#1220)

* fix: update redis-operator chart configuration and documentation.

- Removed Chart.lock file for cert-manager dependency
- Updated Chart.yaml to remove explicit cert-manager dependency
- Bumped chart version to 0.19.2
- Updated README.md to clarify cert-manager installation instructions
- Modified values.yaml to improve cert-manager and webhook configuration documentation
- Added configuration validation helper in _helpers.tpl
- Introduced NOTES.txt template for helm chart installation guidance

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* docs

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

---------

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore: dockerfile command style consistency (#1222)

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: update certificate serverName to support wildcard certs (#1221)

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add additional service configuration with optional enable flag (#1228)

- 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump helm/chart-releaser-action from 1.6.0 to 1.7.0 (#1230)

Bumps [helm/chart-releaser-action](https://github.com/helm/chart-releaser-action) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/helm/chart-releaser-action/releases)
- [Commits](helm/chart-releaser-action@v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: helm/chart-releaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump helm/chart-testing-action from 2.6.0 to 2.7.0 (#1229)

Bumps [helm/chart-testing-action](https://github.com/helm/chart-testing-action) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/helm/chart-testing-action/releases)
- [Commits](helm/chart-testing-action@v2.6.0...v2.7.0)

---
updated-dependencies:
- dependency-name: helm/chart-testing-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump github.com/onsi/ginkgo/v2 from 2.22.1 to 2.22.2 (#1225)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.22.1 to 2.22.2.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.22.1...v2.22.2)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* fix: improve pod label patching with error handling and retry mechanism (#1231)

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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: enhance Redis HA and node scheduling strategy (#1237)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add securityContext config in chart for redis-exporter (#1238)

feat: add securityContext config for redis-exporter

Add ability to configure securityContext for redis-exporter in redis helm charts:
- redis
- redis-cluster
- redis-replication
- redis-sentinel

Supported in:
- v1beta1 & v1beta2: Redis, RedisCluster, RedisReplication Operator CRDs
- v1beta2 only: RedisSentinel Operator CRD

This aligns with existing redis operator CRD functionality.

Signed-off-by: Hexoplon <github@zackeus.no>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* fix: make recreate statefulset only trigger when value true (#1240)

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add dynamic Redis configuration support for Redis Cluster (#1241)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: configurable operator maxConcurrentReconciles (#1242)

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

* feat: configurable operator maxConcurrentReconciles

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>

---------

Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* ci: add GitHub workflow for automatic PR rebase (#1243)

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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Bump operator version

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* refactor: remove v1beta1 API version and migrate to v1beta2 (#1245)

* 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>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: sentinel support hostname resolve and annonce (#1247)

* feat: Sentinel - support hostname resolve and annonce master

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>

* fix

Signed-off-by: yangw <wuyangmuc@gmail.com>

* fix

Signed-off-by: yangw <wuyangmuc@gmail.com>

---------

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>
Signed-off-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: yangw <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Added support for hostPort and updated helmcharts

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#1256)

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump sigstore/cosign-installer from 3.7.0 to 3.8.1 (#1255)

Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.7.0 to 3.8.1.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](sigstore/cosign-installer@v3.7.0...v3.8.1)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: add redis agent with bootstrap configuration generation (#1254)

* move main

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* feat: add redis agent with bootstrap configuration generation

- Introduced new agent package for Redis and Sentinel configuration management
- Added Cobra CLI support for agent bootstrap command
- Implemented configuration generation for Sentinel with environment-based customization
- Created Dockerfile for agent image
- Added utility functions for environment variable handling
- Prepared foundation for Redis and Sentinel configuration bootstrapping

Signed-off-by: Redis Operator Team
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>
Signed-off-by: Redis Operator Team
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Implement comprehensive Redis configuration generation for agent bootstrap (#1260)

* feat: Implement comprehensive Redis configuration generation for agent bootstrap

This commit adds a detailed implementation of Redis configuration generation with support for:
- Cluster and standalone modes
- TLS configuration
- ACL setup
- Persistence options
- Port and network configurations
- Dynamic IP and hostname resolution
- External configuration file inclusion

The implementation uses environment variables to customize Redis configuration dynamically and handles various deployment scenarios.

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* fix

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

---------

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* removed changed from helm chart

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Add hostPort support to Redis CRDs and update deepcopy methods

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* Added support for hostPort and updated helmcharts

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#1256)

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add redis agent with bootstrap configuration generation (#1254)

* move main

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* feat: add redis agent with bootstrap configuration generation

- Introduced new agent package for Redis and Sentinel configuration management
- Added Cobra CLI support for agent bootstrap command
- Implemented configuration generation for Sentinel with environment-based customization
- Created Dockerfile for agent image
- Added utility functions for environment variable handling
- Prepared foundation for Redis and Sentinel configuration bootstrapping

Signed-off-by: Redis Operator Team
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>
Signed-off-by: Redis Operator Team

* feat: Implement comprehensive Redis configuration generation for agent bootstrap (#1260)

* feat: Implement comprehensive Redis configuration generation for agent bootstrap

This commit adds a detailed implementation of Redis configuration generation with support for:
- Cluster and standalone modes
- TLS configuration
- ACL setup
- Persistence options
- Port and network configurations
- Dynamic IP and hostname resolution
- External configuration file inclusion

The implementation uses environment variables to customize Redis configuration dynamically and handles various deployment scenarios.

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* fix

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

---------

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* removed changed from helm chart

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* feat: Add hostPort support to Redis CRDs and update deepcopy methods

Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

* fix: replace hardcoded Redis port 6379 with configurable port from cr.Spec.Port (#1261)

- Updated RedisClusterStatusHealth function to use cr.Spec.Port instead of hardcoded 6379 port.

Co-authored-by: fengyinqiao <fengyinqiao@shizhuang-inc.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>

---------

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>
Signed-off-by: yangw <wuyangmuc@gmail.com>
Signed-off-by: Muhammad Qadora <memomq70@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Redis Operator Team
Signed-off-by: Husni Alhamdani <dhanielluis@gmail.com>
Signed-off-by: Hexoplon <github@zackeus.no>
Co-authored-by: Michael Kanchuker <michaelkanchuker@gmail.com>
Co-authored-by: yangw <wuyangmuc@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yangw <yang.wu@daocloud.io>
Co-authored-by: Husni Alhamdani <dhanielluis@gmail.com>
Co-authored-by: Leslie__Joe <58540165+fengyinqiao@users.noreply.github.com>
Co-authored-by: fengyinqiao <fengyinqiao@shizhuang-inc.com>
Co-authored-by: Zackeus Bengtsson <32719220+Hexoplon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants