OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
734 stars 207 forks source link

feat: exporter connect to redis with TLS URI #902

Closed wkd-woo closed 2 months ago

wkd-woo commented 2 months ago

Description

$kubectl get pod/redis-replication-0 -o yaml

...
    - name: REDIS_ADDR
      value: rediss://localhost:6379
    - name: REDIS_EXPORTER_SKIP_TLS_VERIFICATION
      value: "true"
    - name: REDIS_EXPORTER_TLS_CA_CERT_FILE
      value: /tls/ca.crt
    - name: REDIS_EXPORTER_TLS_CLIENT_CERT_FILE
      value: /tls/tls.crt
    - name: REDIS_EXPORTER_TLS_CLIENT_KEY_FILE
      value: /tls/tls.key
...

In order for the TLS-applied redis-server and exporter to communicate, the URI to which the exporter accesses the redis-server must be changed.

redis://<REDIS-SERVER> -> rediss://<REDIS-SERVER>


This is what redis exporter README description describes. Please refer to below.


image

https://github.com/oliver006/redis_exporter?tab=readme-ov-file#command-line-flags


@shubham-cmyk @drivebyer Please consider merging these pull requests, thank you always.

Type of change

Checklist

Additional Context

image

After I added this feature, the exporter can connect to TLS-enabled redis-server and makes metrics.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 39.93%. Comparing base (d121d86) to head (d605650). Report is 35 commits behind head on master.

Files Patch % Lines
k8sutils/statefulset.go 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #902 +/- ## ========================================== + Coverage 35.20% 39.93% +4.73% ========================================== Files 19 19 Lines 3213 2662 -551 ========================================== - Hits 1131 1063 -68 + Misses 2015 1528 -487 - Partials 67 71 +4 ```

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

drivebyer commented 2 months ago

nice!