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

Developer Experience with Spring Boot on Kubernetes

Developer Experience with Spring Boot on Kubernetes

As a developer, working with Kubernetes too often leads to too much cognitive load, inefficient inner development loop, and friction in the path to production. This session is structured as a series of iterations on the developer experience to improve those three aspects and boost productivity.

In the cloud-native world, being a developer might be challenging. The number of technologies and patterns to know can be overwhelming. This session presents an approach based on open-source technologies and focuses on improving the inner development loop and continuous delivery on Kubernetes. The end goal is to deliver value continuously, quickly, and reliably.

First, I’ll present several techniques for working locally effectively and productively. Should you run Kubernetes in your development environment? I’ll cover a few different options. Using Spring Boot, we’ll build a cloud-native application following the principles of test-driven development. The inner development loop will be enhanced with Cloud Native Buildpacks, Tilt, Knative, and Telepresence.

Continuous integration is a crucial practice for continuous delivery. We’ll check in code regularly, triggering an automated process to build, test, and package the application. Do you use pull requests? Relying on ArgoCD and the GitOps principles, I’ll show you how to work with temporary environments created dynamically when a new pull request is opened.

Finally, we’ll use Cartographer to glue together all these different tools and design a golden path to production on Kubernetes, providing a clear separation of concerns and letting developers focus on delivering value.

Thomas Vitale

May 21, 2023
Tweet

More Decks by Thomas Vitale

Other Decks in Technology

