Crates.io | one-word-server |
lib.rs | one-word-server |
version | 0.1.0 |
source | src |
created_at | 2023-05-06 21:06:48.293462 |
updated_at | 2023-05-06 21:06:48.293462 |
description | Serve a word, randomly chosen at startup. |
homepage | |
repository | https://github.com/julianbuettner/one-word-server |
max_upload_size | |
id | 858726 |
size | 22,468 |
The string is chosen randomly at startup.
This is to test load balancing in a Kubernetes cluster.
Once a container/pod is startet, it will always return
the same string.
cargo run
You can now fetch the string:
curl http://localhost:8080/
# fast-duck
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: one-word-server
labels:
app: rust
spec:
replicas: 3
selector:
matchLabels:
app: rust
template:
metadata:
labels:
app: rust
spec:
containers:
- name: build
image: rust:latest
command:
- cargo
- run
- one-word-server