|
1 | | -# Redis Kubernetes Deployment |
| 1 | +# Kubernetes Deployments |
2 | 2 |
|
3 | | -This directory contains Kubernetes manifests for deploying Redis. |
| 3 | +This directory contains Kubernetes manifests for deploying Redis and the test-redis-ws application. |
4 | 4 |
|
5 | 5 | ## Files |
6 | 6 | - `redis-deployment.yaml` - Redis deployment with 1 replica |
7 | | -- `redis-service.yaml` - ClusterIP service exposing port 6379 |
| 7 | +- `redis-service.yaml` - ClusterIP service exposing Redis on port 6379 |
| 8 | +- `test-redis-ws-deployment.yaml` - test-redis-ws deployment with 3 replicas |
| 9 | +- `test-redis-ws-service.yaml` - ClusterIP service exposing test-redis-ws on port 8000 |
8 | 10 |
|
9 | 11 | ## Deploy |
10 | 12 | ```bash |
| 13 | +# Deploy everything |
11 | 14 | kubectl apply -f . |
| 15 | + |
| 16 | +# Or deploy individually |
| 17 | +kubectl apply -f redis-deployment.yaml |
| 18 | +kubectl apply -f redis-service.yaml |
| 19 | +kubectl apply -f test-redis-ws-deployment.yaml |
| 20 | +kubectl apply -f test-redis-ws-service.yaml |
12 | 21 | ``` |
13 | 22 |
|
14 | | -## Test |
| 23 | +## Container Image |
| 24 | +The test-redis-ws image is automatically built and pushed to GitHub Container Registry on push to main branch. |
| 25 | +- Image: `ghcr.io/nsls2/test-redis-ws:latest` |
| 26 | +- Build workflow: `.github/workflows/build-push.yml` |
| 27 | + |
| 28 | +## Test Redis |
15 | 29 | ```bash |
16 | 30 | # Connect to a netshoot container |
17 | 31 | kubectl run netshoot --image=nicolaka/netshoot --rm -it --restart=Never -- /bin/bash |
18 | 32 |
|
19 | 33 | # Test Redis connection from inside the container |
20 | 34 | echo -e "PING\r\n" | nc redis 6379 |
| 35 | +``` |
| 36 | + |
| 37 | +## Test test-redis-ws |
| 38 | +```bash |
| 39 | +# Connect to a netshoot container |
| 40 | +kubectl run netshoot --image=nicolaka/netshoot --rm -it --restart=Never -- /bin/bash |
| 41 | + |
| 42 | +# Test the service from inside the container |
| 43 | +curl http://test-redis-ws:8000/ |
21 | 44 | ``` |
0 commit comments