This repository contains labs for the Hands-On Kubernetes Session. We will be using Google Kubernetes Engine (GKE) for this hands-on but this will work on other PaaS platforms as well.

For the purposes of the Hands-On, we will automate and make the steps seamless for the participants

Prerequisites

What You'll Learn

Sign up for a Google Cloud Platform Account

Head over to https://cloud.google.com/free/ and sign up for a free GCP account with your existing Google account.

You can also signup for a new Google Account if you don't have one

Upon signup, you will have free credits tied to your GCP account. (12 months + 400AUD)

You can login to your GCP console here.

GCP-Homepage

Enable Kubernetes Engine API

You will also need to Enable your API Billing with Kubernetes Engine API.

k8s-Engine

You should be prompted to the billing page while setting up your GKE instance.

If not, you can follow the steps here

Activate Cloud Shell

GKE-Menu

Click on the Terminal Icon on the top right

A Cloud based Terminal lookalike will appear at the bottom of the page

We will start setting up our GKE Cluster

3. Create your GKE Cluster

GKE-CLI

Create your GKE cluster named k8sworkshop running Ubuntu in GKE with the following command. We will also be creating a compute VM for a Dynatrace Activegate. We will use the Dynatrace Activegate for Kubernetes integration.

gcloud container clusters create k8sworkshop --image-type=ubuntu --zone australia-southeast1-a
gcloud compute instances create dynatrace-activegate --image-family ubuntu-1604-lts --image-project ubuntu-os-cloud --zone australia-southeast1-a

Once completed, you will have a running GKE Cluster!

GKE-CLI Running kubectl get nodes will reveal number of nodes

  1. On your Google Cloud Console, on the left navigational bar, go to Kubernetes Engine -> Applications
  2. Click on "Deploy From Marketplace"
  3. Search for Dynatrace in the search field above Activegate-connected
  4. Click on Dynatrace OneAgent Operator and click on Configure
  5. Fill up the fields, taking the value from the Dynatrace UI
  6. Click on Deploy
    Activegate-connected

Once completed, you can click on Hosts on the left panel to see your connected K8S nodes (3 nodes)

GKE-Hosts

For our Hands-On, you will need to run Hipster Shop which is a Google sample application.

Run the Hipster Shop

wget -O- https://raw.githubusercontent.com/Dynatrace-APAC/Workshop-Kubernetes/master/deploy.sh | bash

Once deployed, you can locate the front-end endpoint from GCP (Kubernetes Engine -> Services & Ingress)

JSON

Once running, you can go to the exposed frontend-external IP to go to Hipster Shop.

JSON

Automatic Discovery of services

In Dynatrace, go to Transactions and Services to see the automatic 5 discovered services. Discovered Services

You will realized that some services are discovered but some might not match Hipster Shop's Service architecture. Hipster Shop uses cutting edge technologies (such as GPRC) which Dynatrace supports with the constant evolution in the cloud.

Architecture

Enabling additional features within OneAgent

Because of the rapid rate of change coming to OneAgent, features that are in Early Access aren't automatically enabled by default. This is to prevent unforseen circumstances which might impact your production environments. For the purposes of workshop, we can enable these features. Go to Settings -> Service-side service monitoring -> Deep Monitoring -> New Oneagent Features

Under Global Settings, enable the following feature flags. They are on different pages so you would need to toggle through the pages.

You can use the search filter bar to search for "GRPC"GRPC-Features

Features

Make sure all the below features all enabled, including the 2 additional NodeJS feature flags. All-Features

Enabling OneAgents features requires a restart of the pods. Run the following command to restart the pods.

kubectl delete pods --all -n hipster-shop

Restart

Back in Dynatrace, go to and Transactions and Services to see the updated list of services. Discovered Services

Clicking on Go Service ":8080" followed by Service Flow, you can see that the service are automatically detected and matches the architecture diagram above.

Service Flow

Explore the various functionalities within the Kubernetes View such as Cluster Utilization, Cluster Workloads, K8S Events

KubernetesUI

Analyze the Kubernetes Cluster utilization

KubernetesUI

Analyze the Kubernetes Cluster Workloads

KubernetesUI

Analyze the Kubernetes Events

KubernetesUI

Analyze the Kubernetes Namespace

KubernetesUI

Explore Cloud Applications by clicking onto them

KubernetesUI

We hope you enjoyed this lab and found it useful. We would love your feedback!

How was your overall experience with this lab?

Excellent Good Average Fair Poor

What did you benefit most from this lab?

Using OneAgent Operator to deploy in Kubernetes Setting up Kubernetes integation Enabling early access feature flags Learning Kubernetes View in Dynatrace

How likely are you to recommend this lab to a friend or colleague?

Very Likely Moderately Likely Neither Likely nor unlikely Moderately Unlikely Very Unlikely