Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

Kauche Architect / Platform Team Yuki Ito @mrno110

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

Agenda ɾCI / CD ɾQA

Slide 6

Slide 6 text

Agenda ɾCI / CD ɾQA

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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: ...

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

Agenda ɾCI / CD ɾQA

Slide 20

Slide 20 text

Agenda ɾCI / CD ɾQA

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

x Discovery Service API •Listener Discovery Service •Route Discovery Service •Cluster Discovery Service •Endpoint Discovery Service

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

Agenda ɾCI / CD ɾQA