Created
October 1, 2019 16:54
-
-
Save stealthybox/4be627c760c27918a2d2017a0a7e3c8e to your computer and use it in GitHub Desktop.
kinder dev cluster that mounts kubernetes binaries -- use with https://github.com/kubernetes/kubeadm/tree/master/kinder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# setup a kinder cluster with the bazel and output directories mounted | |
set -eu | |
binary="kubeadm" | |
kube_root="${kube_root:-${GOPATH:-${HOME}/go}/src/k8s.io/kubernetes}" | |
bazel_binpath="bazel-bin/cmd/${binary}/linux_amd64_pure_stripped/" | |
output_binpath="_output/local/bin/linux/amd64/" | |
kinder_root="${kinder_root:-${GOPATH:-${HOME}/go}/src/k8s.io/kubeadm/kinder}" | |
cat << EOF | kinder create cluster --config=/dev/stdin | |
kind: Cluster | |
apiVersion: kind.sigs.k8s.io/v1alpha3 | |
nodes: | |
- role: control-plane | |
extraMounts: | |
- containerPath: /output-bin | |
hostPath: ${kube_root}/${output_binpath} | |
- containerPath: /bazel-${binary} | |
hostPath: ${kube_root}/${bazel_binpath} | |
- containerPath: /kinder | |
hostPath: ${kinder_root} | |
EOF | |
docker exec -it kind-control-plane \ | |
sh -c 'apt-get update && apt-get install -y git' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment