From e663107edfdcb3d3beb969ddb7c09f7d568560d9 Mon Sep 17 00:00:00 2001 From: Marcela Morales Quispe Date: Fri, 14 Dec 2018 11:33:13 -0600 Subject: [PATCH] [Docs] Add a connection to Redis master example Signed-off-by: Marcela Morales Quispe --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 20c61abaa..b428a4c38 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ redis: - "hz 50" ``` -**Important*: this options will be set via `config set` or `sentinel set mymaster`. In the Sentinel options, there are some "conversions" to be made. +**Important**: this options will be set via `config set` or `sentinel set mymaster`. In the Sentinel options, there are some "conversions" to be made. - Configuration on the `sentinel.conf`: `sentinel down-after-milliseconds mymaster 2000` - Configuration on the `configOptions`: `down-after-milliseconds 2000` @@ -89,7 +89,36 @@ url: rfs- port: 26379 master-name: mymaster ``` - +#### Connection example +- To get Sentinel service's port + ``` + kubectl get service -l component=sentinel + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + rfs- ClusterIP 10.99.222.41 26379/TCP 20m + ``` +- To get a Sentinel's name + ``` + kubectl get pods -l component=sentinel + NAME READY STATUS RESTARTS AGE + rfs- 1/1 Running 0 20m + ``` +- To get network information of the Redis node working as a master + ``` + kubectl exec -it rfs- -- redis-cli -p 26379 SENTINEL get-master-addr-by-name mymaster + 1) "10.244.2.15" + 2) "6379" + ``` +- To set a `key:value` pair in Redis master + ``` + kubectl exec -it rfs- -- redis-cli -h 10.244.2.15 -p 6379 SET hello world! + OK + ``` +- To get `value` from `key` + ``` + kubectl exec -it rfs--- redis-cli -h 10.244.2.15 -p 6379 GET hello + "world!" + ``` + ## Cleanup If you want to delete the operator from your Kubernetes cluster, the operator deployment should be deleted.