Skip to content

Multi-Master and Refactor Release

Pre-release
Pre-release
Compare
Choose a tag to compare
@mclarkson mclarkson released this 28 May 19:31
· 206 commits to master since this release

What's new

  • Added --tailf option to mokctl build ... and mokctl create ..., for example:
    mokctl build image --tailf, or
    mokctl create cluster --masters 1 --tailf
    will follow the log output whilst running. Useful to see kubeadm output and the join details for joining worker nodes manually.
  • Updated to latest kubernetes 1.18.3.
  • Moved parser.sh to the src/lib/ directory.
  • Copied JSONPath.sh into the src/lib/ directory.
    Now JSONPath can be used instead of sed - see src/getcluster.sh to see how it's used.
  • Bug: Deleting a stopped cluster now works.
  • UI change.
    mokctl create cluster mokclust1 1 2, becomes:
    mokctl create cluster mokclust1 --masters 1 --workers 2
    mokctl create cluster mokclust1 1 0, becomes:
    mokctl create cluster mokclust1 --masters 1
    The old way still works however, so this still works:
    mokctl create cluster mokclust1 1 0
  • Logging has improved.
    For example if a mokctl build image fails, the full log is now shown.
  • Error handling is more consistent.
  • Code refactoring.
    Code is split into files, then combined to mokctl.deploy during make.
    Code is laid out in golang style with:
    • Godoc style commenting.
    • Each file acts like a 'module' for code reuse.
      • The parser is now completely generic and free for anyone to use - see src/lib/parser.sh.
        • Each 'module' programs the parser individually, then the parser has the full configuration for all 'modules'.
        • The parser is a great deal smaller - about 1/3 the size it was before.
        • Help text (usage), option handling and command line parsing are all declared and defined in each 'module' file, keeping all code specific to a module with that module.
      • Each module initialises itself on program startup - similar to having a constructor.
    • An associative array, think struct, starts each component file, for example _PA[] for the parser.
    • Each function is prefixed with the 'struct' name, for example 'PA_run'.
    • Getters and setters. Functions use getters and setters to set array members from other files.
    • Public and private functions. Private functions start with '_' and should not be called from any other file.
    • The only globals are:
      • Associative arrays
      • Read-only global constants, which are defined in globals.sh. Constant global variables must be declared (not defined) in each file that uses them - see src/globals.sh.
    • Shellcheck and shfmt must pass.
      • shellcheck is used on the strictest setting, -o all. So all variables have to be enclosed in speech marks and curly braces.
    • Using shellcheck in the IDE is necessary.
  • Speed improvement - a new single node cluster can be created in under 40 seconds. This used to take a few minutes. Workers take about 10 seconds each.
    Kubernetes component files are downloaded during image creation, rather than container creation, so they're only downloaded once, hence the speed improvement.
    Timings on my old laptop:
    • mokctl build image: 223.74s user 66.73s system 55% cpu 8:41.51 total
    • mokctl create k8sclust --masters 1: 1.71s user 1.84s system 9% cpu 37.687 total
      It used between 3 and 4 GB of disk space after a 'build' and 'create'.
  • Kubernetes the Hard Way (KTHW) for My Own Kind is finished.
    The KTHW documentation, screencasts and transcripts are created from a single file.
    The KTHW documentation is guaranteed to contain no typos.
    Send any PRs against the '.scr' files in /cmdline-player.
    See /docs/kthw-screencast-howto.md to build the screencasts yourself.
  • Load balancer gets set up now.
    Example: mokctl create cluster --with-lb 2 3, will create a 6 node cluster. One LB, 2 masters and 3 nodes.
    The kubeconfig in /var/tmp/admin.conf points at the load balancer.
    The load balancer is only for proxying to the master nodes from inside or outside of the cluster.
  • New images uploaded to docker hub.

What's not working

  • Installing different kubernetes versions. Only k8s v1.18.3 is installable right now.

Issues

  • Timing/race in run_wuth_progress. Occasionally it will fail. The tick will be yellow in this case so retry delete the cluster then retry the previous command.

Installation

See main repo README.md for installation instructions.

Thanks

Thanks to all those who provided feedback on Reddit, and to those who starred this project - Thank you!