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

Effective developer experience with Kubernetes

Effective developer experience with Kubernetes

Spiros Economakis

September 23, 2019
Tweet

More Decks by Spiros Economakis

Other Decks in Technology

Transcript

  1. What is Lenses? 2 Lenses is built to simplify monitoring,

    building, deploying and securing data flows by integrating with your existing data infrastructure such as Kafka and Kubernetes.
  2. Problems 6 Build + Package binary Manual testing Jenkins Limited

    number of envs (5) Shared infrastructure Bare metal
  3. Problem 1.0 - Limited envs 8 8 fix/user-management deploy deploy

    commit 1 QA QA Reserved shared test environment Engineer 1: Shout out, taking master env!!! Engineer 2: Shout out, taking master env!!! feature/policies commit 1 Εngineer 1: User management fix is not there, it’s broken again
  4. Problem 1.2 - Shared Infrastructure 10 Shared clusters were not

    clean Accidentally break other Developer’s configuration/data etc. Hard to run automated E2E tests
  5. “Solution 1.1” 11 docker-compose.yml .env files to run different cases

    Patch panel docker image to turn on/off services for their test cases Make available to the Developers a way to run their environment locally
  6. Problem 1.3 - Manual testing 13 Time consuming Error prone

    Release delays Shared infrastructure not flexible
  7. “Solution 1.2” 14 Build your own automated testing tool Coyote

    written in Go (available in Github) Developers will write Coyote tests Run them to the docker-compose.yml envs in Jenkins
  8. Problem 1.4 - Team grows fast 17 Again not enough

    environments Bare metal server lack of resources Needs for a branch deployment Needs developer’s and team’s isolated environments
  9. Solution 2.0 20 Provide on-demand isolated environments Branch deployments Environments

    per Developer and Teams Quickly and easily spin up multiple, independent environments by everyone:
  10. 21 Solution 2.0 The development or support process by the

    team The internal or external processes E2E tests Environments will spin up as needed during:
  11. 22 Build + package binary Automated E2E tests Jenkins Branch

    Deployment On-demand environments Solution 2.0
  12. 24 Solution 2.0 Build a tool to create K8 clusters

    easily by everyone - Zeus Leverage existing Helm charts Build our own tool for CI/CD in K8 - Tintin Environment: is a K8 namespace, along with services deployed in it by the provided branches. On-demand environment: A K8 namespace that will be created on-demand by everyone through Jenkins CI.
  13. K8 clusters - Zeus 25 Written in Go Supports every

    cloud provider (AWS, Google, Azure) Utilises Terraform but it’s an abstraction of it Zeus is a CLI tool & it is created by SRE team to create/destroy K8 clusters easily
  14. 27 # Create cluster with given yaml zeus k8 create

    -c .zeus.yaml # Destroy cluster with provided yaml zeus k8 destroy -c .zeus.yaml K8 clusters - Zeus
  15. Build 28 Build and Package binary Build container image with

    it Push to private container registry
  16. Deploy - Tintin 29 Written in Go Focuses on the

    world around Helm and CI/CD Tintin is a CLI tool & it is created by SRE team to manage environments in Kubernetes With Tintin an environment is a Kubernetes namespace with a set of Helm charts installed on it
  17. 30 services: - name: google/kafka version: 0.14.5 - name: google/cassandra

    version: 0.11.1 dependencies: - kafka - name: lenses/lenses version: 3.0.0 dependencies: - cassandra Deploy - Tintin
  18. 35 2019/09/22 21:34:11 Fetching repos defined 2019/09/22 21:34:16 The environment

    "test-env" is creating 2019/09/22 21:34:17 The namespace with "test-env" has been created 2019/09/22 21:34:17 The environment "test-env" is created 2019/09/22 21:34:17 checking current deployed releases 2019/09/22 21:34:18 calculating delta for releases 2019/09/22 21:34:18 deploying releases 2019/09/22 21:34:18 deploying chart kafka version 0.14.5 2019/09/22 21:34:27 deployed chart kafka version 0.14.5 2019/09/22 21:34:28 deploying chart cassandra version 0.11.1 2019/09/22 21:34:31 deployed chart cassandra version 0.11.1 2019/09/22 21:34:33 deployed environment "test-env Deploy - Tintin
  19. 36 NAME READY STATUS RESTARTS AGE cassandra-0 1/1 Running 0

    3m19s cassandra-1 0/1 Running 0 57s kafka-0 1/1 Running 1 3m23s kafka-1 1/1 Running 0 106s kafka-2 1/1 Running 0 57s test-env-kafka-zookeeper-0 1/1 Running 0 3m24s test-env-kafka-zookeeper-1 1/1 Running 0 3m3s test-env-kafka-zookeeper-2 1/1 Running 0 2m33s Deploy - Tintin
  20. Deploy - Jenkins Pipeline 37 Branch selection 1. UI 2.

    Backend Set your infrastructure preferences Easily re-deploy each part separately (UI, Backend) Flexible Jenkins pipeline to deploy your isolated environment with your preferences:
  21. Test 38 Use a more Developer friendly tool for automated

    E2E tests - cypress Leverage Tintin to create environments per each E2E test case
  22. Benefits 40 Unlimited environments No reservation by shouting No shared

    infrastructure, each team can have its own instrumentation Clean and flexible infrastructure, easier to run E2E test
  23. Drawbacks 41 Maintain/Monitor K8 cluster CI/CD is slow (docker build,

    push) Hard to debug by Developers Environments are not persistent Resources limitations Leftovers in your K8 cluster (docker images, forgotten envs)
  24. K8 tips 42 Keep your cluster clean 1. Delete test

    environments regularly in certain TTL 2. Clean up exited containers and remove images and volumes Use K8 auto-scale in cloud Set resource constraints and quotas User RBAC for fine-grained control
  25. Next steps 43 Persistent environments per team Developer deployments through

    a slack bot Smaller docker images to speed up deployment Tintin GitOps friendly - export environments configuration
  26. Lenses - Open source 44 Lenses CLI : Manage Kafka,

    CI/CD tasks for Lenses kafka-lenses-dev : Lenses, Kafka Broker, Schema Registry, Kafka Connect & Sample Data Stream reactor : Connectors to get data in & out of Apache Kafka Docker fast-data-dev : Kafka Docker for deployment Coyote : testing tool Zeus (soon) : K8 clusters creation for cloud providers Tintin (soon) : CI/CD tool for deploying K8 environments using Helm We have more, check https://github.com/Landoop