Sign inSign up

redmart/redis-pod-labeler

By redmart

•Updated about 7 years ago

Checking redis pods ( sentinel enabled) and labelling them with master/slave accordingly.

Image
2

50K+

redmart/redis-pod-labeler repository overview

https://github.com/Redmart/redis-pod-labeler⁠

⁠redis-pod-labeler

Docker image for find and label the redis pods( sentinel enabled) in the kubernetes cluster according to the role ( master, slave)

⁠Description

A simple python script to find the redis pods in Kubernetes for the given labels and label them according to the rule.

redis-cli -h redis-ha.redis -p 26379 sentinel get-master-addr-by-name mymaster - used to get the redis master service details

grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' - used to get the IP address filtered

Those pods updated with the labels master, slave accordingly.

⁠Example Deployment

An example of a deployment can be found in the file sample-redis-pod-labeler-deployment.yaml⁠

⁠Arguments

Argument nameDescriptionDefault
--redis-cluster-nameredis sentinel master-group-name (must required)
--redis-headless-svc-nameheadless service name of the redis (must required)
--namespacenamespace of the redis-ha deploymentredis
--pod-selectorkey=value of to match labels and get the redis podsapp=redis-ha
--redis-sentinel_portredis sentinel port26379
--update-periodHow frequent this should update the labels (seconds)60
--company-domaincompany domain to make label key (example.com/role)redmart.com
--config-filepath to kube config file-
--incluster-configload in-cluster kube configTrue
--insecure-skip-tls-verifyskip tls verificationFalse
--verboseenable detailed output in the logsFalse

Tag summary

Content type

Image

Digest

Size

29.7 MB

Last updated

about 7 years ago

docker pull redmart/redis-pod-labeler