datawire/ambassador-envoy该镜像基于Envoy代理,集成了Ambassador的外部认证HTTP过滤器,旨在为服务网格或微服务架构中的服务提供便捷的外部认证解决方案。通过该镜像,用户可快速部署具备外部认证能力的代理服务,实现对HTTP请求的认证逻辑处理,增强服务访问的安全性。
主要用途:作为服务代理接收并处理HTTP请求,通过集成的Ambassador外部认证过滤器与外部认证服务交互,完成请求的认证校验,适用于需要集中管理认证逻辑的服务架构场景。
通过docker run命令快速启动容器,需挂载Envoy配置文件以启用外部认证过滤器:
bashdocker run -d \ --name envoy-auth-proxy \ -p 8080:8080 \ # 代理服务端口(接收客户端请求) -p 9901:9901 \ # Envoy管理端口(用于监控和配置查询) -v /host/path/to/envoy-config.yaml:/etc/envoy/envoy.yaml \ # 挂载本地Envoy配置文件 [镜像名称]
需在Envoy配置文件中定义外部认证过滤器,以下为关键配置片段:
yamlstatic_resources: listeners: - name: main address: socket_address: { address: 0.0.0.0, port_value: 8080 } filter_chains: - filters: - name: envoy.http_connection_manager typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager stat_prefix: ingress_http route_config: name: local_route virtual_hosts: - name: local_service domains: ["*"] routes: - match: { prefix: "/" } route: { cluster: target_service } # 目标服务集群 http_filters: # 外部认证过滤器(需放在router过滤器之前) - name: envoy.filters.http.ext_authz typed_config: "@type": type.googleapis.com/udpa.type.v1.TypedStruct type_url: type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz value: http_service: server_uri: uri: [***] # 外部认证服务地址(需替换为实际地址) cluster: auth_service_cluster # 认证服务集群名称 timeout: 5s # 认证请求超时时间 path_prefix: "/check" # 认证服务的请求路径 authorization_request: allowed_headers: patterns: - exact: "Authorization" # 允许传递给认证服务的请求头 failure_mode_allow: false # 认证服务不可用时是否允许请求通过(false为拒绝) # 路由过滤器(必须放在最后) - name: envoy.filters.http.router typed_config: {} clusters: - name: target_service # 目标服务集群(需替换为实际服务地址) connect_timeout: 0.25s type: STRICT_DNS lb_policy: ROUND_ROBIN load_assignment: cluster_name: target_service endpoints: - lb_endpoints: - endpoint: address: socket_address: { address: target-service, port_value: 80 } - name: auth_service_cluster # 认证服务集群(需与上述server_uri.cluster对应) connect_timeout: 0.25s type: STRICT_DNS lb_policy: ROUND_ROBIN load_assignment: cluster_name: auth_service_cluster endpoints: - lb_endpoints: - endpoint: address: socket_address: { address: auth-service, port_value: 8080 } # 认证服务地址
| 配置路径 | 描述 | 示例值 |
|---|---|---|
http_filters[].typed_config.value.http_service.server_uri.uri | 外部认证服务的完整URI | [***] |
http_filters[].typed_config.value.http_service.server_uri.timeout | 认证请求的超时时间 | 5s |
http_filters[].typed_config.value.http_service.path_prefix | 发送到认证服务的请求路径前缀 | /check |
http_filters[].typed_config.value.failure_mode_allow | 认证服务不可用时是否允许请求通过 | false(默认,拒绝请求)/ true(允许请求) |
http_filters[].typed_config.value.authorization_request.allowed_headers | 允许传递给认证服务的请求头 | [{ exact: "Authorization" }, { exact: "Cookie" }] |
-v参数挂载本地Envoy配置文件,配置文件中需正确定义外部认证过滤器及相关集群信息。--mode validate参数验证配置文件合法性:
bashdocker run --rm -v /host/path/to/envoy-config.yaml:/etc/envoy/envoy.yaml [镜像名称] --mode validate -c /etc/envoy/envoy.yaml
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
MacOS OrbStack 容器配置
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务