one-word-server

Crates.ioone-word-server
lib.rsone-word-server
version0.1.0
sourcesrc
created_at2023-05-06 21:06:48.293462
updated_at2023-05-06 21:06:48.293462
descriptionServe a word, randomly chosen at startup.
homepage
repositoryhttps://github.com/julianbuettner/one-word-server
max_upload_size
id858726
size22,468
Julian Büttner (julianbuettner)

documentation

README

Serve a string per HTTP

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.

Run

cargo run

You can now fetch the string:

curl http://localhost:8080/
# fast-duck

Kubernetes deployment

---
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
Commit count: 2

cargo fmt