Transcript

  1. Thomas Vitale
    Spring I/O
    May 19th, 2023
    Developer Experience
    With Spring Boot on Kubernetes
    @vitalethomas

    View Slide

  2. Systematic
    • Software Engineer and Cloud
    Architect.

    • Author of “Cloud Native Spring
    in Action” (Manning).

    • OSS contributor (Java, Spring,
    Cloud Native Technologies)
    Thomas Vitale
    thomasvitale.com @vitalethomas

    View Slide

  3. Problem
    @vitalethomas

    View Slide

  4. Value
    @vitalethomas

    View Slide

  5. Delivering Value
    From idea to production
    Developer
    Production
    Idea
    @vitalethomas
    ?

    View Slide

  6. Developer Experience
    @vitalethomas

    View Slide

  7. Developer Experience
    “…developer experience could be defined as a means for
    capturing how developers think and feel about their
    activities within their working environments,

    with the assumption that an improvement of the developer
    experience has positive impacts on characteristics such
    as sustained team and project performance.”

    (F. Fagerholm, J. Münch)
    Developer Experience: Concept and De
    fi
    nition
    (F. Fagerholm, J. Münch)
    @vitalethomas

    View Slide

  8. Developer Experience: Concept and De
    fi
    nition
    (F. Fagerholm, J. Münch)
    Developer Experience
    Conceptual Framework
    @vitalethomas

    View Slide

  9. Value
    @vitalethomas

    View Slide

  10. Developer Experience
    Tools are not enough
    ORGANIZATION
    PROCESSES
    TECHNOLOGY
    CULTURE
    @vitalethomas

    View Slide

  11. Technologies
    Developer experience with Java on Kubernetes
    @vitalethomas

    View Slide

  12. Team Topologies
    Organisational design for software
    @vitalethomas

    View Slide

  13. Continuous Delivery
    Better software faster
    @vitalethomas

    View Slide

  14. Goals
    2 Reduced cognitive load
    3 Clear and safe path to production
    1 Rapid and continuous feedback loop
    @vitalethomas

    View Slide

  15. Development Workflow
    @vitalethomas

    View Slide

  16. Cloud Native
    @vitalethomas

    View Slide

  17. From Traditional to Cloud Native
    Application Server, Embedded Server
    Runtime (JVM)
    Middleware (Application Server)
    Application (WAR/EAR)
    Runtime (JVM)
    Application (JAR)
    @vitalethomas

    View Slide

  18. Containers
    @vitalethomas

    View Slide

  19. Moving to Containers
    Application Server, Embedded Server, Container
    Runtime (OCI)
    Application (Container)
    Runtime (JVM)
    Middleware (Application Server)
    Application (WAR/EAR)
    Runtime (JVM)
    Application (JAR)
    @vitalethomas

    View Slide

  20. Dockerfiles
    “Dockerfiles are easy to write, but the current
    development guidelines do not produce
    containers that are repeatable and hardened.”

    CNCF Software Supply Chain Security Paper
    https://github.com/cncf/tag-security/tree/main/supply-chain-security
    @vitalethomas

    View Slide

  21. Cloud Native Buildpacks
    @vitalethomas

    View Slide

  22. Image
    pack build
    Cloud Native Buildpacks
    From source code to container image
    @vitalethomas

    View Slide

  23. Kubernetes
    @vitalethomas

    View Slide

  24. Moving to Kubernetes
    Application Server, Embedded Server, Container, Kubernetes
    Runtime (OCI)
    Middleware


    (Kubernetes)
    Application (Container)
    Runtime (JVM)
    Middleware


    (Application Server)
    Application (WAR/EAR)
    Runtime (JVM)
    Application (JAR)
    Runtime (OCI)
    Application (Container)
    @vitalethomas

    View Slide

  25. Working with Kubernetes
    Manifests for application deployment
    Deployment


    Deploy the application
    and con
    fi
    gure replication
    Service


    Expose the application
    from within the cluster
    @vitalethomas
    Ingress


    Expose the application
    from outside the cluster

    View Slide

  26. Tilt
    @vitalethomas

    View Slide

  27. Tilt
    Continuous development on Kubernetes
    @vitalethomas
    CODE
    BUILD
    RUN
    TEST
    Inner
    Development
    Loop

    View Slide

  28. Development Workflow
    Inner Loop and Outer Loop
    Inner Loop
    ‣Code


    ‣Build


    ‣Run


    ‣Test
    Outer Loop
    ‣CI/CD


    ‣Compliance, security


    ‣Con
    fi
    guration, monitoring


    ‣Production deployment
    git push
    @vitalethomas

    View Slide

  29. Inner Development Loop
    Code, build, test
    E
    ffi
    cient Inner Development Loops for Cloud Native Applications
    https://www.getambassador.io/resources/inner-dev-loop/
    @vitalethomas

    View Slide

  30. Skaffold
    @vitalethomas

    View Slide

  31. Skaffold
    Continuous development on Kubernetes
    @vitalethomas
    CODE
    BUILD
    RUN
    TEST
    Inner
    Development
    Loop

    View Slide

  32. Argo CD
    @vitalethomas

    View Slide

  33. Argo CD
    Continuous Deployment with GitOps
    @vitalethomas
    Developer
    App Repo
    Pull Request Sync changes
    Temporary
    Environment

    View Slide

  34. Knative
    @vitalethomas

    View Slide

  35. Knative
    Serverless experience on Kubernetes
    @vitalethomas

    View Slide

  36. Serverless Architectures
    Developers focus on code
    Focus on business logic
    Developer
    Platform
    Infrastructure

    Provisioning
    Workload

    Management
    Dynamic

    Scaling
    @vitalethomas

    View Slide

  37. Knative Serving
    Serverless Experience on Kubernetes
    Developer-friendly

    abstractions
    From image to URL
    Autoscaling

    Scaling to zero
    Progressive

    Rollouts
    Request-driven

    Event-driven
    Cloud agnostic
    @vitalethomas

    View Slide

  38. “Something a bit different than what today’s
    world is trying to offer - LESS tools!”

    @vitalethomas
    What does Developer Experience mean to you?

    View Slide

  39. Capabilities over responsibilities
    @vitalethomas

    View Slide

  40. Developer
    @vitalethomas

    View Slide

  41. Developer Platform
    @vitalethomas

    View Slide

  42. Developer Platform
    @vitalethomas

    View Slide

  43. Cartographer
    @vitalethomas

    View Slide

  44. Delivering Value
    From code to production
    Developer
    Production
    Application


    Operator
    Security


    Expert
    Platform


    Engineer
    @vitalethomas

    View Slide

  45. “Something a bit different than what today’s
    world is trying to offer - LESS tools!”

    @vitalethomas
    “Let developers be professionals and do what
    they do best. Let them be proud of their work!”

    What does Developer Experience mean to you?

    View Slide

  46. Kubernetes Native Choreographer
    Framework to build paved paths to production
    @vitalethomas

    View Slide

  47. Workload API
    Developer-friendly interface
    @vitalethomas
    apiVersion: carto.run/v1alpha1


    kind: Workload


    metadata:


    name: band-service


    labels:


    apps.kadras.io/workload-type: web


    spec:


    source:


    git:


    url: https://github.com/ThomasVitale/band-service


    ref:


    branch: main


    View Slide

  48. Watch


    Source Code
    Testing
    Build
    Con
    fi
    guration
    Deployment
    @vitalethomas

    View Slide

  49. cartographer.sh

    View Slide

  50. Goals
    2 Reduced cognitive load
    3 Clear and safe path to production
    1 Rapid and continuous feedback loop
    @vitalethomas

    View Slide

  51. Backstage
    @vitalethomas

    View Slide

  52. backstage.io

    View Slide

  53. DevPod
    @vitalethomas

    View Slide

  54. devpod.sh

    View Slide

  55. Resources
    @vitalethomas

    View Slide

  56. Resources
    • Presentation source code

    • Kadras: Cloud Native Platforms Toolkit

    • Cloud Native Buildpacks for ARM64

    • Software Supply Chain Choreography

    • Cartographer

    • Cartographer CLI

    • Knative and Spring: Bringing back the func

    • Tanzu Application Platform
    @vitalethomas

    View Slide

  57. https://github.com/ThomasVitale/awesome-spring

    View Slide

  58. Thomas Vitale
    Spring I/O
    May 19th, 2023
    Developer Experience
    With Spring Boot on Kubernetes
    @vitalethomas

    View Slide