Skip to content

Template repo for Hands on demos: Kubernetes + doc stack

License

Notifications You must be signed in to change notification settings

Dynatrace/demo-kubernetes-template

Codespace template for a Kubernetes stack

Stuck? Email [email protected] and we can help.

Use this template to bootstrap your Kubernetes-based hands on cloud environment.

Includes a documentation stack (mkdocs) in the docs folder.

Installing docstack

pip install -r requirements-docs.txt

Start docs:

mkdocs serve -a localhost:8000
# or python -m mkdocs serve -a localhost:8000

Usage Tracking

There are two places you will most likely want to track usage:

  1. When the demo is spun up
  2. For each documentation page (tracking whether docs are actually used or people are getting stuck)

1. Demo Spin Up

image

After the system spins up, the postCreateCommand is fired. It is up to you to code logic to fire a log / metric / bizevent to Dynatrace to signal the demo has started.

Here is an example of sending a bizevent at startup (the utils method is triggered from environment_installer.py which itself is triggered from the postCreateCommand) to Dynatrace via a Lambda function (so that the codespace doesn't need an API token to send this bizevent).

2. Documentation Usage

image

When you run mkdocs gh-deploy, the docs are automatically built, pushed and hosted at a GitHub pages domain (like this). You will need to create a Dynatrace agentless application and replace the dummy snippet in this file.

Next, you will use the dynatrace.sendBizEvent Javascript method to fire a single event on each page load. Do this by including a snippet on each markdown page (we have given some sample snippets, but you may need to create more). These snippets live in this folder.

Don't forget to rebuild and push your docs: mkdocs gh-deploy

Enabling Asana Integration

Unless you're devrel team, you probably don't need this, so feel free to delete the GitHub Action workflow file.

There is a GitHub action which fires whenever a GitHub issue is opened and create a new task in Asana for a given workspace and project.

To set this up, your new repo needs to have 3x GitHub Action Secrets created (settings > secrets and variables > Actions > New repository secret)

  • ASANA_PAT (how to generate an Asana PAT)
  • ASANA_WORKSPACE (when you're on the Home page it's the ID after /home/ eg. 2222 in https://app.asana.com/0/home/2222)
  • ASANA_PROJECT (when you're on a project page it's the first URL portion: eg. 1234 in https://app.asana.com/0/1234/5678)

About

Template repo for Hands on demos: Kubernetes + doc stack

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks