Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a scalable learning platform

Building a scalable learning platform

Behind the scenes of how we built a scalable learning platform on Google Cloud Platform, with Terraform and Kubernetes.

Erik Veld

May 08, 2018
Tweet

More Decks by Erik Veld

Other Decks in Technology

Transcript

  1. HOW IT STARTED 17 2016 2017 2018 HashiConf EU HashiConf

    US Google Cloud Next Current iteration instruqt
  2. GOOGLE CLOUD PLATFORM 23 more Container Registry Datastore Kubernetes Engine

    Cloud SQL Cloud PubSub Cloud Storage Compute Engine Cloud Functions Firebase instruqt
  3. GOOGLE CLOUD PLATFORM 24 more Container Registry Datastore Kubernetes Engine

    Cloud SQL Cloud PubSub Cloud Storage Compute Engine Cloud Functions Firebase instruqt
  4. GOOGLE CLOUD PLATFORM 25 more Container Registry Datastore Kubernetes Engine

    Cloud SQL Cloud PubSub Cloud Storage Compute Engine Cloud Functions Firebase instruqt
  5. GOLANG 28 With the small footprint and fast start time

    we scale in seconds not minutes. instruqt
  6. BEHIND THE SCENES 34 > PODS SERVICES CONFIG SECRETS PROXY

    TRACK NAMESPACE OTHER INFRA instruqt
  7. # The volume is mounted in the pod from a

    git repository. volume { name = "bootstrap" git_repo { repository = "https://url-to-git-repo/bootstrap.git" } } volume_mount { name = "bootstrap" mount_path = "/opt/bootstrap" } # Wait until the volume is mounted, then execute the setup script. args = ["until [ -d /opt/bootstrap/ ]; do sleep 1; done; /opt/bootstrap/setup.sh"] 36 instruqt
  8. The SDK creates a skeleton, which is then filled out

    and sent to the pipeline. TRACK PIPELINE 40 instruqt
  9. # The variables that need to go into the template.

    data := struct { Containers Container }{ … } # Create the destination file. f, err := os.Create(outputPath) # Parse the templates. t := template.New(templateName) _, err = t.ParseFiles(inputPath) # Execute the template with the data. for _, tmpl := range t.Templates() { tmpl.ExecuteTemplate(f, tmpl.Name(), data) } 43 instruqt
  10. # Loop over the containers in the config.yml file. {{range

    .Containers}} resource "kubernetes_replication_controller" "{{.Name}}" { spec { template { container { name = "{{.Name}}" image = "{{.Image}}" } # Etc. } } } {{- end}} 44 instruqt
  11. Because of Container Builder we do not have to run

    a build server anymore. TRACK PIPELINE 46 instruqt
  12. The platform and build pipeline are scalable. The challenge is

    scaling ourselves. LESSONS LEARNED 48 instruqt
  13. Stand on the shoulders of giants and use this to

    focus on your product. 49 LESSONS LEARNED instruqt
  14. Migrating to a different cloud provider is not as much

    work as you might think. LESSONS LEARNED 50 instruqt