Movatterモバイル変換


[0]ホーム

URL:


Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceRecipesChangelogUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog InFeature Experimentation
Dev guide
All
Pages
Start typing to search…

Install Optimizely Agent

How to install Optimizely Agent on Linux, macOS, Windows, Docker, and Kubernetes.

Run Agent from source (Linux and macOS)

To develop and compile Optimizely Agent from source complete the following:

  1. InstallGolang version 1.20+.
  2. Clone theOptimizely Agent repository locally.
  3. From the repository directory, open a terminal and start Optimizely Agent.
make setup

Then run the following:

make run

This starts the Optimizely Agent with the default configuration in the foreground.

Run Agent from source (Windows)

You can use ahelper script to install the prerequisites (Golang and Git) and compile Agent in a Windows environment.

  1. Clone theOptimizely Agent repo locally.

  2. From the repo directory, open a Powershell terminal and run the following:

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser.\scripts\build.ps1.\bin\optimizely.exe

Run Agent locally with Docker

If you haveDocker installed, you can start Optimizely Agent as a container.

  1. Pull the Docker image.
    docker pull optimizely/agent
    By default, this will pull the "latest" tag. You can also specify a specific version of Agent by providing the version as a tag to the docker command.
    docker pull optimizely/agent:X.Y.Z
  2. Run the docker container with the following:
    docker run -p 8080:8080 --env OPTIMIZELY_LOG_PRETTY=true --env OPTIMIZELY_SERVER_HOST=0.0.0.0 --env OPTIMIZELY_SERVER_ALLOWEDHOSTS=127.0.0.1 optimizely/agent
    This will start Agent in the foreground and expose the container API port 8080 to the host.
  3. (Optional) You can alter the configuration by passing in environment variables to the preceding command without having to create aconfig.yaml file. Seeconfigure Optimizely Agent for more options.

Docker versions

When a new version is released, two images are pushed toDocker Hub. Their tags distinguish them:

  • :latest (same as :X.Y.Z)
  • :alpine (same as :X.Y.Z-alpine)

The difference between latest and alpine is that latest is builtFROM scratch while alpine isFROM alpine.

Run Agent in a Kubernetes cluster

If you runKubernetes as part of your infrastructure and haveHelm installed, you can easily host Optimizely Agent in your cluster using Optimizely'sHelm Chart.

  1. Add theoptimizely-agent Helm Chart from Optimizely's repository.

    helm repo add optimizely-agent https://optimizely.github.io/optimizely-agent-helm

    The output should be similar to the following:

    "optimizely-agent" has been added to your repositories
  2. Then, install the Optimizely Agent chart, giving your deployment a name likemy-agent.

    helm install my-agent optimizely-agent/agent

    The output should be similar to the following:

    NAME: my-agentLAST DEPLOYED: Tue Jul 12 18:24:27 2022NAMESPACE: defaultSTATUS: deployedREVISION: 1NOTES:*** Configuration Summary ***Name Override:   [no name override; using generated name]Full Name Override:   [no full name override; using generated full name]Image Used:   optimizely/agent:latestService Account:  [account name will be generated]Replica Count: 1Auto-Scaling:  [auto-scaling is disabled]Node Selector:  [no node selectors applied]Node Affinity:  [no node affinity applied]Node Tolerations:  [no node tolerations applied]Pod Annotations Applied:  [no annotations applied]Pod Security Context:  [no pod security context applied]Container Security Context:  [no container security context applied]Network Service:   Type: ClusterIP  Ports:    api: 8080 [internal] <== 8080 [external]    webhook: 8085 [internal] <== 8085 [external]    admin: 8088 [internal] <== 8088 [external]Network Ingress:    Run the following in a *nix terminal to access the running ClusterIP service IP address      export CLUSTER_IP=$(kubectl get svc --namespace default my-agent -o jsonpath='{.spec.clusterIP}')      echo http://$CLUSTER_IP:8080Resources:  [no resources declarations applied]Logging:  Level set to DEBUG with friendly formatting ON.  SDK Key WILL be included in logs.Environment Variables:  [no environment variables applied]Secrets:

NAME: my-agentLAST DEPLOYED: Tue Jul 12 18:24:27 2022NAMESPACE: defaultSTATUS: deployedREVISION: 1NOTES:*** Configuration Summary ***Name Override:   [no name override; using generated name]Full Name Override:   [no full name override; using generated full name]Image Used:   optimizely/agent:latestService Account:  [account name will be generated]Replica Count: 1Auto-Scaling:  [auto-scaling is disabled]Node Selector:  [no node selectors applied]Node Affinity:  [no node affinity applied]Node Tolerations:  [no node tolerations applied]Pod Annotations Applied:  [no annotations applied]Pod Security Context:  [no pod security context applied]Container Security Context:  [no container security context applied]Network Service:   Type: ClusterIP  Ports:    api: 8080 [internal] <== 8080 [external]    webhook: 8085 [internal] <== 8085 [external]    admin: 8088 [internal] <== 8088 [external]Network Ingress:    Run the following in a *nix terminal to access the running ClusterIP service IP address      export CLUSTER_IP=$(kubectl get svc --namespace default my-agent -o jsonpath='{.spec.clusterIP}')      echo http://$CLUSTER_IP:8080Resources:  [no resources declarations applied]Logging:  Level set to DEBUG with friendly formatting ON.  SDK Key WILL be included in logs.Environment Variables:  [no environment variables applied]Secrets:
  1. (Optional) You can change the default values in the chart by modifying the--values using a custom YAML file or individually when you--set flags directly in thehelm install command. Seemodifying values in the GitHub Readme for more options.

Updated 17 days ago



[8]ページ先頭

©2009-2025 Movatter.jp