Skip to content
/ prime Public

prime is a web service to find the Nth prime number.

License

Notifications You must be signed in to change notification settings

udhos/prime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license Go Report Card Go Reference Artifact Hub Docker Pulls

prime

Build

./build.sh

Usage

Start the server.

$ prime

Get the 100.000.000th prime.

$ time curl localhost:8080/prime/100000000
2038074743

real	0m1.300s
user	0m0.006s
sys	0m0.005s

Docker

Docker hub:

https://hub.docker.com/r/udhos/prime

Run from docker hub:

docker run -p 8080:8080 --rm udhos/prime:0.0.0

Build recipe:

./docker/build.sh

docker push udhos/prime:0.0.0

Helm chart

Using the repository

See https://udhos.github.io/prime/.

Create

mkdir charts
cd charts
helm create prime

Then edit files.

Lint

helm lint ./charts/prime --values charts/prime/values.yaml

Test rendering chart templates locally

helm template prime ./charts/prime --values charts/prime/values.yaml

Render templates at server

helm install prime ./charts/prime --values charts/prime/values.yaml --dry-run

Generate files for a chart repository

A chart repository is an HTTP server that houses one or more packaged charts. A chart repository is an HTTP server that houses an index.yaml file and optionally (*) some packaged charts.

(*) Optionally since the package charts could be hosted elsewhere and referenced by the index.yaml file.

docs
├── index.yaml
└── prime-0.1.0.tgz

See script update-charts.sh:

# generate chart package from source
helm package ./charts/prime -d ./docs

# regenerate the index from existing chart packages
helm repo index ./docs --url https://udhos.github.io/prime/

Install

helm install prime ./charts/prime --values charts/prime/values.yaml

Upgrade

helm upgrade prime ./charts/prime --values charts/prime/values.yaml

Uninstall

helm uninstall prime