PerformGo-K8S-v4 - Common
PerformGo-K8S-v4 - Common
Microservices
Monitoring
Christopher Chai
Solutions Architect, Dynatrace
Before we start…
• Setup Wifi
• SSID:
• Password
• Your Dynatrace environment
• Got the invitation email?
• Google Cloud Platform (GCP) account
• Sign up for free $300 free credit
Confidential 2
Agenda
• Introduction
• About Monoliths & Microservices
• Kubernetes concepts and architecture
• Hands-on Lab
• Install k8s cluster on GKE
• Install Dynatrace OneAgent Operator
• Setup Kubernetes UI integration
• Annotations & labels
• Process and service renaming
• Canary release – comparing the performance Confidential 3
Monolith vs Microservices
Confidential 4
Limitations of monolithic applications
UI Agility?
Scalability?
Ship. Acct.
DevOps cycle?
Mgmt. Billing Availability, fault tolerance, resiliency?
DB
Confidential 5
Limitations lead to the rise of Microservices
DB DB
• DevOps Cycle - Since each component operates independently,
continuous delivery cycle reduces
Mgmt. Billing
• Availability, Fault Tolerance, and Resiliency
DB DB
Confidential 6
From VMs to Containers
Containerized applications
Confidential 7
What’s Kubenetes?
Confidential 10
Kubenetes Architecture
• Cluster
• Master nodes
• “Worker” nodes
• Pods
• Docker containers
• Docker registry
• Pod Manifest (YAML)
Confidential 11
Key Concepts - Nodes
Confidential 12
Key Concepts - Pods
Confidential 19
Accessing your Dynatrace environment
Confidential 20
If you don’t have the invitation email…
When chosen, your instance will spun up immediately and you will have access
to your instance.
Confidential 21
Tweaking a little bit…
Confidential 22
Resources
• Some steps are only valid if you are registered for PerformGo! SG HOT
session.
• Please always refer to this deck for instructions.
Confidential 23
Lab 1
Confidential 24
Setting up your GKE
Confidential 25
Setting up your GKE
Confidential 26
Setting up your GKE
Confidential 27
Setting up your GKE
Confidential 28
Setting up your GKE
• Create your GKE Cluster named performgo2019 using COS with containerd
• gcloud container clusters create performgo2019 --image-
type=cos_containerd --cluster-version=1.13
Confidential 29
Setting up your GKE
Confidential 30
Lab 2
Confidential 31
Install Dynatrace OneAgent Operator
Confidential 32
Install Dynatrace OneAgent Operator
Confidential 33
Install Dynatrace OneAgent Operator
Confidential 34
Install Dynatrace OneAgent Operator
Confidential 35
Install Dynatrace OneAgent Operator
• API Token
• Go to your Dynatrace environment >
Settings > Integration > Dynatrace API
> Generate Token
• Enter a token name
• Make sure access scope enabled for
Access problem and event feed,
metrics and topology
• Click Generate
• Copy the token
Confidential 36
Install Dynatrace OneAgent Operator
• PaaS Token
• Go to your Dynatrace environment >
Settings > Integration > Platform as a
Service > Generate Token
• Enter a token name
• Click Generate
• Copy the token
Confidential 37
Install Dynatrace OneAgent Operator
Confidential 38
Install Dynatrace OneAgent Operator
• Verify Installation
• Once installed, the cluster nodes
will appear straightaway!
• Click on Hosts
• Alternatively, run kubectl –n
dynatrace get pods
Confidential 39
Full stack monitoring, auto-discovery of topology
Confidential 40
Lab 3
Confidential 41
Setting up Kubernetes Dashboard
Confidential 42
Setting up Kubernetes Dashboard
Confidential 43
Setting up Kubernetes Dashboard
• Verify ActiveGate
• Go to Dynatrace > Deployment Status > Dynatrace ActiveGates
Confidential 44
Setting up Kubernetes Dashboard
Confidential 45
Setting up Kubernetes Dashboard
Confidential 46
Setting up Kubernetes Dashboard
Confidential 47
Setting up Kubernetes Dashboard
Confidential 48
Setting up Kubernetes Dashboard
Confidential 49
Lab 4
Confidential 50
Setting up a demo application
Confidential 51
Kubernetes Labels and Annotation
• sock-shop metadata
• vi /HOT-k8s/manifests/sockshop-
app/production/front-end.yml
Confidential 52
Kubernetes Labels and Annotation
• ./recycle-sockshop-frontend.sh
Confidential 53
Kubernetes Labels and Annotation
Confidential 54
Accessing Sock Shop!
Confidential 55
Accessing Sock Shop!
http://
[YOUR_IP_ADDRESS]:8
080
Confidential 56
Full stack monitoring
Confidential 57
Adding Environment Variables
Event logger
Confidential 59
Problem history
Process Groups – Single PGI View
Confidential 60
Setting up Kubernetes Dashboard Problem history
Hosts – what do we get?
Detected Processes
Confidential 62
Adding Environment Variables
Confidential 63
Adding Environment Variables
Confidential 64
Lab 6
Confidential 65
Process Renaming
• Go to Settings > Processes and containers
> Process group naming
• Provide a name to the rule
• Enter this format:
• k8s-
{ProcessGroup:Kubernetes:pipeline.projec
t}.{ProcessGroup:KubernetesNamespace}.
{ProcessGroup:KubernetesContainerName
}
Confidential 67
Service Renaming
Confidential 69
Lab 7
Confidential 70
Process Detection for Canary Deployment
Confidential 71
Process Detection for Canary Deployment
• Verify that both stable and canary releases running for the front-end service
• kubectl get pods -n production -o wide
Confidential 72
Process Detection for Canary Deployment
Confidential 73
Process Detection for Canary Deployment
Confidential 74
Process Detection for Canary Deployment
Confidential 75
Process Detection for Canary Deployment
Confidential 76
Process Detection for Canary Deployment
Confidential 77
Merge the Services
Confidential 78
Merge the Services
Confidential 79
Compare Stable versus Canary Release
• With the services merged as one, you can now compare performance between two
• Go to Create Chart
• Choose Response time – Server and select Service Instance as Dimension splitting
Confidential 80
Compare Stable versus Canary Release
Confidential 81
dynatrace.com
Confidential 82