ThousandEyes Kubernetes Operator
ThousandEyes Kubernetes Operator is a Kubernetes operator used to manage ThousandEyes Tests deployed via Kubernetes cluster.
It is built using the Operator SDK, which is part of the Operator Framework.
Table of Contents
Supported Test Types
ThousandEyes Kubernetes Operator supports managing the following test types.
More types will be supported in the future.
Installation
Prerequisites
- Access to working kubernetes cluster (version
>=1.18.0
) and local kubectl cli. Docker desktop kubernetes, Minikube or kind are some of popular options to setup local kubernetes cluster.
- Trial account for ThousandEyes
Deploy ThousandEyes Kubernetes Operator
-
Clone the project
git clone https://github.com/CiscoDevNet/thousandeyes-kubernetes-operator.git
cd thousandeyes-kubernetes-operator
-
Get OAuth Bearer Token from ThousandEyes dashboard
If this token has been generated, you can get it from your admin or revoke it to create a new one.
-
Update the OAuth bearer token
Encode the token in base64
echo -n "YOUR_OAUTH_BEARER_TOKEN" | base64
Modify OAuthBearerToken (base64 encoded) in config/deploy/thousandeyes_kubernetes_operator.yaml
-
Install the operator
kubectl apply -f config/deploy/thousandeyes_kubernetes_operator.yaml
-
Verify installation status
i. Check ThousandEyes Kubernetes Operator pod status
kubectl get pods | grep thousandeyes
NAME READY STATUS RESTARTS AGE
devnet-thousandeyes-kubernetes-operator-564b5d75d-jllzk 1/1 Running 0 108s
ii. Check ThousandEyes CRD status
kubectl get crd | grep thousandeyes
NAME CREATED AT
annotationmonitorings.thousandeyes.devnet.cisco.com 2021-07-07T15:44:40Z
httpservertests.thousandeyes.devnet.cisco.com 2021-07-07T15:44:41Z
pageloadtests.thousandeyes.devnet.cisco.com 2021-07-07T15:44:42Z
webtransactiontests.thousandeyes.devnet.cisco.com 2021-07-07T15:44:44Z
Quick Start
Let`s run a Nginx web app, then create a Page Load test to monitor this app
-
Create a Nginx web app
kubectl apply -f config/samples/nginx.yaml
-
Check the Nginx pod status
kubectl get pods -A | grep nginx
default nginx-6976ddb986-rxqv6 1/1 Running 0 12s
-
Expose Nginx service to Internet Using ngrok
kubectl apply -f config/samples/ngrok.yaml
-
Check the ngrok pod status
kubectl get pods -A | grep ngrok
default ngrok-5dfd559764-zx9r7 1/1 Running 0 7s
-
Get the public URL of this web app
./config/samples/public_url.sh
Your public URL for Nginx web app is similar to:
https://9c5f-64-104-125-230.eu.ngrok.io
-
Access this app
Open your favorite browser and navigate to the public URL.
You should see the Nginx welcome page which means you have run the app successfully.
-
Update your public URL in config/samples/pageload_cr.yaml
-
Apply the page load test CR
kubectl apply -f config/samples/pageload_cr.yaml
-
Go to ThousandEyes dashboard
You will find this test on ThousandEyes dashboard.
Advanced Usage
For advanced usage, please refer to the following documentations:
- Create a Kubernetes Custom Resource
- Annotate Kubernetes Ingress / Service
Reference
- ThousandEyes Getting Started
- ThousandEyes Test MetaData