Skip to content

Commit

Permalink
feat: Add Pixie lab
Browse files Browse the repository at this point in the history
  • Loading branch information
alexronquillo committed Oct 22, 2021
1 parent de918b2 commit b7f7c19
Show file tree
Hide file tree
Showing 40 changed files with 1,033 additions and 8 deletions.
13 changes: 13 additions & 0 deletions src/data/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
url: '/collect-data/get-started-nerdgraph-api-explorer'
- title: Monitor your network devices with New Relic
url: '/collect-data/network-performance-monitoring'
- title: Monitor your Kubernetes cluster with New Relic and Pixie
url: '/collect-data/pixie'
pages:
- title: Set up your TinyHat environment
url: '/collect-data/pixie/set-up-env'
- title: Explore your cluster
url: '/collect-data/pixie/explore-cluster'
- title: Instrument your cluster
url: '/collect-data/pixie/instrument-cluster'
- title: Debug missing images in your service
url: '/collect-data/pixie/scenario-1'
- title: Debug latency in the TinyHat admin
url: '/collect-data/pixie/scenario-2'
- title: Automate workflows
icon: nr-automation
url: '/automate-workflows'
Expand Down
Binary file added src/images/ab-test/gateway-service-traffic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/400-response-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/admin-delay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/broken-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/cat-ears-bob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/cluster-script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/default-namespace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/default-service-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/error-rates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/fetch-400s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/flamegraph-script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/flamegraph-services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/frontend-latency-spikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/frontend-service-latency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/frontend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/gateway-service-stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/high-latency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/live-debugging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/no-hat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/nr-kubernetes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/order-of-operations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/query.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/sample-of-slow-requests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pixie/scenario-1-network-response.png
Binary file added src/images/pixie/scenario-2-twitter.png
Binary file added src/images/pixie/scripts.png
Binary file added src/images/pixie/service-script-selector.png
Binary file added src/images/pixie/service-script.png
Binary file added src/images/pixie/traffic.png
Binary file added src/images/pixie/two-functions.png
107 changes: 107 additions & 0 deletions src/markdown-pages/collect-data/pixie-lab/explore-cluster.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
path: '/collect-data/pixie/explore-cluster'
duration: '5 min'
title: 'Explore your cluster'
template: 'GuideTemplate'
description: 'Explore your cluster'
procIdx: 2
---

<Callout variant="course" title="lab">

This procedure is part of a lab that teaches you how to monitor your Kubernetes cluster with Pixie.

Each procedure in the lab builds upon the last, so make sure you've completed the last procedure, [_Set up your TinyHat environment_](/collect-data/pixie/set-up-env), before starting this one.

</Callout>

Your website, TinyHat.me, runs in Kubernetes. While Pixie helps you monitor your cluster and find the source of problems that arise within it, it's helpful to know about your cluster's structure and the components that make it up before learning how to use Pixie.

<Steps>

<Step>

View your pods:

<>

```bash
kubectl get pods
[output] NAME READY STATUS RESTARTS AGE
[output] add-service-7bd4df79d8-pvtz6 1/1 Running 0 2m31s
[output] admin-service-6877db7bcc-t86qj 1/1 Running 0 2m31s
[output] fetch-service-768d9f9988-8k8jp 1/1 Running 2 2m31s
[output] frontend-service-d6d79cc6d-q496f 1/1 Running 0 2m31s
[output] gateway-service-5bc8bcc679-stxbn 1/1 Running 0 2m31s
[output] manipulation-service-96c8fd7d4-64gfr 1/1 Running 0 2m31s
[output] moderate-service-859498d88b-nsg5q 1/1 Running 0 2m31s
[output] mysql-6d65cdf67f-59dfg 1/1 Running 0 2m31s
[output] upload-service-7c8d8b648f-x6kq5 1/1 Running 0 2m31s
```

</>

<Callout variant="tip">

Every pod should be running by now, but if one isn't, give it few more minutes.

</Callout>

Here, you see nine containerized services, each with their own pod. Instead of going into detail about these services now, you'll learn about them in context as you walk through this lab's scenarios.

</Step>

<Step>

View your services next:

<>

```bash
kubectl get services
[output] NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
[output] add-service ClusterIP 10.106.237.140 <none> 80/TCP 3m22s
[output] admin-service ClusterIP 10.101.252.142 <none> 80/TCP 3m22s
[output] fetch-service ClusterIP 10.105.255.200 <none> 80/TCP 3m22s
[output] frontend-service LoadBalancer 10.110.241.254 10.110.241.254 80:30183/TCP 3m22s
[output] gateway-service LoadBalancer 10.100.146.125 10.100.146.125 80:30605/TCP 3m22s
[output] kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3m27s
[output] manipulation-service ClusterIP 10.105.191.228 <none> 80/TCP 3m22s
[output] moderate-service ClusterIP 10.97.33.66 <none> 80/TCP 3m22s
[output] mysql ClusterIP 10.111.4.242 <none> 3306/TCP 3m22s
[output] upload-service ClusterIP 10.98.220.212 <none> 80/TCP 3m22s
```

</>

Here, you see your Kubernetes services. Notice that most of your app services have a corresponding Kubernetes service. One of these services is particularly important: `frontend-service`. This is a `LoadBalancer` that you connect to when you view your site.

</Step>

<Step>

Speaking of viewing your site, do that now by opening the `EXTERNAL_IP` that you see for `frontend-service` in your browser:

![TinyHat.me](../../../images/pixie/frontend.png)

</Step>

<Step>

Select a number of hats to display and a hat type. Then, select **Hat Me**:

![TinyHat.me showing a picture of Bob Ross with cat ears](../../../images/pixie/cat-ears-bob.png)

Now Bob Ross is wearing the hat(s) that you selected. Cool, right?

</Step>

</Steps>

With a better understanding of your cluster's resources and your website, you're better prepared to install Pixie and use it to monitor and debug your application when problems arise.

<Callout variant="course" title="lab">

This procedure is part of a course that teaches you how to monitor your Kubernetes cluster with Pixie. Now that you've explored your cluster, [instrument it with Pixie](/collect-data/pixie/instrument-cluster).

</Callout>
41 changes: 41 additions & 0 deletions src/markdown-pages/collect-data/pixie-lab/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
path: '/collect-data/pixie'
title: 'Monitor your Kubernetes cluster with New Relic and Pixie'
template: 'LabOverviewTemplate'
description: 'Monitor your Kubernetes cluster with New Relic and Pixie'
---

<Intro>

