A Kubernetes operator for managing Akamai Properties through the Property Manager API. This operator is OLM (Operator Lifecycle Manager) compatible and allows you to manage Akamai edge delivery configurations as Kubernetes custom resources.
- Declarative Property Management: Define Akamai properties as Kubernetes custom resources
- Full Lifecycle Management: Create, update, and delete Akamai properties through Kubernetes
- Hostname Management: Automatic management of property hostnames and edge hostname assignments
- OLM Compatible: Can be installed and managed through Operator Lifecycle Manager
- EdgeGrid Authentication: Secure authentication using Akamai EdgeGrid
- Status Reporting: Real-time status updates with property versions and deployment state
- Rule Configuration: Support for complex property rules, behaviors, and criteria
- Automatic Activation: Optional automatic activation to staging and production networks
- Kubernetes cluster (v1.19+)
- Akamai API credentials with Property Manager permissions
kubectlconfigured to access your cluster
# Install OLM if not already installed
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/install.sh | bash -s v0.25.0
# Install the Akamai Operator
kubectl apply -f https://github.com/mmz-srf/akamai-operator/releases/latest/download/akamai-operator.yaml# Clone the repository
git clone https://github.com/mmz-srf/akamai-operator.git
cd akamai-operator
# Install CRDs
make install
# Deploy the operator
make deployCreate a secret with your Akamai API credentials:
kubectl create secret generic akamai-credentials \
--from-literal=host="akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net" \
--from-literal=client_token="akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx" \
--from-literal=client_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--from-literal=access_token="akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx" \
--namespace=akamai-operator-systemNote: The operator watches for cluster-scoped AkamaiProperty resources across all namespaces, but the operator itself and its credentials are deployed in the akamai-operator-system namespace.
Create a sample property configuration:
apiVersion: akamai.com/v1alpha1
kind: AkamaiProperty
metadata:
name: my-website
spec:
propertyName: "my-website.com"
contractId: "ctr_C-1234567"
groupId: "grp_12345"
productId: "prd_Fresca"
hostnames:
- cnameFrom: "my-website.com"
cnameTo: "my-website.com.edgesuite.net"
certProvisioningType: "CPS_MANAGED"
rules:
name: "default"
behaviors:
- name: "origin"
options:
originType: "CUSTOMER"
hostname: "origin.my-website.com"
forwardHostHeader: "REQUEST_HOST_HEADER"
activation:
network: "PRODUCTION"
notifyEmails:
- "[email protected]"Apply the configuration:
kubectl apply -f my-property.yamlCheck the status of your property:
# List all Akamai properties
kubectl get akamaiproperties
# Get detailed status
kubectl describe akamaiproperty my-websiteThe AkamaiProperty custom resource supports the following specifications:
propertyName: Name of the Akamai propertycontractId: Akamai contract ID (format:ctr_C-XXXXXXX)groupId: Akamai group ID (format:grp_XXXXX)productId: Akamai product ID (e.g.,prd_Fresca)
hostnames: Array of hostname configurationsrules: Property rules configuration with behaviors and criteriaedgeHostname: Edge hostname configurationactivation: Activation configuration for deploying the property to Akamai networks
The operator fully manages property hostnames, automatically detecting changes and updating property versions when hostnames are added, removed, or modified.
hostnames:
- cnameFrom: "www.example.com"
cnameTo: "example.com.edgesuite.net"
certProvisioningType: "CPS_MANAGED"
- cnameFrom: "api.example.com"
cnameTo: "example.com.edgekey.net"
certProvisioningType: "CPS_MANAGED"Fields:
cnameFrom(required): The hostname to serve through AkamaicnameTo(required): The edge hostname targetcertProvisioningType(optional): Certificate provisioning type (CPS_MANAGEDorDEFAULT)
See HOSTNAME_MANAGEMENT.md for detailed documentation.
The rules system supports nested rules with criteria and behaviors:
rules:
name: "default"
behaviors:
- name: "origin"
options:
originType: "CUSTOMER"
hostname: "origin.example.com"
children:
- name: "Static Assets"
criteria:
- name: "fileExtension"
options:
matchOperator: "IS_ONE_OF"
values: ["css", "js", "png"]
behaviors:
- name: "caching"
options:
behavior: "MAX_AGE"
ttl: "7d"The operator supports automatic activation of properties to Akamai's staging and production networks:
activation:
# Target network: STAGING or PRODUCTION
network: "STAGING"
# Email addresses to notify when activation status changes
notifyEmails:
- "[email protected]"
- "[email protected]"
# Descriptive note for the activation
note: "Automated activation via Kubernetes operator"
# Skip acknowledging individual warnings (default: false)
acknowledgeAllWarnings: true
# Enable fast metadata push (default: true)
fastPush: true
# Ignore HTTP errors during fast metadata push (default: true)
ignoreHttpErrors: true
# Use fast fallback for quick rollback within 1 hour (default: false)
useFastFallback: falseActivation Process:
- Automatic Activation: When an
activationsection is specified, the operator will automatically activate new property versions - Status Tracking: The operator tracks activation status and updates the resource status accordingly
- Network Support: Supports both
STAGINGandPRODUCTIONnetworks - Notifications: Email notifications are sent based on the
notifyEmailsconfiguration - Rollback Support: Fast fallback can be enabled for quick rollback within one hour of activation
Activation Status Fields:
The operator provides detailed activation status in the resource status:
stagingVersion: Currently active version on stagingproductionVersion: Currently active version on productionstagingActivationId: ID of the current staging activationproductionActivationId: ID of the current production activationstagingActivationStatus: Status of staging activation (PENDING, ACTIVE, FAILED)productionActivationStatus: Status of production activation (PENDING, ACTIVE, FAILED)
The operator uses Akamai EdgeGrid authentication. You need to provide the following credentials:
- Host: Your API endpoint hostname
- Client Token: Your client token
- Client Secret: Your client secret
- Access Token: Your access token
These can be obtained from the Akamai Control Center under "Identity & Access Management" > "API User".
apiVersion: akamai.com/v1alpha1
kind: AkamaiProperty
metadata:
name: basic-website
spec:
propertyName: "basic-website.com"
contractId: "ctr_C-1234567"
groupId: "grp_12345"
productId: "prd_Fresca"
hostnames:
- cnameFrom: "basic-website.com"
cnameTo: "basic-website.com.edgesuite.net"
rules:
name: "default"
behaviors:
- name: "origin"
options:
originType: "CUSTOMER"
hostname: "origin.basic-website.com"
activation:
network: "PRODUCTION"
notifyEmails:
- "[email protected]"See config/samples/akamai_v1alpha1_akamaiproperty.yaml for a comprehensive example.
kubectl logs -n akamai-operator-system deployment/akamai-operator-controller-managerThe operator reports detailed status information:
status:
propertyId: "prp_123456"
latestVersion: 2
stagingVersion: 1
productionVersion: 1
phase: "Ready"
conditions:
- type: "Ready"
status: "True"
reason: "PropertyReady"
message: "Property is ready"- Authentication Errors: Verify your API credentials are correct
- Contract/Group Not Found: Ensure the contract and group IDs are valid
- Property Creation Failed: Check the operator logs for detailed error messages
# Clone the repository
git clone https://github.com/mmz-srf/akamai-operator.git
cd akamai-operator
# Build the operator
make build
# Run tests
make test
# Build Docker image
make docker-build IMG=your-registry/akamai-operator:latestThe project includes comprehensive unit tests for all major functionality:
# Run all tests
go test ./...
# Run with verbose output
go test ./... -v
# Run with coverage
go test ./... -coverSee Testing Documentation for detailed information about available tests and how to write new ones.
# Install CRDs
make install
# Run the operator locally
make runWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the Apache License 2.0. See LICENSE for details.
For support questions, please:
- Check the troubleshooting guide
- Review existing issues
- Create a new issue with detailed information
For Akamai API questions, consult the Property Manager API documentation.
