redis-operator icon indicating copy to clipboard operation
redis-operator copied to clipboard

feat: redissentinel enhancement add column of quorum, masteraddress

Open husnialhamdani opened this issue 6 months ago • 5 comments

Description

Add column, print out info of quorum and masterAddress

kubectl get redissentinel -n default
NAME             QUORUM    MASTERADDRESS   AGE
redis-sentinel   Healthy   10.244.9.3      40m

*This PR also a pre-requisite of RedisSentinels metrics

Fixes #ISSUE

Type of change

  • 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

husnialhamdani avatar May 28 '25 05:05 husnialhamdani

Codecov Report

:x: Patch coverage is 36.36364% with 49 lines in your changes missing coverage. Please review. :warning: Please upload report for BASE (main@903520d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/k8sutils/redis.go 0.00% 46 Missing :warning:
...ntroller/redissentinel/redissentinel_controller.go 90.32% 2 Missing and 1 partial :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1376   +/-   ##
=======================================
  Coverage        ?   34.75%           
=======================================
  Files           ?       67           
  Lines           ?     6416           
  Branches        ?        0           
=======================================
  Hits            ?     2230           
  Misses          ?     4004           
  Partials        ?      182           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 28 '25 08:05 codecov[bot]

any comment @drivebyer ?

husnialhamdani avatar May 28 '25 08:05 husnialhamdani

any comment @drivebyer ?

Exporting these metrics to the CRD is slightly resource-intensive. The Sentinel deployment focuses on Redis high availability (HA). By the way, we currently reconcile RedisSentinel when there is an update to either the resource itself or the RedisReplication. Therefore, the fields in the status may not always reflect the real-time state. To understand the actual behavior of Sentinel, we should rely on the metrics provided by the exporter.

drivebyer avatar May 29 '25 07:05 drivebyer

Here's the exclusion

we currently reconcile RedisSentinel when there is an update to either the resource itself or the RedisReplication

if statusResult.RequeueAfter > 0 {
		return statusResult, nil
	}

husnialhamdani avatar May 29 '25 14:05 husnialhamdani

Here's the exclusion

we currently reconcile RedisSentinel when there is an update to either the resource itself or the RedisReplication

if statusResult.RequeueAfter > 0 {
		return statusResult, nil
	}

Got it. However, this change modifies the reconciliation logic. I think we should reconcile only when necessary, which can reduce the load on the Kubernetes cluster.

I propose that we gather more feedback on this.

drivebyer avatar May 30 '25 08:05 drivebyer