You’re the developer of TinyHat.me, a website and API for putting virtual hats on virtual heads that runs in kubernetes. But TinyHat has big problems. It’s time to instrument your cluster with [Pixie](https://docs.newrelic.com/docs/auto-telemetry-pixie/get-started-auto-telemetry-pixie/) and use it to find the source of your users’ frustrations.

<Video id="Z9a7jPrkxzE" type="youtube"/>

</Intro>

<div style="display: flex;">

<div style="flex: 1;">

## Objectives

- Instrument your kubernetes cluster with New Relic + Pixie
- Use PxL scripts in the Live Debugger to gather insights into your cluster’s behaviors
- Find the root cause of two bugs in your software

</div>

<div style="flex: 1;">

## Requirements

- A free [New Relic account](https://newrelic.com/signup?utm_source=developer-site)
- [Minikube](https://v1-18.docs.kubernetes.io/docs/tasks/tools/install-minikube/)
- [Helm 3](https://helm.sh/docs/intro/install/)
- [Hyperkit](https://minikube.sigs.k8s.io/docs/drivers/hyperkit/) (for Mac) or [KVM2](https://minikube.sigs.k8s.io/docs/drivers/kvm2/) (Linux) minikube driver

</div>

</div>

<br />
152 changes: 152 additions & 0 deletions src/markdown-pages/collect-data/pixie-lab/instrument.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
path: '/collect-data/pixie/instrument-cluster'
duration: '15 min'
title: 'Instrument your cluster'
template: 'GuideTemplate'
description: 'Instrument your cluster'
procIdx: 3
---

<Callout variant="course" title="lab">

This procedure is part of a lab that teaches you how to monitor your Kubernetes cluster with Pixie.

Each procedure in the lab builds upon the last, so make sure you've completed the last procedure, [_Explore your cluster_](/collect-data/pixie/explore-cluster), before starting this one.

</Callout>

As the developer of TinyHat.me, you need to have visibility into your cluster. You need to know how healthy your application is. You need to know when things go wrong. But you've put it off for so long because instrumenting Kubernetes is hard and time-consuming. This is one of the things that makes Pixie so valuable.

Pixie is an open source, state of the art Kubernetes monitoring solution that provides:

- **Automatic** and **instant** baseline observability of your cluster
- Actionable, **code-level** insights of your applications

With Pixie's auto-telemetry, you'll [instrument your cluster](https://docs.newrelic.com/docs/auto-telemetry-pixie/install-auto-telemetry-pixie/) in minutes to get dynamic data such as protocol traces, resource metrics, and app metrics from your cluster—[all without an agent](https://docs.pixielabs.ai/about-pixie/pixie-ebpf/)!

<Callout variant="tip">

If you haven't signed into [New Relic](one.newrelic.com), do that now so you're ready to install Pixie into your cluster.

</Callout>

<Steps>

<Step>

Open [New Relic](https://one.newrelic.com). On the right side of the upper navigation bar, click **Add more data**:

![Arrow pointing to the add more data button](../../../images/pixie/add-more-data.png)

</Step>

<Step>

Click **Guided install**:

![Arrow pointing to the guided install button](../../../images/pixie/guided-install.png)

This walks you through the installation process.

</Step>

<Step>

Click **Kubernetes** to let New Relic guide you through instrumenting your Kubernetes cluster:

![Arrow pointing to the Kubernetes button](../../../images/pixie/kubernetes-install.png)

</Step>

<Step>

Click **Begin installation**:

![Arrow pointing to the begin installation button](../../../images/pixie/begin-installation.png)

</Step>

<Step>

Select your account, name your cluster "tiny-hat", and click **Continue**:

![Box highlighting the account and cluster name fields](../../../images/pixie/account-and-cluster.png)

This specifies that TinyHat.me, and all its services, should live in a New Relic cluster called "tiny-hat" in the account you selected.

</Step>

<Step>

Leave the default choices on the next screen. These provide a range of observability features for your cluster. Notably, the default options include "Instant service-level insights, full-body requests, and application profiles through Pixie" which you focus on in this lab.

If you see the option, read and accept the **Terms of Service and Privacy Notice for Pixie** and click **Continue**:

![Box highlighting Pixie instrumentation](../../../images/pixie/pixie-instrumentation.png)

In the next screen, you see a command for installing our Kubernetes integration into your cluster.

</Step>

<Step>

Click **Copy command**:

![Arrow pointing to the copy command button](../../../images/pixie/helm.png)

Now you're ready to install Pixie into your cluster.

</Step>

<Step>

Switch back to your terminal and paste the Helm command.

</Step>

<Step>

While you're installing Pixie, switch back to New Relic and click **Continue** to progress your guided installation to the final step. Here, you see a message that says "Listening for data":

![New Relic page showing listening for data](../../../images/pixie/listening.png)

In a few minutes, Helm will have fully installed the necessary charts. You should see a message with the name, deployed date, namespace, and more:

<>

```bash copyable=false
[output] NAME: newrelic-bundle
[output] LAST DEPLOYED: Thu Sep 23 13:50:24 2021
[output] NAMESPACE: newrelic
[output] STATUS: deployed
[output] REVISION: 1
[output] TEST SUITE: None
```

</>

Soon after that, the New Relic page updates to tell you that we're receiving data from your cluster:

![New Relic page showing a successful install](../../../images/pixie/successful-install.png)

</Step>

<Step>

Click **Kubernetes cluster explorer** to see your nodes, pods, deployments and a host of other data about your cluster, all in one view:

![New Relic cluster explorer](../../../images/pixie/cluster-explorer.png)

Remember that you didn't have to install language-specific agents or specify hardly any data about your cluster during installation. Pixie was able to do figure it all out in minutes! On top of all the data you see in the cluster explorer, click a pod or a node to dig deeper and see the granular data that Pixie was able to access near-instantly:

![Pod data collected by Pixie](../../../images/pixie/pod-data.png)

</Step>

</Steps>

<Callout variant="course" title="lab">

This procedure is part of a lab that teaches you how to monitor your Kubernetes cluster with Pixie. Now that you've instrumented your cluster, [use Pixie to debug your application](/collect-data/pixie/scenario-1).

</Callout>
Loading

0 comments on commit b7f7c19

Please sign in to comment.