Akamai Edge Worker
Deploying the Levo.ai Akamai Edge Worker enables advanced API traffic capture and analysis, ensuring seamless integration with your Akamai-powered setup. This guide walks you through the prerequisites, deployment, and configuration of the Edge Worker.
Prerequisites
Before deploying the Edge Worker, ensure the following requirements are met:
- Akamai DNS Configuration: Your website’s DNS must be managed through Akamai.
- Permissions: Ensure you have sufficient permissions on Akamai to create and configure EdgeWorkers for your property.
- Levo Satellite Setup:
- Confirm that the Levo Satellite is set up and is accessible via HTTPS from the EdgeWorker.
- Ensure that the Satellite's domain is served through the Akamai platform by configuring an A record or a CNAME in Akamai's DNS settings.
- Refer to the Satellite Installation Guide for Levo Satellite setup instructions and Manage DNS Records for DNS configuration in Akamai.
- Organization ID: Obtain your Organization ID from the Levo dashboard. Refer to Accessing Organization ID for details.
Deploying the Edge Worker
Using the CLI
Follow the steps below to deploy the EdgeWorker using the CLI.
1. Setup Akamai CLI and Edge Workers
- Install Akamai CLI:
- Ensure you have installed Akamai CLI.
- On Windows you may need to add
akamai.exelocation toPathenvironment variable.
- On Windows you may need to add
- Ensure you have installed Akamai CLI.
- Install EdgeWorker CLI:
- Run this command to install the EdgeWorkers CLI
akamai install edgeworkers.
- Run this command to install the EdgeWorkers CLI
- Set Up Authentication:
- Ensure you have required authentication credentials (e.g., access token and client secret), available on Akamai's Identity & Access Management page.
- For detailed instructions, refer to Akamai Setup Authentication Credentials.
2. Create EdgeWorker ID
- Navigate to CDN > EdgeWorkers in the Akamai Control Center.
- Click Create EdgeWorker ID and fill in the required details:
- Name for EdgeWorker ID
- Resource Tier
- Any other details as required
- Click Create.
- For more details, refer to Create Akamai EdgeWorker ID.
3. Set Up EdgeWorker
- Clone the EdgeWorker repository
git clone https://github.com/levoai/akamai-worker.git. - Navigate into the repository
cd akamai-worker. - Copy the example environment file
cp .env.example .env - Configure the following environment variables in the .env file:
AKAMAI_WORKER_IDAKAMAI_WORKER_NETWORKAKAMAI_WORKER_VERSION_INCREMENT(optional)
- Prepare the EdgeWorker for deployment:
yarn worker:version:prepare(increments version). - Deploy and activate the EdgeWorker:
yarn worker:version:deploy(uploads and activates the code bundle).
Note:
src\bundle.jsoncontains bundle metadata.
4. Add EdgeWorker Behavior to Your Akamai Property
- Login to the Akamai Control Center.
- Navigate to CDN > Properties from left-hand menu.
- Select the property you want to configure and click Edit New Version.
- Under Property Variables, add following variables.
LEVOAI_SATELLITE_URL- The URL of the Satellite where the traffic will be sent.LEVOAI_ORG_ID- Your organization ID.LEVOAI_ENV- The desired environment name. Optional, default isstaging.LEVOAI_SERVICE_NAME- The name of the service you are monitoring. Optional.LEVOAI_SAMPLE_RATE- The sample rate for capturing traffic. Optional, default is1(100%).
Note: These variables are prefixed with PMUSER_ in this section.
- Under Property Configuration Settings, go to > Rules > Behaviors, and:
- Enable EdgeWorkers behavior.
- Select the appropriate EdgeWorker ID.
- Save your changes and activate the property for Staging and/or Production.
That's it!
Your EdgeWorker is now deployed and integrated with your Akamai property. Monitor and analyze your API traffic using the Levo.ai platform. For further support, feel free to reach out to support@levo.ai.