SlideShare a Scribd company logo
CloudRun:theriseofserverless
andcontainerization
Istanbul December, 2022
Márton Kodok
Google Developer Expert at REEA.net
1. What is Serverless? What are Serverless pain points?
2. Cloud Run: Bringing serverless to containers
3. Build + run
4. Mitigating cold starts
5. Advanced examples
6. Integrating DockerSlim on Cloud Build
7. Conclusions
Agenda
Cloud Run: the rise of serverless and containerization @martonkodok
● Among the Top 3 romanians on Stackoverflow 201k reputation
● Google Developer Expert on Cloud technologies (2016→)
● Champion of Google Cloud Innovators program (2021→)
● Crafting Web/Mobile backends at REEA.net
Articles: martonkodok.medium.com
Twitter: @martonkodok
Slideshare: martonkodok
StackOverflow: pentium10
GitHub: pentium10
Cloud Run: the rise of serverless and containerization @martonkodok
About me
Once upon a time
Google Cloud
Functions
AWS
Lambda
Azure
Functions
What is Serverless in the Functionsperspective
Cloud Run: the rise of serverless and containerization @martonkodok
Operational
Model
Programming
Model
No Infra Management Managed Security Pay only for usage
Function-based Event-driven Closed
Cloud Run
Bringing serverless to containers
Containers
Cloud Run: the rise of serverless and containerization @martonkodok
.js .rb .go
.py .sh …
0 1 0
1 0 0
1 1 1
Any language
Any Library
Any Binary
Ecosystem of base images
What is Serverless in the CloudRun perspective
Cloud Run: the rise of serverless and containerization @martonkodok
Operational
Model
Programming
Model
No Infra Management Managed Security Pay only for usage
Event-driven Closed
Function-based
Containerized App-service-driven Open
Serverless pain points
Cloud Run: Pay-per-use
Cloud Run: the rise of serverless and containerization @martonkodok
CPU / Memory / Requests 100ms
Cloud Run: Pay-per-use
Cloud Run: the rise of serverless and containerization @martonkodok
Cloud Run Managed: Pricing
Cloud Run: the rise of serverless and containerization @martonkodok
@martonkodok
Code,
build & run
Part 1
Getting started
Cloud Run: the rise of serverless and containerization Image courtesy of @wietsevenema
1. Code (use your entire repo, not just a function)
2. Package (Dockerfile or build-packs)
3. Build image (leverage CloudBuild)
4. Deploy
5. Run + Monitor
ChatGPT: create a Python Dockerfile
Cloud Run: the rise of serverless and containerization @martonkodok
Build -> Container Image -> Store -> deploy - > Run
Cloud Run: the rise of serverless and containerization
Submit + Build
Cloud Run: the rise of serverless and containerization @martonkodok
Folder Structure
Cloud Run: the rise of serverless and containerization @martonkodok
cloudbuild.yaml
SSL offered out-of-the box + Monitoring Charts
Cloud Run: the rise of serverless and containerization @martonkodok
@martonkodok
What about
“cold starts”?
Part #2
1. Use a leaner base image (alpine, distroless, scratch for statically linked binary)
Mitigating cold starts
Cloud Run: the rise of serverless and containerization @martonkodok
1. Use a leaner base image (alpine, distroless, scratch for statically linked binary)
2. Startup CPU-boost
Mitigating cold starts
Cloud Run: the rise of serverless and containerization @martonkodok
gcloud beta run services update SERVICE --cpu-boost
gcloud beta run deploy --image IMAGE_URL --cpu-boost
Startup CPU-boost
Cloud Run: the rise of serverless and containerization @martonkodok
CLI
1. Use a leaner base image (alpine, distroless, scratch for statically linked binary)
2. Startup CPU-boost
Mitigating cold starts
Cloud Run: the rise of serverless and containerization @martonkodok
3. Cloud Run: Minimum instances
1. Use a leaner base image (alpine, distroless, scratch for statically linked binary)
2. Startup CPU-boost
Mitigating cold starts
Cloud Run: the rise of serverless and containerization @martonkodok
3. Cloud Run: Minimum instances
4. Always-on CPU
Costs: 10times less than regular price
gcloud beta run services update SERVICE --min-instances MIN-VALUE --no-cpu-throttling
gcloud beta run deploy --image IMAGE_URL --min-instances MIN-VALUE --no-cpu-throttling
Minimum Instances & Always On CPU
Cloud Run: the rise of serverless and containerization @martonkodok
CLI
UI
Always On CPU Billing
Cloud Run: the rise of serverless and containerization @martonkodok
Part #3
Autoscaling
1. When no requests, scales down to 0. (costs savings)
2. Each service can scale by default to 1000 container instances (auto decreases by instance type)
3. Each container instance can handle up to 1000 simultaneous requests (!YAY websockets)
Note: 1000*1000 => 1M simultaneous requests
Autoscaling
Cloud Run: the rise of serverless and containerization @martonkodok
1. FaaS frameworks have fixed concurrency of 1
2. Cloud Run enables you to set concurrency (default 80, can be increased up to 250)
3. Risks! How a free trial experiment ended with a $72,000 bill overnight.
Concurrency
Cloud Run: the rise of serverless and containerization @martonkodok
Common errors:
➔ Uncontrolled retries, Loops (failing tests, missing backoff)
➔ Unwanted traffic (consider using Identity-Aware Proxy, Cloud Endpoint Service)
➔ Reduce concurrency
➔ DDOS (consider using Cloud-Armor, Load Balancer)
Cloud Run: Concurrency case study
Cloud Run: the rise of serverless and containerization @martonkodok
Concurrency=1 Clients: 400
Request=3
Concurrency=80 Clients: 400 Request=3
520
instances
150
instances
Afternoon talk
Cloud Run: the rise of serverless and containerization @martonkodok
Part #4
King of
serverless
compute?
Next topics to be covered
Cloud Run: the rise of serverless and containerization @martonkodok
1. Traffic Controls
2. Security
3. Health checks
4. Session affinity
5. SLOs
6. 2nd gen environment
(disk support)
Cloud Run: King of Serverless Compute?
Cloud Run: the rise of serverless and containerization @martonkodok
Serverless tools don’t provide canary deployments (subset of traffic)
Allow traffic controls across revisions of a service
Label your revisions for gradual-rollout-strategy (--no-traffic, candidate, latest)
Eg: resulting an automated way to gradually roll out new versions of your Cloud Run services
1/Traffic Controls
Cloud Run: King of Serverless Compute?
Cloud Run: the rise of serverless and containerization @martonkodok
Mount secrets from Secret Manager
Binary Authorization for Cloud Run
CMEK - customer-managed encryption keys. (for regulated industries like financial services)
Eg: resulting increased security
2/Security
Cloud Run: King of Serverless Compute?
Cloud Run: the rise of serverless and containerization @martonkodok
Configure startupprobes
Configure an HTTP livenessprobe
can configure HTTP, TCP, and gRPC probes
Eg: to determine when a container has started and is ready to accept traffic
3/Container health checks
Cloud Run: King of Serverless Compute?
Cloud Run: the rise of serverless and containerization @martonkodok
Configure startupprobes
Configure an HTTP livenessprobe
can configure HTTP, TCP, and gRPC probes
Eg: to determine when a container has started and is ready to accept traffic
3/Container health checks
Cloud Run: King of Serverless Compute?
Cloud Run: the rise of serverless and containerization @martonkodok
Session affinity
SLOs (service level objectives)
2nd generation environments (ability to use mounted disk )
Eg: 2nd gen enables network file systems such as NFS, NDB, 9P, CIFS/Samba, and Ceph, as well as Cloud Filestore
4/More recent additions
Practical use cases
External HTTPs Load Balancer
Cloud Run: the rise of serverless and containerization @martonkodok
Multi-Region Load Balancing with Cloud Run
Cloud Run: the rise of serverless and containerization @martonkodok
Integrating
docker-slim
Bonus
1. Use a leaner base image (alpine, distroless, scratch for statically linked binary)
2. Startup CPU-boost
Mitigating cold starts + BONUS
Cloud Run: the rise of serverless and containerization @martonkodok
3. Cloud Run: Minimum instances
4. Always-on CPU
5. DockerSlim (minifier, reduce a fat container to slim, more secure as reduces the available attack surface)
- is a command line tool
- provides a set of commands (build, xray, lint)
- to reduce the size and optimize your containers.
1. Minify a fat container (reduces the container size)
2. Run a probe to touch all “used”parts
Use DockerSlimas container minifier
Cloud Run: the rise of serverless and containerization @martonkodok
3. Make it more secure (reduces the available attack surface)
4. Faster cold starts
5. Less costs on container build and storage
Note: Good for HTTP based apps. Node.js, Python, Ruby, Java, Golang, Rust, Elixir, and PHP
cmd=build info=results by='5.21X' size.original='413 MB' size.optimized='79 MB' status='MINIFIED'
Cloud Build example integration for DockerSlim minify
@martonkodok
Article: Integrating DockerSlim on Cloud Build
@martonkodok
https://bit.ly/3iOAShM
Conclusion
Cloud Run: the rise of serverless and containerization @martonkodok
1. Simple developer friendly CLI to quickly deploy/manage services without sysadmins
2. Integration with CloudCode, CloudBuildand for continuousdeployments
3. Fast autoscaling - out-of-the-box scaledowntozero
4. HTTPS URLs - out-of-the-box stable HTTPS endpoint - customdomains
5. Enables invocation by HTTP/2, WebSockets and gRPC
6. 2nd gen environment - enables file file storage access natively + but slower cold starts
Enhanced developer experience
Cloud Run: the rise of serverless and containerization @martonkodok
Thank you.
Slides available on:
slideshare.net/martonkodok
Reea.net - Integrated web solutions driven by creativity
to deliver projects.

