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

Cloud Run CI/CD + QA @ KAUCHE

Yuki Ito
February 11, 2023

Cloud Run CI/CD + QA @ KAUCHE

Yuki Ito

February 11, 2023
Tweet

More Decks by Yuki Ito

Other Decks in Technology

Transcript

  1. Cloud Run CI/CD + QA @ KAUCHE
    Yuki Ito (@mrno110)
    Cloud Run Casual Talk #1

    View Slide

  2. Kauche


    Architect / Platform Team
    Yuki Ito


    @mrno110

    View Slide

  3. View Slide

  4. What is Cloud Run
    Cloud Run is a managed compute
    platform that enables you to run
    containers that are invocable via
    requests or events.


    Cloud Run is serverless: it abstracts
    away all infrastructure management...
    https://cloud.google.com/run/docs

    View Slide

  5. Agenda
    ɾCI / CD


    ɾQA

    View Slide

  6. Agenda
    ɾCI / CD


    ɾQA

    View Slide

  7. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  8. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  9. Workload Identity Federation
    https://cloud.google.com/blog/products/identity-security/enabling-keyless-authentication-from-github-actions

    View Slide

  10. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  11. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  12. 110y/cbtctl
    https://github.com/110y/cbtctl

    View Slide

  13. 110y/cbtctl
    https://github.com/110y/cbtctl

    View Slide

  14. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  15. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  16. Declarative Manifest
    apiVersion: serving.knative.dev/v1
    kind: Service
    metadata:
    annotations:
    run.googleapis.com/ingress: internal
    run.googleapis.com/launch-stage: BETA
    labels:
    cloud.googleapis.com/location: ...
    name: ...
    spec:
    template:
    metadata:
    annotations:
    run.googleapis.com/execution-environment: gen2
    run.googleapis.com/startup-cpu-boost: "true"
    run.googleapis.com/vpc-access-connector: projects/.../locations/.../connectors/...
    run.googleapis.com/vpc-access-egress: all-traffic
    # ...
    spec:
    containers:
    # ...
    serviceAccountName: ...

    View Slide

  17. kustomize
    .
    ├── base
    │ ├── kustomization.yaml
    │ └── service.yaml
    ├── dev
    │ ├── kustomization.yaml
    │ ├── resource.yaml
    │ └── service.yaml
    └── prod
    ├── kustomization.yaml
    ├── resource.yaml
    └── service.yaml

    View Slide

  18. CI / CD
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  19. Agenda
    ɾCI / CD


    ɾQA

    View Slide

  20. Agenda
    ɾCI / CD


    ɾQA

    View Slide

  21. Deploy Service per Branch
    Applications
    Deploy Manifests Cloud Build Cloud Run
    Cloud Build Artifact Registry
    ᶃ Trigger ᶄ Push Image
    ᶅ Trigger
    ᶆ Fetch ᶇ Deploy
    ᶈ Pull Image

    View Slide

  22. Deploy Service per Branch
    🧑💻
    Cloud Run Services
    Service-1-Branch-A Service-1-Branch-B
    Service-1
    Service-2-Branch-X Service-2-Branch-Y
    Service-2
    Gateway

    View Slide

  23. Deploy Service per Branch
    🧑💻
    Cloud Run Services
    Service-1-Branch-A Service-1-Branch-B
    Service-1
    Service-2-Branch-X Service-2-Branch-Y
    Service-2
    Gateway
    cloud-run-service-1: branch-b


    cloud-run-service-2: branch-x

    View Slide

  24. Deploy Service per Branch
    🧑💻
    Cloud Run Services
    Service-1-Branch-A Service-1-Branch-B
    Service-1
    Service-2-Branch-X Service-2-Branch-Y
    Service-2
    Gateway
    cloud-run-service-1: branch-b


    cloud-run-service-2: branch-x

    View Slide

  25. xDS Control Plane for Cloud Run
    xDS Control Plane
    Service-1-Branch-A Service-1-Branch-B
    Service-1
    Service-X
    Service Routing Information
    [default] → Service-1


    [cloud-run-service-1: branch-a] → Service-1-Branch-A


    [cloud-run-service-1: branch-b] → Service-1-Branch-B
    Service Discovery

    View Slide

  26. What is xDS...?
    Listener
    Cluster
    Endpoint Endpoint
    Cluster
    Endpoint Endpoint
    Route

    View Slide

  27. What is xDS...?
    0.0.0.0:5000
    Service-1
    10.28.1.11 10.28.1.12
    Service-2
    10.28.1.13 10.28.1.14
    Route
    Path: /service-1 Path: /service-2

    View Slide

  28. What is xDS...?
    Control Plane
    xDS API
    Cluster
    Route
    Listener

    View Slide

  29. x Discovery Service API
    •Listener Discovery Service


    •Route Discovery Service


    •Cluster Discovery Service


    •Endpoint Discovery Service

    View Slide

  30. xDS Control Plane for Cloud Run
    xDS Control Plane
    Service-1-Branch-A Service-1-Branch-B
    Service-1
    Service-X
    Service Routing Information
    [default] → Service-1


    [cloud-run-service-1: branch-a] → Service-1-Branch-A


    [cloud-run-service-1: branch-b] → Service-1-Branch-B
    Service Discovery

    View Slide

  31. Deploy Service per Branch
    🧑💻
    Cloud Run Services
    Service-1-Branch-A Service-1-Branch-B
    Service-1
    Service-2-Branch-X Service-2-Branch-Y
    Service-2
    Gateway
    cloud-run-service-1: branch-b


    cloud-run-service-2: branch-x

    View Slide

  32. Agenda
    ɾCI / CD


    ɾQA

    View Slide