Giter VIP home page Giter VIP logo

py-redis's Introduction

How to Demo Redis in PDS

Testing redis on PDS

Need to Demo a few Kubernetes Pods writing data to a Redis Data Service on PDS? Great, you are in the right place. :) I choose this over a node.js web ui, because I wanted to create some load and scale simulations (even though it is not that much).

  1. Deploy a Redis data Service on PDS. For this test it must a single node redis deployment, the redis-py library doesn't handly clustered Redis at this time. Look for a seperate demo for clustered Redis. After the deployment is ready make sure to grab the node name, Username and Password from the Connection link for the Service in PDS.

  2. Clone this repo git clone https://github.com/2vcps/py-redis.git

  3. Edit env-secret.yaml to match your environment. And Apply it to a namespace:

kubectl create ns py-redis
kuebctl -n py-redis apply -f env-secret.yaml
  1. Apply the worker.yaml to create the deployment.
kubectl -n py-redis apply -f worker.yaml
  1. Get the name of your Redis pod, in my case it is red-jowings-o18106, you can find it in the PDS UI. Replace it in the POD= CLI below.

Verify your dataservice is working.

POD=`kubectl -n pds-demo get pods -l name=red-jowings-o18106 | grep Running | grep 2/2 | awk '{print $1}'`
kubectl -n pds-demo exec -it $POD -- bash

From the pod command line:

redis-cli --user pds --pass <pds password>

KEYS *
5100) "Colleen"
5101) "Quinton"
5102) "Tonda"
5103) "Marion"
5104) "Cristie"
5105) "Chara"
5106) "Bonny"
5107) "Loris"
5108) "Hee"

GET Hee
"6003"

Type quit then exit to get out of the container bash shell.

  1. You can also scale the worker deployment
kubectl -n py-redis scale deployment worker-redis --replicas=16
NAME                            READY   STATUS    RESTARTS   AGE
worker-redis-6fb5c5d7bd-2q2mt   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-6w6wb   1/1     Running   0          6s
worker-redis-6fb5c5d7bd-8hfbw   1/1     Running   0          60m
worker-redis-6fb5c5d7bd-c85b4   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-fxrz4   1/1     Running   0          60m
worker-redis-6fb5c5d7bd-g6xq6   1/1     Running   0          60m
worker-redis-6fb5c5d7bd-g9kjk   1/1     Running   0          61m
worker-redis-6fb5c5d7bd-kfjhb   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-mnzbx   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-n5nzq   1/1     Running   0          60m
worker-redis-6fb5c5d7bd-pjjb8   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-qtc69   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-rldw7   1/1     Running   0          7s
worker-redis-6fb5c5d7bd-rzhjb   1/1     Running   0          60m
worker-redis-6fb5c5d7bd-s2s2c   1/1     Running   0          60m
worker-redis-6fb5c5d7bd-vhr7m   1/1     Running   0          60m

Redis Cache hit ration

Now check your PDS UI for metrics and see if the connections and other graphs have changed.

py-redis's People

Contributors

2vcps avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.