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

Containerizing Teamleader

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for Yorick Yorick
March 20, 2018

Containerizing Teamleader

Our story in moving to a containerized Teamleader infrastructure (https://www.teamleader.eu). From the past to the future. Presented at the Ghent Kubernetes Meetup @ our office

Avatar for Yorick

Yorick

March 20, 2018

Other Decks in Technology

Transcript

  1. What will this talk be about? ➔ The team ➔

    The operations story ➔ CI/CD Pipeline (Concourse) ➔ K8s Package Manager (Helm)
  2. ➔ Yorick Horrie - 28 years old ➔ Cloud engineer

    / Devops engineer ➔ @teamleader Aug 2015 ➔ Ops guy for +1 year ➔ Twitter: @yorickh About me
  3. Belgium – Ghent The Netherlands – Amsterdam Germany – Berlin

    France – Paris Spain – Madrid ALL OVER EUROPE Italy – Milan
  4. TIMELINE July 2012 May 2014 July 2014 Teamleader takes its

    first steps into the world 1st investment of 1M Teamleader app Expansion to The Netherlands November 2014 May 2015 2nd investment of 2.5M November 2015 Expansion to Germany Teamleader rebranded & redesigned February 2016 Tech Startup Award March 2016 New office Ghent Expansion to Spain July 2016 November 2016 3rd investment of 10M May 2017 Launch of the Teamleader Marketplace July 2017 Teamleader hires its 150th employee Expansion to Italy June 2017 October 2017 July 2017 Over 6000 SMEs work with Teamleader Expansion to France
  5. Teamleader’s architecture 2017 Q1 Core application Web application - User

    interface Outlook plugin Mobile app DB (M) DB (S) Webhooks server Document Processing Chrome extension Cloud Platforms API External applications
  6. TO

  7. Teamleader’s architecture goal core application Outlook plugin Webhooks server PDF

    rendering Chrome extension Cloud Platforms External applications public API - API gate-wa y Web application - User interface New mobile app message bus Project planning API Marketplace Oauth API backoffice API Timetracking API Calendar API Mail sending CRM API Deal flows API Quotations API Invoices API Subscriptions API Notifications Search Templating ... ...
  8. Concourse CI ➔ Written by and for Pivotal Cloud Foundry

    ➔ Open source ➔ YAML (Config as code!) ➔ Scalable infrastructure
  9. Concepts Resource: Any entity that can be checked for new

    versions, pulled down at a specific version, and/or pushed up to create new versions. Task: Execution of a script in an isolated environment with dependent resources available to it Job: Describes some actions to perform when dependent resources change Pipeline: Composition of Task - Resource - Job
  10. RESOURCES RESOURCES RESOURCES JOBS PIPELINE RESOURCES: Default: Git, S3, Semver,

    Docker-image, … Community: Slack, Kubernetes, Helm, Telegram, Email,... (75 in the current docs) Adding your own resources: Implementing a resource
  11. PROS: ➔ Container oriented ➔ Configuration as code ➔ Visual

    CONS: ➔ Container oriented (not everything runs in containers, dind) ➔ Still growing, but has an active community ➔ UI can be slow (with a lot of logs) Pros and cons
  12. What’s next? ➔ More team engagement (managing own pipelines and

    tasks) ➔ Better secret management (centralized vault) ➔ Self updating pipelines
  13. K8s Deployment Challenges Move to microservice architecture: ➔ Application consists

    from multiple components ➔ Each component has its own resources and can be scaled individually It’s hard to … ➔ … manage, edit and update multiple K8s configurations ➔ … deploy multiple K8s configuration as a SINGLE application ➔ … share and reuse K8s configurations and applications ➔ … parametrize and support multiple environments ➔ … manage application releases: rollout, rollback, diff, history ➔ … define deployment lifecycle (control operations to be run in different phases) ➔ … validate release state after deployment
  14. What is Helm? Helm is a tool for managing Kubernetes

    charts. Charts are packages of pre-configured Kubernetes resources.
  15. What is Helm? Helm is a Package Manager for Kubernetes:

    ➔ Package multiple K8s resources into a single logical deployment unit: Chart Helm is a Deployment Management for Kubernetes: ➔ Do a repeatable deployment ➔ Management dependencies: reuse and share ➔ Manage multiple configurations ➔ Update, rollback and test application deployments: Releases
  16. Concepts Chart: Package/bundle of Kubernetes resources Release: Chart instance is

    loaded into Kubernetes Same chart can be installed several times into the same cluster; each will have it’s own R elease Repository: Repository of published Charts Template: K8s configuration file mixed with Go/Sprig template Tiller: Server side component which manages releases of your charts
  17. Helm ➔ Helm was jointly started by Google and Deis

    ➔ Helm is a Kubernetes project now (managed by CNCF) ➔ Active community: Google, Microsoft, Bitnami, … ➔ kubeapps.com - curated list (repository) of Helm Charts ➔ Works with any K8s cluster
  18. Templates ➔ Go Template language: {{.foo | quote}} ➔ Variables,

    simple control structures (loops, conditionals, nesting) ➔ Pipelines: chain together templates functions ➔ 50+ functions from Go/Sprig Template libraries - date, string, conversions, encoding, reflection, data structures, math, crypto, semver
  19. Chart.yml name: The name of the chart ( required) version:

    A SemVer 2 version ( required) description: A single-sentence description of this project (optional) keywords: - A list of keywords about this project (optional) home: The URL of this project's home page (optional) sources: - A list of URLs to source code for this project (optional) maintainers: # (optional) - name: The maintainer's name (required for each maintainer) email: The maintainer's email (optional for each maintainer) url: A URL for the maintainer (optional for each maintainer) engine: gotpl # The name of the template engine (optional, defaults to gotpl) icon: A URL to an SVG or PNG image to be used as an icon (optional). appVersion: The version of the app that this contains (optional). This needn't be SemVer. deprecated: Whether this chart is deprecated (optional, boolean) tillerVersion: The version of Tiller that this chart requires. This should be expressed as a SemVer range: ">2.0.0" (optional)
  20. values.yml ➔ Specify default values that should be injected into

    templates ➔ Each chart can have its own values file ➔ Can use multiple Values files ➔ Can override individual value for install/update
  21. Dependencies Defined through requirments.yaml or into the charts/ directory dependencies:

    - name: apache version: 1.2.3 repository: http://example.com/charts - name: mysql version: 3.2.1 repository: http://another.example.com/charts
  22. Dependencies Running helm dependency update will use your dependency file

    to download all the specific charts into the charts/ directory charts/ apache-1.2.3.tgz mysql-3.2.1.tgz
  23. Installing a Chart $ helm install <chart> API SERVER <<Pod>>

    Tiller <<Service>> chart <<Deployment>> chart <<Secrets>> chart <<Configmap>> chart Release [
  24. Upgrading a Chart $ helm upgrade <release>\<chart> API SERVER <<Pod>>

    Tiller <<Service>> chart <<Deployment>> chart <<Secrets>> chart <<Configmap>> chart
  25. Helm Hooks Helm provides a hook mechanism to allow chart

    developers to intervene at certain points in a release's life cycle (pre-install, post-install, pre-delete, pre-rollback, …) ➔ Load a ConfigMap or Secret during install before any other charts are loaded. ➔ Execute a Job to back up a database before installing a new chart, and then execute a second job after the upgrade in order to restore data. ➔ Run a Job before deleting a release to gracefully take a service out of rotation before removing it.
  26. What’s next? ➔ More team engagement (managing and owning own

    charts) ➔ Optimized charts (more logic/loops) ➔ More sharing between charts (sub-charts) ➔ Using helm hooks & sub-charts