buildkit/examples/kubernetes/consistenthash
Akihiro Suda 1bde5d99d5 massive doc updates
* examples/kubernetes: newly added
* docs/rootless.md: cleaned up for better readability
* examples/README.md: split out from the main README.md
* examples/build-using-dockerfile/README.md: split out from the main README.md
* README.md: add TOC using https://github.com/thlorenz/doctoc
* README.md: add mTLS configuration (relates to #1074)
* README.md: add more adoptions
* README.md: add inline cache (fix #976)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-16 18:55:27 +09:00
..
README.md massive doc updates 2019-10-16 18:55:27 +09:00
main.go massive doc updates 2019-10-16 18:55:27 +09:00
show-running-pods.sh massive doc updates 2019-10-16 18:55:27 +09:00

README.md

Distributed Build with Consistent Hashing

Demo for efficiently using BuildKit daemon-local cache with multi-node cluster

Deploy

$ kubectl apply -f ../statefulset.rootless.yaml
$ kubectl scale --replicas=10 statefulset/buildkitd

Consistent hashing

Define the key string for consistent hashing.

For example, the key can be defined as <REPO NAME>:<CONTEXT PATH>, e.g. github.com/example/project:some/directory.

Then determine the pod that corresponds to the key:

$ go build -o consistenthash .
$ pod=$(./show-running-pods.sh | consistenthash $key)

You can connect to the pod using export BUILDKIT_HOST=kube-pod://$pod.