Writing Tools in Go For Ops Engineers

Writing Tools in Go For Ops Engineers

A658ec7f1badf73819dfa501165016c1?s=128

Yuuki Tsubouchi (yuuk1)

February 18, 2016
Tweet

Transcript

  1. 7.

    mkr • For programable server operations with Mackerel • JSON

    output (Enable to parse with jq) • Depends on mackerelio/mackerel- client-go • More useful on server (No need to pass an API Key)
  2. 9.

    Grabeni • Help a failover tool (Keepalived/ MHA) switch a

    VIP • Depends on aws/aws-sdk-go • AWS API Retry/Max Attempts HSBCFOJHSBCFOJYYYYYYYYY
  3. 12.

    Droot • chroot an extracted archive from Docker images •

    Pull an archive from AWS S3 • Atomic deploy with symlink and rename(2) • `docker export | s3 upload` by io.Pipe()
  4. 15.

    gokc • Keepalived (well known with LVS) • Replace maoe/kc

    written in Haskell (Parser combinator) • Parser with yacc • Lexer with goroutine and channel
  5. 21.
  6. 23.

    Quick Development on Server • GOOS=linux GOARCH=amd64 (or build on

    Docker) • scp ./binary [remote server] • ./binary
  7. 24.

    Quick Development on Server • One binary & Cross compile

    • My ops tools aim to run on Linux servers. • ex. droot runs on Linux only
  8. 26.

    • Not mean that coding is just quick • Mean

    that no hesitation about coding because Go has the simple language specification Quick deployment
  9. 27.

    Others • Concurrency by goroutine • `io.Pipe()` • Fast runtime

    rather than LL • Error handing by returning error type • `defer` statement • Easy to clear temp resources on failure
  10. 28.

    Summary • Pros of Go for ops engineers • Easy

    binary distribution • Quick development on server • Quick deployment as a result