webpagetest-agent

by joaquinito2051

Helm chartv0.2.0App 2018-01-23

A Helm chart for Kubernetes

About this chart

WebPageTest Agent

WebPageTest is a website testing tool

TL;DR;

$ helm install <helm-repo>/webpagetest-agent

$ helm install incubator/webpagetest-agent

Introduction

This chart deploys WebPageTest Private Instance Containers deployment on a Kubernetes cluster using the Helm package manager.

Depending on your configuration you can then use Official WPT agent instances to test your websites.

Prerequisites

  • Kubernetes 1.4+ with Beta APIs enabled

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/webpagetest-agent

$ helm install --name my-release incubator/webpagetest-agent The command deploys a WebPageTest agent on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation. Please note the default install probably won't do much without some configuration of the values.yaml file.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the WordPress chart and their default values.

ParameterDescriptionDefault
image.repositoryWebPageTest agent imagetimothyclarke/wptagent
image.tagWebPageTest agent tag2018-01-23
image.pullPolicyImage pull policyIfNotPresent
agent.keyAPI Key for agent to auth the masternil
agent.serverHostname of the WPT server (see below)agent-web-page-test.local
agent.locationWPT location tagTest
agent.shaperTraffic shaping method the agent usesnone
nodeSelectorNode labels for pod assignment{}

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install --name my-release \
  --set agent.key=SecretKey \
    <helm-repo>/webpagetest-agent
$ helm install --name my-release \

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml <helm-repo>/webpagetest-agent

$ helm install --name my-release -f values.yaml incubator/webpagetest-agent

Tip: You can use the default values.yaml

Ingress

There are none. This is a worker node. The standard operation is for it to poll the WebPageTest Server for work.

WebPageTest Server Config

At time of writing this chart the server has two means of config

  • Log onto the server and use vim or similar
  • Use the AWS/EC2 init scripts to configure some values, the login and use vim ir similar to configure the rest As such these charts will get an environment up and working, but if you want more than defaults you will need to write your own config maps or update the WebPageTest Source for either the server or the agent

Defaults

A default install of the server will have a location of 'Test' with a blank key. This config makes use of that. To use different values you will probably need to update settings/locations.ini and or settings/keys.ini on the WebPageTest server.

agent.server

You'll probably want to update this one. This is the host header that the agent will use to speak to the master.

agent.shaper

This is the method that the agent will use to throttle bandwidth or add latency. Some methods require root access. The default method did not work when this chart was being created so a value of 'none' was selected to disable this feature.

agent.key

The API key is used by the agent to authenticate itself to the WebPageTest server.

agent.location

This is the WebPageTest location to use. This needs to match something in settings/locations.ini

Future

  • Integrate with webpagetest-server and embed along with correct creation of keys

Deploy webpagetest-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has webpagetest-agent on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartwebpagetest-agent is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply