SlideShare a Scribd company logo
1 of 19
G
en
er
ati
ve
Ar
t –
M
ad
e
wi
th
U
nit
y
Large Scale Cloud
Infrastructure Using
Shared Components
1
Practical examples of building a large scale
Kubernetes infrastructure, handling 50K
requests/sec, by distributing development of
shared components, increasing ownership
and reducing bottlenecks in the development
process
About me:
Rasmus Selsmark
DevOps Team Lead, Unity Ads
2
3
4
Publishers Advertisers
Monetizing
their games
Acquiring users
5
>1.2B
mobile devices
~50K
requests/sec
16K
CPUs on cloud
infra
6
High-level architecture
7
NATS
(nats.io)
Events
EventsAd delivery
Databases
Game config,
ads
(HTTP)
Configuration
Tools
qMongoDBDatabases
Data Pipeline
Kafka
S3/GCS etc
DevOps Handbook describes three primary types of
organizational structures
Scaling Engineering Teams
8
Matrix-oriented: combination of functional and market oriented
Functional-oriented: centralizing/optimizing expertise
Market-oriented: optimize for fast response to customer needs, each
team is responsible for feature delivery and deployment
Model at Unity
Unity Ads dev teams
9
Unity Ads: 140 developers in
Helsinki and San Francisco offices
20 dev teams
~200 repositories
~90 microservices
Unity: 2400 employees
worldwide
SRE
Seattle
SRE
Helsinki
SRE
Shanghai
Component ownership and development
11
Shared: Cloud infra, network, Prometheus, Terraform Enterprise Shared Unity
infrastructure
Common CI/Build and Deployment Pipeline DevOps team
Shared
development
Terraform infrastructure
Microservices
Databases
Terraform infrastructure
Microservices
Databases
DevOps Handbook deployment pipeline requirements:
● Automated, repeatable and predictable
● Consistent environments, by using same deployment tools for
staging and production
● Enabling easy automated self-service deploymentsTerraform modules Monitoring and alerts framework
Messaging + monitoring libraries
q
Dev teams
q
“Internal Open Source Model”:
● Typically one team is maintainer, not necessarily only
developer of a shared module
● Focus on consistency, while allowing others to contribute
● Most development is done by dev teams, not DevOps team
The tools we’re using to support
model with teams owning and
deploying services
● Terraform
● Kubernetes / Helm
● Jenkins / GitLab CI
12
Scaling Services
Keeping build and deployment
relevant configuration in service
repo, makes it visible to team,
allowing independent ownership and
simplifies workflows for the team
All configuration in service repo
client
(...)
helm
prd.yaml
stg.yaml
values.yaml
scripts
build.sh
test.sh
server
(...)
Dockerfile
Jenkinsfile
monitoring.yml
sonar-project.properties13
● All services deployed using same common build pipeline
● Using Jenkins shared libraries / GitLab CI include files:
○ https://jenkins.io/doc/book/pipeline/shared-libraries
○ https://docs.gitlab.com/ee/ci/yaml/#include
Common build pipeline
if (config.deploy_prod == "true") {
stage('Deploy to production') {
print "Check if we can auto-deploy for ..."
if (config.skipConfirmForUsers != null && ...)
{
print "Skip deployment confirmation"
deployToProduction()
} else {
timeout(time: 1, unit: 'HOURS') {
userInput = input(message: 'Deploy?', ...)
if (userInput) {
deployToProduction()
Common build pipeline logic example
14
Script {
deploy = "helm"
deploy_prod = "true"
staging_env = ["ads-gke-stg"]
production_env = ["ads-gke-prd"]
}
Jenkinsfile for a service repo, only
containing configuration relevant to
build/deploy, no code
Infrastructure as Code - Terraform
15
resource "google_compute_instance" "mongodb" {
name = "mongodb-${var.cluster_name}-(...)"
machine_type = "${var.machine_type}"
(...)
}
resource "google_compute_disk" "mongodb-disk" {
size = "${var.data_disk_size}"
type = "${var.data_disk_type}"
(...)
}
Shared Terraform module
module "mongodb_ads_selfserve_stg" {
source = "tfe/unity-ads/mongodb/google"
version = "1.1.6"
machine_type = "n1-standard-2"
data_disk_type = "pd-ssd"
data_disk_size = "40"
cluster_size = "3"
(...)
}
Module usage/implementation in team repo
● https://helm.sh - “The package manager for Kubernetes”
● Abstracts the complexity of Kubernetes manifests for dev teams, only specifying
parameters relevant for deploying the service
● Helm templates stored in central repository, maintained by DevOps team
● Helm config is stored in service repo, i.e. with application code
● Shared “unity-common-chart” chart, hosted on internal
https://github.com/helm/chartmuseum repository
Helm and Kubernetes
16
{{- if .Values.enableDeployment -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: {{ .Values.namespace }}
name: {{ .Chart.Name }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
app: {{ .Chart.Name }}
environment: {{ .Values.environment }}
productgroup: {{ .Values.productgroup }}
spec:
progressDeadlineSeconds: {{ .Values.deployment.progressDeadlineSeconds }}
(...)
unity-common-chart/templates/deployment.yaml
Helm chart example and usage
17
Using Helm template ensures consistent naming
across services, which would be harder to achieve
if teams maintained their individual Kubernetes
manifest files
Service helm usage
environment: stg
deployment:
replicas: 2
resources:
requests:
cpu: 0.1
memory: 256Mi
limits:
cpu: 0.1
memory: 512Mi
Jenkins build + deployment
18
● We have found a model, which works
well for us in terms of organizational
and technical implementation of our
service ownership model
● Don’t underestimate the task for dev
teams to own their infrastructure. Teams
needs support from organization
19
Learnings
Generative Art – Made with Unity
Thank you!
20
Rasmus Selsmark
rasmus@unity3d.com
https://careers.unity.com/location/helsinki

More Related Content

What's hot

What's hot (20)

.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
Intro to Google Cloud Platform Data Engineering.- Endpoints
Intro to Google Cloud Platform Data Engineering.- EndpointsIntro to Google Cloud Platform Data Engineering.- Endpoints
Intro to Google Cloud Platform Data Engineering.- Endpoints
 
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
 
Using Google Cloud Services with Spring Boot and Pivotal Cloud Foundry (Pivot...
Using Google Cloud Services with Spring Boot and Pivotal Cloud Foundry (Pivot...Using Google Cloud Services with Spring Boot and Pivotal Cloud Foundry (Pivot...
Using Google Cloud Services with Spring Boot and Pivotal Cloud Foundry (Pivot...
 
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
 
Quantifying the Benefits of Cloud Foundry
Quantifying the Benefits of Cloud FoundryQuantifying the Benefits of Cloud Foundry
Quantifying the Benefits of Cloud Foundry
 
Tectonic Summit 2016: Betting on Kubernetes
Tectonic Summit 2016: Betting on KubernetesTectonic Summit 2016: Betting on Kubernetes
Tectonic Summit 2016: Betting on Kubernetes
 
Domain-driven Design
Domain-driven DesignDomain-driven Design
Domain-driven Design
 
Compass digital ocean’s customer advisory group 2021_10
Compass digital ocean’s customer advisory group 2021_10Compass digital ocean’s customer advisory group 2021_10
Compass digital ocean’s customer advisory group 2021_10
 
stackconf 2021 | How we finally migrated an eCommerce-Platform to GCP
stackconf 2021 | How we finally migrated an eCommerce-Platform to GCPstackconf 2021 | How we finally migrated an eCommerce-Platform to GCP
stackconf 2021 | How we finally migrated an eCommerce-Platform to GCP
 
Modern application delivery with Consul
Modern application delivery with ConsulModern application delivery with Consul
Modern application delivery with Consul
 
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
 
Function as a Service with Knative and riff
Function as a Service with Knative and riffFunction as a Service with Knative and riff
Function as a Service with Knative and riff
 
Cloud Native Demystified: Build Once, Run Anywhere!
Cloud Native Demystified: Build Once, Run Anywhere!Cloud Native Demystified: Build Once, Run Anywhere!
Cloud Native Demystified: Build Once, Run Anywhere!
 
Intro to Google Cloud Platform Data Engineering.
Intro to Google Cloud Platform Data Engineering.Intro to Google Cloud Platform Data Engineering.
Intro to Google Cloud Platform Data Engineering.
 
Manage your kubernetes cluster with cluster api, azure and git ops
Manage your kubernetes cluster with cluster api, azure and git opsManage your kubernetes cluster with cluster api, azure and git ops
Manage your kubernetes cluster with cluster api, azure and git ops
 
Introducing Cloud Foundry Integration for Eclipse (Cloud Foundry Summit 2014)
Introducing Cloud Foundry Integration for Eclipse (Cloud Foundry Summit 2014)Introducing Cloud Foundry Integration for Eclipse (Cloud Foundry Summit 2014)
Introducing Cloud Foundry Integration for Eclipse (Cloud Foundry Summit 2014)
 
stackconf 2021 | Platform as a Product
stackconf 2021 | Platform as a Productstackconf 2021 | Platform as a Product
stackconf 2021 | Platform as a Product
 
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 Depok
 

Similar to Large Scale Cloud Infrastructure Using Shared Components

Similar to Large Scale Cloud Infrastructure Using Shared Components (20)

Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
 
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
 
Speeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCCSpeeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCC
 
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
 
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
 
Build 2019 Recap
Build 2019 RecapBuild 2019 Recap
Build 2019 Recap
 
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
 
Cloud computing: highlights
Cloud computing: highlightsCloud computing: highlights
Cloud computing: highlights
 
WSO2 Complex Event Processor - Product Overview
WSO2 Complex Event Processor - Product OverviewWSO2 Complex Event Processor - Product Overview
WSO2 Complex Event Processor - Product Overview
 
Modern Scheduling for Modern Applications with Nomad
Modern Scheduling for Modern Applications with NomadModern Scheduling for Modern Applications with Nomad
Modern Scheduling for Modern Applications with Nomad
 
MongoDB.local Paris Keynote
MongoDB.local Paris KeynoteMongoDB.local Paris Keynote
MongoDB.local Paris Keynote
 
Node in Real Time - The Beginning
Node in Real Time - The BeginningNode in Real Time - The Beginning
Node in Real Time - The Beginning
 
RAGHUNATH_GORLA_RESUME
RAGHUNATH_GORLA_RESUMERAGHUNATH_GORLA_RESUME
RAGHUNATH_GORLA_RESUME
 
Balaji Resume
Balaji ResumeBalaji Resume
Balaji Resume
 
Docker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityDocker meetup - PaaS interoperability
Docker meetup - PaaS interoperability
 
CI/CD and TDD in deploying kamailio
CI/CD and TDD in deploying kamailioCI/CD and TDD in deploying kamailio
CI/CD and TDD in deploying kamailio
 
SACON NY 19: "Creating an effective developer experience for cloud-native apps"
SACON NY 19: "Creating an effective developer experience for cloud-native apps"SACON NY 19: "Creating an effective developer experience for cloud-native apps"
SACON NY 19: "Creating an effective developer experience for cloud-native apps"
 
Journey to cloud engineering
Journey to cloud engineeringJourney to cloud engineering
Journey to cloud engineering
 
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry MeetupPivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
 

More from Eficode

More from Eficode (20)

Saving money with Consolidations
Saving money with ConsolidationsSaving money with Consolidations
Saving money with Consolidations
 
DevOps Automation with Puppet Bolt & Puppet Enterprise
DevOps Automation with Puppet Bolt & Puppet EnterpriseDevOps Automation with Puppet Bolt & Puppet Enterprise
DevOps Automation with Puppet Bolt & Puppet Enterprise
 
Scaling DevOps: Pitfalls to avoid
Scaling DevOps: Pitfalls to avoidScaling DevOps: Pitfalls to avoid
Scaling DevOps: Pitfalls to avoid
 
Microservices, IoT, DevOps: A Case Study
Microservices, IoT, DevOps: A Case StudyMicroservices, IoT, DevOps: A Case Study
Microservices, IoT, DevOps: A Case Study
 
Building a Knowledge Graph at Zalando
Building a Knowledge Graph at ZalandoBuilding a Knowledge Graph at Zalando
Building a Knowledge Graph at Zalando
 
Why Serverless is scary without DevSecOps and Observability
Why Serverless is scary without DevSecOps and ObservabilityWhy Serverless is scary without DevSecOps and Observability
Why Serverless is scary without DevSecOps and Observability
 
Securing Modern Applications: The Data Behind DevSecOps
Securing Modern Applications: The Data Behind DevSecOpsSecuring Modern Applications: The Data Behind DevSecOps
Securing Modern Applications: The Data Behind DevSecOps
 
Secure your Azure and DevOps in a smart way
Secure your Azure and DevOps in a smart waySecure your Azure and DevOps in a smart way
Secure your Azure and DevOps in a smart way
 
Can I Contain This?
Can I Contain This?Can I Contain This?
Can I Contain This?
 
The Mono-repo – a contradiction with Microservices
The Mono-repo – a contradiction with MicroservicesThe Mono-repo – a contradiction with Microservices
The Mono-repo – a contradiction with Microservices
 
Using Go in DevOps
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOps
 
Why Should You Be Thinking About DesignOps?
Why Should You Be Thinking About DesignOps?Why Should You Be Thinking About DesignOps?
Why Should You Be Thinking About DesignOps?
 
A beginners guide to scaling DevOps
A beginners guide to scaling DevOpsA beginners guide to scaling DevOps
A beginners guide to scaling DevOps
 
From Zero to SAFe
From Zero to SAFeFrom Zero to SAFe
From Zero to SAFe
 
Bringing value to the business and for your customer through DevOps
Bringing value to the business and for your customer through DevOpsBringing value to the business and for your customer through DevOps
Bringing value to the business and for your customer through DevOps
 
Disconnected Pipelines: The Missing Link
Disconnected Pipelines: The Missing LinkDisconnected Pipelines: The Missing Link
Disconnected Pipelines: The Missing Link
 
The Best & Worst Uses of AI in Software Testing
The Best & Worst Uses of AI in Software TestingThe Best & Worst Uses of AI in Software Testing
The Best & Worst Uses of AI in Software Testing
 
Model-based programming and AI-assisted software development
Model-based programming and AI-assisted software developmentModel-based programming and AI-assisted software development
Model-based programming and AI-assisted software development
 
2018 State Of DevOps Report Key Findings
2018 State Of DevOps Report Key Findings2018 State Of DevOps Report Key Findings
2018 State Of DevOps Report Key Findings
 
Anomaly Detection using ML in Elisa Viihde CDN
Anomaly Detection using ML in Elisa Viihde CDNAnomaly Detection using ML in Elisa Viihde CDN
Anomaly Detection using ML in Elisa Viihde CDN
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Large Scale Cloud Infrastructure Using Shared Components

  • 1. G en er ati ve Ar t – M ad e wi th U nit y Large Scale Cloud Infrastructure Using Shared Components 1
  • 2. Practical examples of building a large scale Kubernetes infrastructure, handling 50K requests/sec, by distributing development of shared components, increasing ownership and reducing bottlenecks in the development process About me: Rasmus Selsmark DevOps Team Lead, Unity Ads 2
  • 3. 3
  • 5. 5
  • 7. High-level architecture 7 NATS (nats.io) Events EventsAd delivery Databases Game config, ads (HTTP) Configuration Tools qMongoDBDatabases Data Pipeline Kafka S3/GCS etc
  • 8. DevOps Handbook describes three primary types of organizational structures Scaling Engineering Teams 8 Matrix-oriented: combination of functional and market oriented Functional-oriented: centralizing/optimizing expertise Market-oriented: optimize for fast response to customer needs, each team is responsible for feature delivery and deployment Model at Unity
  • 9. Unity Ads dev teams 9 Unity Ads: 140 developers in Helsinki and San Francisco offices 20 dev teams ~200 repositories ~90 microservices Unity: 2400 employees worldwide SRE Seattle SRE Helsinki SRE Shanghai
  • 10. Component ownership and development 11 Shared: Cloud infra, network, Prometheus, Terraform Enterprise Shared Unity infrastructure Common CI/Build and Deployment Pipeline DevOps team Shared development Terraform infrastructure Microservices Databases Terraform infrastructure Microservices Databases DevOps Handbook deployment pipeline requirements: ● Automated, repeatable and predictable ● Consistent environments, by using same deployment tools for staging and production ● Enabling easy automated self-service deploymentsTerraform modules Monitoring and alerts framework Messaging + monitoring libraries q Dev teams q “Internal Open Source Model”: ● Typically one team is maintainer, not necessarily only developer of a shared module ● Focus on consistency, while allowing others to contribute ● Most development is done by dev teams, not DevOps team
  • 11. The tools we’re using to support model with teams owning and deploying services ● Terraform ● Kubernetes / Helm ● Jenkins / GitLab CI 12 Scaling Services
  • 12. Keeping build and deployment relevant configuration in service repo, makes it visible to team, allowing independent ownership and simplifies workflows for the team All configuration in service repo client (...) helm prd.yaml stg.yaml values.yaml scripts build.sh test.sh server (...) Dockerfile Jenkinsfile monitoring.yml sonar-project.properties13
  • 13. ● All services deployed using same common build pipeline ● Using Jenkins shared libraries / GitLab CI include files: ○ https://jenkins.io/doc/book/pipeline/shared-libraries ○ https://docs.gitlab.com/ee/ci/yaml/#include Common build pipeline if (config.deploy_prod == "true") { stage('Deploy to production') { print "Check if we can auto-deploy for ..." if (config.skipConfirmForUsers != null && ...) { print "Skip deployment confirmation" deployToProduction() } else { timeout(time: 1, unit: 'HOURS') { userInput = input(message: 'Deploy?', ...) if (userInput) { deployToProduction() Common build pipeline logic example 14 Script { deploy = "helm" deploy_prod = "true" staging_env = ["ads-gke-stg"] production_env = ["ads-gke-prd"] } Jenkinsfile for a service repo, only containing configuration relevant to build/deploy, no code
  • 14. Infrastructure as Code - Terraform 15 resource "google_compute_instance" "mongodb" { name = "mongodb-${var.cluster_name}-(...)" machine_type = "${var.machine_type}" (...) } resource "google_compute_disk" "mongodb-disk" { size = "${var.data_disk_size}" type = "${var.data_disk_type}" (...) } Shared Terraform module module "mongodb_ads_selfserve_stg" { source = "tfe/unity-ads/mongodb/google" version = "1.1.6" machine_type = "n1-standard-2" data_disk_type = "pd-ssd" data_disk_size = "40" cluster_size = "3" (...) } Module usage/implementation in team repo
  • 15. ● https://helm.sh - “The package manager for Kubernetes” ● Abstracts the complexity of Kubernetes manifests for dev teams, only specifying parameters relevant for deploying the service ● Helm templates stored in central repository, maintained by DevOps team ● Helm config is stored in service repo, i.e. with application code ● Shared “unity-common-chart” chart, hosted on internal https://github.com/helm/chartmuseum repository Helm and Kubernetes 16
  • 16. {{- if .Values.enableDeployment -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: namespace: {{ .Values.namespace }} name: {{ .Chart.Name }} labels: chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" app: {{ .Chart.Name }} environment: {{ .Values.environment }} productgroup: {{ .Values.productgroup }} spec: progressDeadlineSeconds: {{ .Values.deployment.progressDeadlineSeconds }} (...) unity-common-chart/templates/deployment.yaml Helm chart example and usage 17 Using Helm template ensures consistent naming across services, which would be harder to achieve if teams maintained their individual Kubernetes manifest files Service helm usage environment: stg deployment: replicas: 2 resources: requests: cpu: 0.1 memory: 256Mi limits: cpu: 0.1 memory: 512Mi
  • 17. Jenkins build + deployment 18
  • 18. ● We have found a model, which works well for us in terms of organizational and technical implementation of our service ownership model ● Don’t underestimate the task for dev teams to own their infrastructure. Teams needs support from organization 19 Learnings
  • 19. Generative Art – Made with Unity Thank you! 20 Rasmus Selsmark rasmus@unity3d.com https://careers.unity.com/location/helsinki