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

A Paved Path to Production on Kubernetes

A Paved Path to Production on Kubernetes

Customers are looking forward to getting a new feature in our application. Developers implemented it and pushed the changes to Git. How can we go from code commit to feature available in production on Kubernetes? How can we do that in a productive and secure way?

Following the continuous delivery principles, I’ll show how to design a paved path to production with a superior experience for developers while giving operators enough flexibility and control. Using Cartographer, we’ll choreograph our way from code commit to deployment on Kubernetes and build a complete CI/CD pipeline.

We’ll then monitor Git repositories with Flux, containerize applications with Cloud Native Buildpacks, run automated tests with Tekton, scan images with Trivy, configure workloads with Carvel, and deploy them with Knative.

The presentation focuses on open source technologies and includes a hands-on demo you can run in your Kubernetes environments and use as a foundation for your real-world supply chains.

Thomas Vitale

March 23, 2023
Tweet

More Decks by Thomas Vitale

Other Decks in Technology

Transcript

  1. Thomas Vitale
    The Golden Path to SpringOne
    Mar 23rd, 2023
    A Paved Path to Production
    on Kubernetes
    @vitalethomas

    View full-size 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 full-size slide

  3. Problem
    @vitalethomas

    View full-size slide

  4. Value
    @vitalethomas

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  7. Development Workflow
    @vitalethomas

    View full-size slide

  8. Cloud Native
    @vitalethomas

    View full-size slide

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

    View full-size slide

  10. Containers
    @vitalethomas

    View full-size slide

  11. 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 full-size slide

  12. Cloud Native Buildpacks
    @vitalethomas

    View full-size slide

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

    View full-size slide

  14. Kubernetes
    @vitalethomas

    View full-size slide

  15. 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 full-size slide

  16. Tilt
    @vitalethomas

    View full-size slide

  17. Tilt
    Continuous development on Kubernetes
    @vitalethomas
    CODE
    BUILD
    RUN
    TEST

    View full-size slide

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

    View full-size slide

  19. CI/CD Pipeline(s)
    @vitalethomas

    View full-size slide

  20. CI/CD Pipeline (Imperative)
    Check out


    source code
    Build


    container image
    Con
    fi
    gure


    workload
    Deploy


    workload
    Orchestrator
    Tightly coupled
    Rigid system
    No clear separation of concerns
    Hard to maintain
    @vitalethomas

    View full-size slide

  21. Delivering Value
    From code to production
    Developer
    Production
    Application


    Operator
    Security


    Expert
    Platform


    Engineer
    @vitalethomas

    View full-size slide

  22. Check out


    source code
    Build


    container image
    Con
    fi
    gure


    workload
    Deploy


    workload
    @vitalethomas

    View full-size slide

  23. Check out


    source code
    Build


    container image
    Con
    fi
    gure


    workload
    Deploy


    workload
    Kubernetes
    Manifests
    GitOps
    @vitalethomas

    View full-size slide

  24. Check out


    source code
    Build


    container image
    Con
    fi
    gure


    workload
    Deploy


    workload
    Kubernetes
    Manifests
    Container
    Image

    View full-size slide

  25. Check out


    source code
    Build


    container image
    Con
    fi
    gure


    workload
    Deploy


    workload
    Kubernetes
    Manifests
    Container
    Image
    Source
    Code
    CI/CD Pipeline (Reactive)
    Loosely coupled
    Separation of concerns
    Flexible
    Consistent path to production

    View full-size slide

  26. Check out


    source code
    Build


    container image
    Con
    fi
    gure


    workload
    Deploy


    workload
    Kubernetes
    Manifests
    Container
    Image
    Source
    Code
    CI/CD Pipeline (Reactive)
    Loosely coupled
    Separation of concerns
    Flexible
    Consistent path to production

    View full-size slide

  27. Cartographer
    @vitalethomas

    View full-size slide

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

    View full-size slide

  29. 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 full-size slide

  30. Watch


    Source Code
    Testing
    Build
    Con
    fi
    guration
    Deployment

    View full-size slide

  31. https://landscape.cncf.io

    View full-size slide

  32. SupplyChain API
    Describes the path to production
    @vitalethomas
    apiVersion: carto.run/v1alpha1


    kind: ClusterSupplyChain


    metadata:


    name: supply-chain


    spec:


    selector:


    apps.kadras.io/workload-type: web


    resources:


    - name: source-provider


    templateRef:


    kind: ClusterSourceTemplate


    name: source


    - name: image-builder


    templateRef:


    kind: ClusterImageTemplate


    name: image


    sources:


    - resource: source-provider


    name: source


    - name: deployer


    templateRef:


    kind: ClusterTemplate


    name: app-deploy


    images:


    - resource: image-builder


    name: image

    View full-size slide

  33. cartographer.sh

    View full-size slide

  34. Watch


    Source Code
    Testing
    Build
    Con
    fi
    guration
    Deployment

    View full-size slide

  35. @vitalethomas
    apiVersion: source.toolkit.fluxcd.io/v1


    kind: GitRepository


    metadata:


    name: band-service


    spec:


    interval: 1m0s


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


    ref:


    branch: main


    View full-size slide

  36. @vitalethomas
    apiVersion: source.toolkit.fluxcd.io/v1


    kind: GitRepository


    metadata:


    name: $(workload.metadata.name)$


    spec:


    interval: 1m0s


    url: $(workload.spec.source.git.url)$


    ref: $(workload.spec.source.git.ref)$


    View full-size slide

  37. @vitalethomas
    apiVersion: carto.run/v1alpha1


    kind: ClusterSourceTemplate


    metadata:


    name: source


    spec:


    urlPath: .status.artifact.url


    revisionPath: .status.artifact.revision


    template:


    apiVersion: source.toolkit.fluxcd.io/v1


    kind: GitRepository


    metadata:


    name: $(workload.metadata.name)$


    spec:


    interval: 1m0s


    url: $(workload.spec.source.git.url)$


    ref: $(workload.spec.source.git.ref)$

    View full-size slide

  38. @vitalethomas
    apiVersion: carto.run/v1alpha1


    kind: ClusterSourceTemplate


    metadata:


    name: source


    spec:


    urlPath: .status.artifact.url


    revisionPath: .status.artifact.revision


    template:


    apiVersion: source.toolkit.fluxcd.io/v1


    kind: GitRepository


    metadata:


    name: $(workload.metadata.name)$


    spec:


    interval: 1m0s


    url: $(workload.spec.source.git.url)$


    ref: $(workload.spec.source.git.ref)$
    Template API
    Supply chain activities

    View full-size slide

  39. Capabilities over responsibilities
    @vitalethomas

    View full-size slide

  40. Developer
    @vitalethomas

    View full-size slide

  41. Developer Platform
    @vitalethomas

    View full-size slide

  42. Developer Platform
    @vitalethomas

    View full-size slide

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

    View full-size slide

  44. Resources
    @vitalethomas

    View full-size slide

  45. Resources
    Source code
    • Presentation source code

    • Kadras: Cloud Native Platforms Toolkit

    • Cloud Native Buildpacks for ARM64

    • Software Supply Chain Choreography

    • Cartographer

    • Cartographer CLI

    • Tanzu Application Platform
    @vitalethomas

    View full-size slide

  46. Thomas Vitale
    The Golden Path to SpringOne
    Mar 23rd, 2023
    A Paved Path to Production
    on Kubernetes
    thomasvitale.com
    @vitalethomas
    @[email protected]

    View full-size slide