More Related Content

PPTX
Hacking google cloud run
PDF
Kubernetes training
PDF
Phacoemulsification in Vitrectomized Silicone Oil Filled Eyes
PPTX
Phakic lens implantation, technique, complications & management by dr suresh...
PPTX
PARS PLANA VITRECTOMY FOR LENS DROP.pptx
PPTX
PPT
contact lenses fitting for KCN
PPTX
Kubernetes #2 monitoring
Hacking google cloud run
Kubernetes training
Phacoemulsification in Vitrectomized Silicone Oil Filled Eyes
Phakic lens implantation, technique, complications & management by dr suresh...
PARS PLANA VITRECTOMY FOR LENS DROP.pptx
contact lenses fitting for KCN
Kubernetes #2 monitoring

What's hot (20)

PPTX
Ocular tuberculosis
PPTX
ADENOVIRAL-KERATOCONJUNCTIVITIS NIO&H Residency
PPTX
Keratoprosthesis
PPTX
Stateful set in kubernetes implementation & usecases
PPTX
Toric iol
PPTX
01. Kubernetes-PPT.pptx
PPTX
Occular manifestations of HIV
PPTX
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
PDF
6 th nerve palsy
PPTX
Post operative-corneal-edema
PDF
Hands-on Helm
PDF
Vitreous biopsy in_the_diagnosis_of_uveitis
PPTX
Refractive changes after posterior segment surgeries (Dr. Nesma, TA ophthalam...
PDF
Services in kubernetes-KnolX .pdf
PPTX
Limbal Stem Cell Deficiency & its management
PDF
Kubernetes Summit 2023: Head First Kubernetes
PPTX
Bardet Biedl Syndrome
PDF
Contact lenses Myths and Facts
PPTX
Fluorescein Stain
PPTX
TYPES OF INTRAOCULAR LENSES.pptx
Ocular tuberculosis
ADENOVIRAL-KERATOCONJUNCTIVITIS NIO&H Residency
Keratoprosthesis
Stateful set in kubernetes implementation & usecases
Toric iol
01. Kubernetes-PPT.pptx
Occular manifestations of HIV
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
6 th nerve palsy
Post operative-corneal-edema
Hands-on Helm
Vitreous biopsy in_the_diagnosis_of_uveitis
Refractive changes after posterior segment surgeries (Dr. Nesma, TA ophthalam...
Services in kubernetes-KnolX .pdf
Limbal Stem Cell Deficiency & its management
Kubernetes Summit 2023: Head First Kubernetes
Bardet Biedl Syndrome
Contact lenses Myths and Facts
Fluorescein Stain
TYPES OF INTRAOCULAR LENSES.pptx
Ad

Similar to Cloud Run - the rise of serverless and containerization (20)

PDF
Google Cloud Serverless - Cloud Run, arquitecturas y casos de uso
PPTX
Evaluating Serverless Machine Learning Performance On Google Cloud Run.pptx
PDF
GCP CloudRun Overview
PDF
Docker in Production: How RightScale Delivers Cloud Applications
PDF
OSDC 2019 | Evolution of a Microservice-Infrastructure by Jan Martens
PDF
Serverless Computing with Google Cloud
PDF
Continuous Delivery With Containers
PPTX
An Introduction to Kubernetes and Continuous Delivery Fundamentals
PPTX
Session 4 GCCP.pptx
PDF
Google Cloud Platform and Kubernetes
PDF
Intro to containerization
PDF
Containers, microservices and serverless for realists
PDF
Mattia Gandolfi - Improving utilization and portability with Containers and C...
PDF
Understanding Kubernetes
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
PDF
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
PDF
Serverless and you @ Women Who Code London 2020
PPTX
Going Serverless with Kubeless In Google Container Engine (GKE)
PDF
Powerful Google developer tools for immediate impact! (2023-24 C)
PDF
Serverless and you - where do i run my stateless code
Google Cloud Serverless - Cloud Run, arquitecturas y casos de uso
Evaluating Serverless Machine Learning Performance On Google Cloud Run.pptx
GCP CloudRun Overview
Docker in Production: How RightScale Delivers Cloud Applications
OSDC 2019 | Evolution of a Microservice-Infrastructure by Jan Martens
Serverless Computing with Google Cloud
Continuous Delivery With Containers
An Introduction to Kubernetes and Continuous Delivery Fundamentals
Session 4 GCCP.pptx
Google Cloud Platform and Kubernetes
Intro to containerization
Containers, microservices and serverless for realists
Mattia Gandolfi - Improving utilization and portability with Containers and C...
Understanding Kubernetes
Docker 0.11 at MaxCDN meetup in Los Angeles
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Serverless and you @ Women Who Code London 2020
Going Serverless with Kubeless In Google Container Engine (GKE)
Powerful Google developer tools for immediate impact! (2023-24 C)
Serverless and you - where do i run my stateless code
Ad

More from Márton Kodok (20)

PDF
AI Agents with Gemini 2.0 - Beyond the Chatbot
PDF
Gemini 2.0 and Vertex AI for Innovation Workshop
PDF
Function Calling with the Vertex AI Gemini API
PDF
Vector search and multimodal embeddings in BigQuery
PDF
BigQuery Remote Functions for Dynamic Mapping of E-mobility Charging Networks
PDF
Build applications with generative AI on Google Cloud
PDF
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
PDF
DevBCN Vertex AI - Pipelines for your MLOps workflows
PDF
Discover BigQuery ML, build your own CREATE MODEL statement
PDF
BigQuery best practices and recommendations to reduce costs with BI Engine, S...
PDF
Vertex AI - Unified ML Platform for the entire AI workflow on Google Cloud
PDF
Vertex AI: Pipelines for your MLOps workflows
PDF
Cloud Workflows What's new in serverless orchestration and automation
PDF
Serverless orchestration and automation with Cloud Workflows
PDF
Serverless orchestration and automation with Cloud Workflows
PDF
Serverless orchestration and automation with Cloud Workflows
PDF
BigdataConference Europe - BigQuery ML
PDF
DevFest Romania 2020 Keynote: Bringing the Cloud to you.
PDF
BigQuery ML - Machine learning at scale using SQL
PDF
Applying BigQuery ML on e-commerce data analytics
AI Agents with Gemini 2.0 - Beyond the Chatbot
Gemini 2.0 and Vertex AI for Innovation Workshop
Function Calling with the Vertex AI Gemini API
Vector search and multimodal embeddings in BigQuery
BigQuery Remote Functions for Dynamic Mapping of E-mobility Charging Networks
Build applications with generative AI on Google Cloud
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
DevBCN Vertex AI - Pipelines for your MLOps workflows
Discover BigQuery ML, build your own CREATE MODEL statement
BigQuery best practices and recommendations to reduce costs with BI Engine, S...
Vertex AI - Unified ML Platform for the entire AI workflow on Google Cloud
Vertex AI: Pipelines for your MLOps workflows
Cloud Workflows What's new in serverless orchestration and automation
Serverless orchestration and automation with Cloud Workflows
Serverless orchestration and automation with Cloud Workflows
Serverless orchestration and automation with Cloud Workflows
BigdataConference Europe - BigQuery ML
DevFest Romania 2020 Keynote: Bringing the Cloud to you.
BigQuery ML - Machine learning at scale using SQL
Applying BigQuery ML on e-commerce data analytics

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Univ-Connecticut-ChatGPT-Presentaion.pdf
Spectroscopy.pptx food analysis technology
Assigned Numbers - 2025 - Bluetooth® Document
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Encapsulation theory and applications.pdf
1. Introduction to Computer Programming.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Group 1 Presentation -Planning and Decision Making .pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Cloud Run - the rise of serverless and containerization

  • 2. 1. What is Serverless? What are Serverless pain points? 2. Cloud Run: Bringing serverless to containers 3. Build + run 4. Mitigating cold starts 5. Advanced examples 6. Integrating DockerSlim on Cloud Build 7. Conclusions Agenda Cloud Run: the rise of serverless and containerization @martonkodok
  • 3. ● Among the Top 3 romanians on Stackoverflow 201k reputation ● Google Developer Expert on Cloud technologies (2016→) ● Champion of Google Cloud Innovators program (2021→) ● Crafting Web/Mobile backends at REEA.net Articles: martonkodok.medium.com Twitter: @martonkodok Slideshare: martonkodok StackOverflow: pentium10 GitHub: pentium10 Cloud Run: the rise of serverless and containerization @martonkodok About me
  • 4. Once upon a time Google Cloud Functions AWS Lambda Azure Functions
  • 5. What is Serverless in the Functionsperspective Cloud Run: the rise of serverless and containerization @martonkodok Operational Model Programming Model No Infra Management Managed Security Pay only for usage Function-based Event-driven Closed
  • 7. Containers Cloud Run: the rise of serverless and containerization @martonkodok .js .rb .go .py .sh … 0 1 0 1 0 0 1 1 1 Any language Any Library Any Binary Ecosystem of base images
  • 8. What is Serverless in the CloudRun perspective Cloud Run: the rise of serverless and containerization @martonkodok Operational Model Programming Model No Infra Management Managed Security Pay only for usage Event-driven Closed Function-based Containerized App-service-driven Open
  • 10. Cloud Run: Pay-per-use Cloud Run: the rise of serverless and containerization @martonkodok CPU / Memory / Requests 100ms
  • 11. Cloud Run: Pay-per-use Cloud Run: the rise of serverless and containerization @martonkodok
  • 12. Cloud Run Managed: Pricing Cloud Run: the rise of serverless and containerization @martonkodok
  • 14. Getting started Cloud Run: the rise of serverless and containerization Image courtesy of @wietsevenema 1. Code (use your entire repo, not just a function) 2. Package (Dockerfile or build-packs) 3. Build image (leverage CloudBuild) 4. Deploy 5. Run + Monitor
  • 15. ChatGPT: create a Python Dockerfile Cloud Run: the rise of serverless and containerization @martonkodok
  • 16. Build -> Container Image -> Store -> deploy - > Run Cloud Run: the rise of serverless and containerization
  • 17. Submit + Build Cloud Run: the rise of serverless and containerization @martonkodok
  • 18. Folder Structure Cloud Run: the rise of serverless and containerization @martonkodok cloudbuild.yaml
  • 19. SSL offered out-of-the box + Monitoring Charts Cloud Run: the rise of serverless and containerization @martonkodok
  • 21. 1. Use a leaner base image (alpine, distroless, scratch for statically linked binary) Mitigating cold starts Cloud Run: the rise of serverless and containerization @martonkodok
  • 22. 1. Use a leaner base image (alpine, distroless, scratch for statically linked binary) 2. Startup CPU-boost Mitigating cold starts Cloud Run: the rise of serverless and containerization @martonkodok
  • 23. gcloud beta run services update SERVICE --cpu-boost gcloud beta run deploy --image IMAGE_URL --cpu-boost Startup CPU-boost Cloud Run: the rise of serverless and containerization @martonkodok CLI
  • 24. 1. Use a leaner base image (alpine, distroless, scratch for statically linked binary) 2. Startup CPU-boost Mitigating cold starts Cloud Run: the rise of serverless and containerization @martonkodok 3. Cloud Run: Minimum instances
  • 25. 1. Use a leaner base image (alpine, distroless, scratch for statically linked binary) 2. Startup CPU-boost Mitigating cold starts Cloud Run: the rise of serverless and containerization @martonkodok 3. Cloud Run: Minimum instances 4. Always-on CPU Costs: 10times less than regular price
  • 26. gcloud beta run services update SERVICE --min-instances MIN-VALUE --no-cpu-throttling gcloud beta run deploy --image IMAGE_URL --min-instances MIN-VALUE --no-cpu-throttling Minimum Instances & Always On CPU Cloud Run: the rise of serverless and containerization @martonkodok CLI UI
  • 27. Always On CPU Billing Cloud Run: the rise of serverless and containerization @martonkodok
  • 29. 1. When no requests, scales down to 0. (costs savings) 2. Each service can scale by default to 1000 container instances (auto decreases by instance type) 3. Each container instance can handle up to 1000 simultaneous requests (!YAY websockets) Note: 1000*1000 => 1M simultaneous requests Autoscaling Cloud Run: the rise of serverless and containerization @martonkodok
  • 30. 1. FaaS frameworks have fixed concurrency of 1 2. Cloud Run enables you to set concurrency (default 80, can be increased up to 250) 3. Risks! How a free trial experiment ended with a $72,000 bill overnight. Concurrency Cloud Run: the rise of serverless and containerization @martonkodok Common errors: ➔ Uncontrolled retries, Loops (failing tests, missing backoff) ➔ Unwanted traffic (consider using Identity-Aware Proxy, Cloud Endpoint Service) ➔ Reduce concurrency ➔ DDOS (consider using Cloud-Armor, Load Balancer)
  • 31. Cloud Run: Concurrency case study Cloud Run: the rise of serverless and containerization @martonkodok Concurrency=1 Clients: 400 Request=3 Concurrency=80 Clients: 400 Request=3 520 instances 150 instances
  • 32. Afternoon talk Cloud Run: the rise of serverless and containerization @martonkodok
  • 34. Next topics to be covered Cloud Run: the rise of serverless and containerization @martonkodok 1. Traffic Controls 2. Security 3. Health checks 4. Session affinity 5. SLOs 6. 2nd gen environment (disk support)
  • 35. Cloud Run: King of Serverless Compute? Cloud Run: the rise of serverless and containerization @martonkodok Serverless tools don’t provide canary deployments (subset of traffic) Allow traffic controls across revisions of a service Label your revisions for gradual-rollout-strategy (--no-traffic, candidate, latest) Eg: resulting an automated way to gradually roll out new versions of your Cloud Run services 1/Traffic Controls
  • 36. Cloud Run: King of Serverless Compute? Cloud Run: the rise of serverless and containerization @martonkodok Mount secrets from Secret Manager Binary Authorization for Cloud Run CMEK - customer-managed encryption keys. (for regulated industries like financial services) Eg: resulting increased security 2/Security
  • 37. Cloud Run: King of Serverless Compute? Cloud Run: the rise of serverless and containerization @martonkodok Configure startupprobes Configure an HTTP livenessprobe can configure HTTP, TCP, and gRPC probes Eg: to determine when a container has started and is ready to accept traffic 3/Container health checks
  • 38. Cloud Run: King of Serverless Compute? Cloud Run: the rise of serverless and containerization @martonkodok Configure startupprobes Configure an HTTP livenessprobe can configure HTTP, TCP, and gRPC probes Eg: to determine when a container has started and is ready to accept traffic 3/Container health checks
  • 39. Cloud Run: King of Serverless Compute? Cloud Run: the rise of serverless and containerization @martonkodok Session affinity SLOs (service level objectives) 2nd generation environments (ability to use mounted disk ) Eg: 2nd gen enables network file systems such as NFS, NDB, 9P, CIFS/Samba, and Ceph, as well as Cloud Filestore 4/More recent additions
  • 41. External HTTPs Load Balancer Cloud Run: the rise of serverless and containerization @martonkodok
  • 42. Multi-Region Load Balancing with Cloud Run Cloud Run: the rise of serverless and containerization @martonkodok
  • 44. 1. Use a leaner base image (alpine, distroless, scratch for statically linked binary) 2. Startup CPU-boost Mitigating cold starts + BONUS Cloud Run: the rise of serverless and containerization @martonkodok 3. Cloud Run: Minimum instances 4. Always-on CPU 5. DockerSlim (minifier, reduce a fat container to slim, more secure as reduces the available attack surface)
  • 45. - is a command line tool - provides a set of commands (build, xray, lint) - to reduce the size and optimize your containers.
  • 46. 1. Minify a fat container (reduces the container size) 2. Run a probe to touch all “used”parts Use DockerSlimas container minifier Cloud Run: the rise of serverless and containerization @martonkodok 3. Make it more secure (reduces the available attack surface) 4. Faster cold starts 5. Less costs on container build and storage Note: Good for HTTP based apps. Node.js, Python, Ruby, Java, Golang, Rust, Elixir, and PHP cmd=build info=results by='5.21X' size.original='413 MB' size.optimized='79 MB' status='MINIFIED'
  • 47. Cloud Build example integration for DockerSlim minify @martonkodok
  • 48. Article: Integrating DockerSlim on Cloud Build @martonkodok https://bit.ly/3iOAShM
  • 49. Conclusion Cloud Run: the rise of serverless and containerization @martonkodok
  • 50. 1. Simple developer friendly CLI to quickly deploy/manage services without sysadmins 2. Integration with CloudCode, CloudBuildand for continuousdeployments 3. Fast autoscaling - out-of-the-box scaledowntozero 4. HTTPS URLs - out-of-the-box stable HTTPS endpoint - customdomains 5. Enables invocation by HTTP/2, WebSockets and gRPC 6. 2nd gen environment - enables file file storage access natively + but slower cold starts Enhanced developer experience Cloud Run: the rise of serverless and containerization @martonkodok
  • 51. Thank you. Slides available on: slideshare.net/martonkodok Reea.net - Integrated web solutions driven by creativity to deliver projects.