The Devaten-service is a Keptn service that is responsible for collecting database statistics performed while test sequence executed using Devaten endpoints.
We are going to install the service in the same cluster that Keptn is running in. Checkout also the installation option for Keptn on K3s.
Before Devaten-service installation there are some prerequisite need to follow.
apiVersion: apps/v1 kind: Deployment metadata: name: AGENT_DATABASE_NAME-agent spec: replicas: 1 selector: matchLabels: app: AGENT_DATABASE_NAME-agent template: metadata: labels: app: AGENT_DATABASE_NAME-agent spec: containers: - name: AGENT_DATABASE_NAME-agent image: devaten/IMAGE_NAME:latest ports: - containerPort: 8111
kubectl apply -f devaten-agent.yaml -n keptn
3. After deploying the agent check the logs of agent using below command and copy Agent unique id.
kubectl logs -f deployment/AGENT_DEPLOYMENT_NAME -n keptn
###################################################### Agent Unique Id : 9604729ADE98MONGO-AGENT-DEPLOY-XXXXXXXXXX-9D882190-MONGODB ######################################################
Visit to Devaten and log in.
Click on Agent -> Agent Management in the side menu and fill the form. Paste the Agent Unique Id (9604729ADE98MONGO-AGENT-DEPLOY-XXXXXXXXXX-9D882190-MONGODB) in the Agent Unique Id field.
Click on save to add agent.
Click on Application -> Application Management and click on the New Application Button on the page.
3. Click on save to add agent.
# You can find Host Url using this command
kubectl get pods -o wide -n sockshop-dev
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
carts-db-54b449c598-kxggb 1/1 Running 0 62d 10.42.1.20 <== Host Url k3d-mykeptn-agent-0
carts-76b56b96dd-g9djp 1/1 Running 0 3h6m 10.42.1.54 k3d-mykeptn-agent-0
6. Click on Test Connection after successful connection Click on save connection.
Now we will deploy the devaten Service in the Keptn Cluster.
kubectl create secret generic devaten --from-literal="devaten_username=YOUR_DEVATEN_USERNAME" --from-literal="devaten_password=YOUR_DEVATEN_PASSWORD" -n keptn
git clone https://github.com/keptn-sandbox/devaten-service.git
deploy/service.yaml
file.
kubectl apply -f service.yaml -n keptn
kubectl -n keptn logs -f deployment/Devaten-service -c Devaten-service
Subscribing to deployment.triggered Subscribing to test.triggered Found environment variables KEPTN_ENDPOINT and KEPTN_API_TOKEN, polling events from API Found environment variables DEVATEN_USERNAME, DEVATEN_PASSWORD, DEVATEN_ENDPOINT INFO --> Devaten authentication successful. Starting to poll... Exit using CTRL-C
To enable the prometheus monitoring with Devaten service we need to add scrape jobs to prometheus configmap. But before that we need to setup the prometheus monitoring for that follow this document Setup Prometheus Monitoring
.
kubectl edit configmap prometheus-server -n monitoring
scrape_configs:
.
... job_name: devaten-service honor_timestamps: false scrape_interval: 10s scrape_timeout: 10s metrics_path: /metrics scheme: http static_configs: - targets: - Devaten-service.keptn.svc:8080 ...
kubectl port-forward svc/prometheus-server 8080:80 -n monitoring
Prometheus is then available on localhost:8080/targets
where you can see the targets for the service:
The Devaten-service expects Devaten application identifier file in the project specific keptn repo.
NOTE:
It is mandatory to provide Devaten_app_identifier.txt
before triggering delivery.
Here is an example on how to upload the Devaten_app_identifier.txt
file via keptn CLI to the project sockshop:
keptn add-resource --project=sockshop --resource=Devaten_app_identifier.txt
For executing performance or functional test use locust-service or any other service so Devaten can collect database statistics.
Now trigger a delivery for carts service.
keptn trigger delivery --project=sockshop --service=carts --image=docker.io/keptnexamples/carts --tag=0.12.3
kubectl
: kubectl apply -f deploy/service.yaml
kubectl
: kubectl delete -f deploy/service.yaml
kubectl
: kubectl -n keptn get deployment devaten-service -o wide
kubectl
: kubectl -n keptn logs deployment/devaten-service -f devaten-service
kubectl
: kubectl -n keptn get pods -l run=devaten-service
To delete the devaten-service, delete using the deploy/service.yaml
file:
kubectl delete -f deploy/service.yaml
Please find more information in the LICENSE file.
Copyright © 2024 Devaten, All rights reserved.