Building a Kubernetes Powered Central Go Modules Repository

A presentation at Docker NYC Meetup May 2019 in May 2019 in New York, NY, USA by Baruch Sadogursky

Slide 1

Slide 1

Go, go, kubernetes Building a Kubernetes Powered Central Go Modules Repository

Slide 2

Slide 2

Let’s go on a trip through history @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 3

Slide 3

A quick history of go Go 1.8 Introduction of Go plugins Go 1.0 Go 1.10 First major milestone as a long term stable release Changes to the toolchain, runtime, and libs Go 1.5 First release to no longer use C (except for cgo) Support for Vendoring 2012 2015 @jbaruch 2017 | jfrog.com/shownotes | gocenter.io 2018

Slide 4

Slide 4

One thing missing Dependency Management… @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 5

Slide 5

“Tis impossible to be sure of anything but Death and Taxes” - Christopher Bullock @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 6

Slide 6

A quick history of go Go 1.8 Introduction of Go plugins Go 1.0 Go 1.10 First major milestone as a long term stable release Changes to the toolchain, runtime, and libs Go 1.5 Go 1.11 First release to no longer use C (except for cgo) Go Modules! Support for Vendoring 2012 2015 2017 @jbaruch | jfrog.com/shownotes 2018 | gocenter.io 2018

Slide 7

Slide 7

So, what are modules? Official Dependency Management No more GOPATH @jbaruch | jfrog.com/shownotes | In one single tool gocenter.io

Slide 8

Slide 8

Vendoring is a really, really bad idea But why not use vendoring? @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 9

Slide 9

Forking is not always good, bad forking is always bad And that’s what vendoring is @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 10

Slide 10

In software Immutable and repeatable are really important Immutable dependencies The best way to guarantee issues is force push Lost Dependencies Who doesn’t remember left-pad with Node.js? Trust Do you trust your colleagues? What about the rest of the Internet? @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 11

Slide 11

Who am i? • Head of Developer Relations • Chief Sticker Officer Baruch Sadogursky, Chief Sticker Officer @jbaruch @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 12

Slide 12

shownotes Slides Video Links Comments Ratings Raffle! https://jfrog.com/shownotes @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 13

Slide 13

#1 What is gocenter actually? @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 14

Slide 14

What is gocenter actually? @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 15

Slide 15

#2 How we got to kubernetes @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 16

Slide 16

Why did we choose kubernetes? • Make use of a proven orchestration platform • Leverage out-of-thebox features @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 17

Slide 17

Running on google cloud platform Most mature Kubernetes offering Easy to deploy using existing tools and techniques @jbaruch | jfrog.com/shownotes | Lots of troubleshooting tools like BigQuery and StackDriver gocenter.io

Slide 18

Slide 18

Who needs state anyway? 1. 2. 3. 4. 5. 6. 7. Port binding 8. Concurrency 9. Disposability 10. Dev/Prod parity 11. Logs 12. Admin processes Codebase Dependencies Config Backing services Build, release, run Processes @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 19

Slide 19

But we didn’t build everything ourselves @jbaruch | jfrog.com/shownotes | gocenter.io Dependencies

Slide 20

Slide 20

Deployments using helm • Helm Charts are versioned • Separate value files per environment • Having one of the cofounders of Helm at our company also doesn’t hurt @jbaruch | jfrog.com/shownotes | gocenter.io Config

Slide 21

Slide 21

Some best practices we learned while building Limits & Labels Namespaces & Clusters Secrets @jbaruch | jfrog.com/shownotes | gocenter.io Portbinding, Concurrency & Disposability

Slide 22

Slide 22

#3 How we built our infrastructure @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 23

Slide 23

We’re big on those pipelines and promotions concepts If quality requirments are hit CI SERVER 1 If quality requirments are hit 2 Integration If quality requirments are hit 3 System Testing 4 Staging Production *

  • Quality gates - @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 24

Slide 24

Number of clusters currently running @jbaruch | 5 jfrog.com/shownotes | gocenter.io Dev/Prod Parity

Slide 25

Slide 25

Running a few microservices Discovery Notifier @jbaruch | jfrog.com/shownotes Processor | gocenter.io

Slide 26

Slide 26

Running a few microservices Validator UI Backend @jbaruch | jfrog.com/shownotes UI | gocenter.io

Slide 27

Slide 27

This is what our cluster looks like @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 28

Slide 28

Load testing • UI: 10K users with 100 requests per second • Backend: Load 10K modules… twice @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 29

Slide 29

Chaos engineering for the poor @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 30

Slide 30

#4 Running at scale @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 31

Slide 31

Node pools, cause even nodes have to relax? @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 32

Slide 32

Deployments using helm https://hub.helm.sh @jbaruch | jfrog.com/shownotes | gocenter.io Build, release, run

Slide 33

Slide 33

Keeping a close eye on container health • FluentD • Prometheus • Grafana Live Dashboard @jbaruch | jfrog.com/shownotes | gocenter.io Logs

Slide 34

Slide 34

Sometimes it’s good to bring a friend along @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 35

Slide 35

We keep in touch with our nodes Kube-Slack Jenkins @jbaruch | jfrog.com/shownotes | gocenter.io Logs & Build, release, run

Slide 36

Slide 36

Scaling on many levels Node Compute Provision nodes when needed Run more microservices Messaging Up and Down Scaling based on queue depth What goes up must come down… usually @jbaruch | jfrog.com/shownotes | gocenter.io Concurrency

Slide 37

Slide 37

#5 Dare to dream @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 38

Slide 38

What’s next for gocenter ChatOps Use Slack to let teams take more control In-Cluster Artifactory Making upgrades more seamless, but… Smart dependency selection Ratings, filters, etc @jbaruch | jfrog.com/shownotes | gocenter.io

Slide 39

Slide 39

Twitter ads and Q&A jfrog.com/ shownotes @jbaruch @jbaruch | jfrog.com/shownotes gocenter.io | gocenter.io