From 4ef8afc63eb6dc813c47a7af2bb69ba4d6025a10 Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Sat, 19 Mar 2022 00:12:48 +0300 Subject: [PATCH] hit counter with redis cluster example --- examples/hello-app-redis/README.md | 12 ++++ examples/hello-app-redis/docker-compose.yaml | 67 ++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 examples/hello-app-redis/README.md create mode 100644 examples/hello-app-redis/docker-compose.yaml diff --git a/examples/hello-app-redis/README.md b/examples/hello-app-redis/README.md new file mode 100644 index 0000000..7c536e0 --- /dev/null +++ b/examples/hello-app-redis/README.md @@ -0,0 +1,12 @@ +# GCR Hello App Redis + +A 6-node redis cluster using [Bitnami](https://github.com/bitnami/bitnami-docker-redis-cluster) +with a [simple hit counter](https://github.com/GoogleCloudPlatform/kubernetes-engine-samples/tree/main/hello-app-redis) that persists on that redis cluster + +``` +podman-compose up +``` + +then open your browser on [http://localhost:8080/](http://localhost:8080/) + + diff --git a/examples/hello-app-redis/docker-compose.yaml b/examples/hello-app-redis/docker-compose.yaml new file mode 100644 index 0000000..a8f7f4a --- /dev/null +++ b/examples/hello-app-redis/docker-compose.yaml @@ -0,0 +1,67 @@ +--- +version: '3' +volumes: + redis-node1-data: + redis-node2-data: + redis-node3-data: + redis-node4-data: + redis-node5-data: + redis-data: +services: + web: + image: gcr.io/google-samples/hello-app-redis:1.0 + depends_on: + - redis-cluster + ports: + - "${HOST_PORT:-8080}:8080" + redis-node1: + image: docker.io/bitnami/redis-cluster:6.2 + volumes: + - redis-node1-data:/bitnami/redis/data + environment: + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster + redis-node2: + image: docker.io/bitnami/redis-cluster:6.2 + volumes: + - redis-node2-data:/bitnami/redis/data + environment: + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster + redis-node3: + image: docker.io/bitnami/redis-cluster:6.2 + volumes: + - redis-node3-data:/bitnami/redis/data + environment: + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster + redis-node4: + image: docker.io/bitnami/redis-cluster:6.2 + volumes: + - redis-node4-data:/bitnami/redis/data + environment: + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster + redis-node5: + image: docker.io/bitnami/redis-cluster:6.2 + volumes: + - redis-node5-data:/bitnami/redis/data + environment: + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster + + redis-cluster: + image: docker.io/bitnami/redis-cluster:6.2 + volumes: + - redis-data:/bitnami/redis/data + depends_on: + - redis-node1 + - redis-node2 + - redis-node3 + - redis-node4 + - redis-node5 + environment: + - ALLOW_EMPTY_PASSWORD=yes + - REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster + - REDIS_CLUSTER_CREATOR=yes +