
Odigos Autoscaler Service镜像是Odigos项目的核心组件之一,专注于实现服务的自动扩缩容功能。该镜像通过监控服务负载指标(如CPU、内存使用率)或自定义业务指标,动态调整服务实例数量,从而在保障服务性能稳定的同时,最大化资源利用率。
通过以下命令快速启动容器:
bashdocker run -d \ --name odigos-autoscaler \ -p 8080:8080 \ -e SCALING_POLICY=default \ -e MIN_REPLICAS=2 \ -e MAX_REPLICAS=10 \ -e METRIC_PROVIDER=prometheus \ -e PROMETHEUS_ENDPOINT=http://prometheus:9090 \ -v /path/to/local/config:/etc/odigos/autoscaler \ odigos/autoscaler:latest
| 环境变量 | 描述 | 默认值 |
|---|---|---|
SCALING_POLICY | 扩缩容策略名称(对应配置文件) | default |
MIN_REPLICAS | 最小实例数 | 1 |
MAX_REPLICAS | 最大实例数 | 5 |
METRIC_PROVIDER | 指标数据源类型(如prometheus) | prometheus |
PROMETHEUS_ENDPOINT | Prometheus服务地址(当使用Prometheus时必填) | - |
COOLDOWN_SCALE_UP | 扩容冷却时间(秒) | 300 |
COOLDOWN_SCALE_DOWN | 缩容冷却时间(秒) | 600 |
TARGET_CPU_USAGE | CPU使用率目标阈值(百分比) | 70 |
TARGET_MEM_USAGE | 内存使用率目标阈值(百分比) | 80 |
yamlversion: '3.8' services: odigos-autoscaler: image: odigos/autoscaler:latest container_name: odigos-autoscaler ports: - "8080:8080" environment: - SCALING_POLICY=ecommerce - MIN_REPLICAS=3 - MAX_REPLICAS=15 - METRIC_PROVIDER=prometheus - PROMETHEUS_ENDPOINT=http://prometheus:9090 - COOLDOWN_SCALE_UP=180 - COOLDOWN_SCALE_DOWN=300 volumes: - ./autoscaler-config:/etc/odigos/autoscaler restart: unless-stopped depends_on: - prometheus prometheus: image: prom/prometheus:latest volumes: - ./prometheus-config:/etc/prometheus ports: - "9090:9090"
通过挂载配置文件目录(如/etc/odigos/autoscaler),可定义精细化扩缩容策略(YAML格式),示例ecommerce.yaml:
yamlpolicy: name: ecommerce scaleUpRules: - metric: http_requests_per_second threshold: 1000 scaleBy: 2 evaluationPeriods: 3 - metric: cpu_usage threshold: 85 scaleBy: 1 evaluationPeriods: 2 scaleDownRules: - metric: http_requests_per_second threshold: 200 scaleBy: 1 evaluationPeriods: 5 cooldown: scaleUp: 180s scaleDown: 300s
在Kubernetes集群中,可通过Deployment部署并结合ConfigMap管理策略配置:
yamlapiVersion: apps/v1 kind: Deployment metadata: name: odigos-autoscaler namespace: odigos spec: replicas: 1 selector: matchLabels: app: odigos-autoscaler template: metadata: labels: app: odigos-autoscaler spec: containers: - name: odigos-autoscaler image: odigos/autoscaler:latest ports: - containerPort: 8080 env: - name: SCALING_POLICY value: "ecommerce" - name: KUBERNETES_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace volumeMounts: - name: policy-config mountPath: /etc/odigos/autoscaler volumes: - name: policy-config configMap: name: odigos-scaling-policies --- apiVersion: v1 kind: ConfigMap metadata: name: odigos-scaling-policies namespace: odigos data: ecommerce.yaml: | policy: name: ecommerce scaleUpRules: - metric: http_requests_per_second threshold: 1000 scaleBy: 2 scaleDownRules: - metric: http_requests_per_second threshold: 200 scaleBy: 1
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务