In this example, Let`s deploy an Ingress used to expose Nginx web app to public.
We will add annotations on it to run a HTTP Server test monitoring Cisco DevNet homepage.
- 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
- Install Nginx Ingress Controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
- Check the Ingress pod status
kubectl get pods -A | grep ingress-nginx ingress-nginx ingress-nginx-admission-create-2n62c 0/1 Completed 0 66s ingress-nginx ingress-nginx-admission-patch-fwnlg 0/1 Completed 1 66s ingress-nginx ingress-nginx-controller-68649d49b8-62zvc 1/1 Running 0 66s
Now we are ready to run a test.
Two options to run a HTTP Server test.
Ingress: config/samples/annotations/ingress_httpserver_default_settings.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
# the unique test name
name: ingress-httpserver
annotations:
thousandeyes.devnet.cisco.com/test-type: http-server
thousandeyes.devnet.cisco.com/test-url: https://developer.cisco.com/
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-service
port:
number: 80
All the other settings will use default values
-
Create a HTTP Server Test
kubectl apply -f config/samples/annotations/ingress_httpserver_default_settings.yaml
The test will be created on dashboard.
-
Update the HTTP Server test url
Modify
thousandeyes.devnet.cisco.com/test-url
in config/samples/annotations/ingress_httpserver_default_settings.yaml and redeploy.kubectl apply -f config/samples/annotations/ingress_httpserver_default_settings.yaml
You will find the url has been updated.
-
Delete the HTTP Server test
Set
thousandeyes.devnet.cisco.com/test-type
tonone
in config/samples/annotations/ingress_httpserver_removal.yaml and redeploy.kubectl apply -f config/samples/annotations/ingress_httpserver_removal.yaml
The test will be removed from ThousandEyes dashboard.
This annotation follows HTTPServer CR Spec definition
Ingress: config/samples/annotations/ingress_httpserver_customized_settings.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
# the unique test name
name: ingress-httpserver
annotations:
thousandeyes.devnet.cisco.com/test-type: http-server
thousandeyes.devnet.cisco.com/test-spec: |
{
"url":"https://developer.cisco.com/",
"interval": 1800,
"agents": [
{"agentName":"Tokyo, Japan (Trial)"},
{"agentName":"Singapore (Trial) - IPv6"}
],
"alertRules": [
{"ruleName":"Default HTTP Alert Rule"}
]
}
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-service
port:
number: 80
-
Create a HTTP Server test
kubectl apply -f config/samples/annotations/ingress_httpserver_customized_settings.yaml
The test will be created on dashboard.
-
Update the settings of the HTTP Server test
Modify
thousandeyes.devnet.cisco.com/test-spec
in config/samples/annotations/ingress_httpserver_customized_settings.yaml and redeploy.kubectl apply -f config/samples/annotations/ingress_httpserver_customized_settings.yaml
You will find the settings have been updated.
-
Delete the HTTP Server test
Set
thousandeyes.devnet.cisco.com/test-type
tonone
in config/samples/annotations/ingress_httpserver_removal.yaml and redeploy.kubectl apply -f config/samples/annotations/ingress_httpserver_removal.yaml
The test will be removed from ThousandEyes dashboard.