Script to bootstrap k8s cluster the hard way with Virtualbox
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin _ssh: Enforce ssh with IdentitiesOnly yes Jan 19, 2019
etc etc/custom.env.sh: change default settings Jan 19, 2019
helm helm/traefik: very simple helm to install traefi Jan 18, 2019
.gitignore .gitignore: update Jan 18, 2019
README.md README: clean up Jan 18, 2019

README.md

Bootstrap a k8s cluster the hardway with VirtualBox

k8s the hardway requires an admin access on GKE. I slightly modify the process to bootstrap a k8s cluster on my VirtualBox environment (thanks to Vagrant.) And yes I have a script to automate the process.

Getting started

Install basic tools

  • VirtualBox (pacman -S virtualbox)
  • Vagrant (pacman -S vagrant)
  • https://github.com/cloudflare/cfssl (Please install all tools with go get -u github.com/cloudflare/cfssl/cmd/... and modify your PATH environment variable to recognize these new tools installed in $GOPATH/bin.)
  • kubectl command line

Bootstrap the cluster

Edit some basic settings in ./etc/custom.env.sh and start the cluster:

./bin/hisk8s.sh _env   # Print basic information
./bin/hisk8s.sh _test  # Create new cluster

Running smoke tests

./bin/hisk8s.sh _smoke_tests
./bin/hisk8s.sh _smoke_test_deploy_app

kubectl configuration will be stored under ./etc/.kube/config. You can execute the tool via the wrapper, for examples:

./bin/hisk8s.sh _kubectl get nodes
NAME         STATUS   ROLES    AGE    VERSION
worker-141   Ready    <none>   100s   v1.12.0

(You can also use the shortcut ./bin/_kubectl)

Debugging

To enter a node, use the wrapper script:

./bin/hisk8s.sh _ssh_list
./bin/hisk8s.sh _ssh 111

You can also use different aliases provided in the output of _ssh_list.

Tear down

./bin/hisk8s.sh _vagrant destroy -f

In-depth docs, details and customizations

TODO