sumologic/nginx-unprivileged本镜像复制自 nginxinc/nginx-unprivileged 镜像,专门用于 Sumo Logic Kubernetes Collection 组件,作为其数据采集流程中的辅助服务。镜像保持了原非特权 NGINX 的核心特性,通过非 root 用户运行 NGINX 进程,以满足 Kubernetes 环境下的安全合规要求,同时为 Sumo Logic 采集器提供轻量级的 HTTP 服务能力(如反向代理、静态资源托管、请求转发等)。
本镜像主要适用于 Kubernetes 集群环境中,作为 Sumo Logic Kubernetes Collection 的辅助组件,典型使用场景包括:
通过 docker run 命令可直接启动镜像,基本示例如下:
bashdocker run -d \ --name sumologic-nginx-unprivileged \ -p 8080:8080 \ # 非特权镜像默认使用 8080 端口(替代 root 镜像的 80 端口) -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro \ # 挂载自定义 NGINX 配置文件 sumologic/nginx-unprivileged # 假设镜像名称为 sumologic/nginx-unprivileged(具体以实际为准)
在 Kubernetes 环境中,通常作为 Sumo Logic 采集器 Pod 的 sidecar 容器运行,示例 Deployment 片段如下:
yamlapiVersion: apps/v1 kind: Deployment metadata: name: sumologic-collector namespace: sumologic spec: template: spec: containers: - name: nginx-unprivileged image: sumologic/nginx-unprivileged # 本镜像 ports: - containerPort: 8080 # 非特权端口 volumeMounts: - name: nginx-config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf - name: nginx-logs mountPath: /var/log/nginx # 日志挂载至持久化存储或日志采集路径 securityContext: runAsUser: 101 # 匹配镜像默认非特权用户 UID runAsGroup: 101 allowPrivilegeEscalation: false volumes: - name: nginx-config configMap: name: sumologic-nginx-config # 包含 NGINX 配置的 ConfigMap - name: nginx-logs emptyDir: {} # 或使用持久卷
本镜像支持通过环境变量调整 NGINX 运行参数(基于 nginxinc/nginx-unprivileged 特性):
| 环境变量 | 描述 | 默认值 |
|---|---|---|
NGINX_HTTP_PORT | HTTP 服务监听端口(非特权端口,>1024) | 8080 |
NGINX_HTTPS_PORT | HTTPS 服务监听端口(非特权端口) | 8443 |
NGINX_USER | 运行 NGINX 的用户 UID | 101 |
NGINX_GROUP | 运行 NGINX 的用户组 GID | 101 |
NGINX_LOG_DIR | 日志文件存储路径 | /var/log/nginx |
NGINX 配置可通过挂载自定义 nginx.conf 或配置片段实现。例如,为 Sumo Logic 采集器配置反向代理规则:
nginx# 自定义 nginx.conf 示例(用于转发采集器 API 请求) worker_processes auto; events { worker_connections 1024; } http { server { listen 8080; # 匹配环境变量 NGINX_HTTP_PORT server_name sumologic-collector-proxy; location /metrics { proxy_pass [***] # 转发至采集器 metrics 端点 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } }
挂载该配置文件至容器:
bashdocker run -d \ -v $(pwd)/custom-nginx.conf:/etc/nginx/nginx.conf:ro \ sumologic/nginx-unprivileged
101(默认),挂载宿主机目录时需确保该用户有读/写权限。
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务