mongodb/mongodb-atlas-kubernetes-operator-prerelease本镜像为MongoDB Atlas Operator的内部专用构建版本,专为公司内部CI(持续集成)流水线设计,未对外公开分发。该镜像基于官方MongoDB Atlas Operator核心功能开发,针对CI环境进行了适配优化,确保在自动化测试流程中高效运行。
从内部Docker仓库拉取镜像:
bashdocker pull internal-docker-registry.example.com/mongodb/atlas-operator:ci-latest
| 环境变量名 | 描述 | 是否必填 | 示例值 |
|---|---|---|---|
ATLAS_PUBLIC_KEY | MongoDB Atlas API公钥 | 是 | pk-xxxxxx |
ATLAS_PRIVATE_KEY | MongoDB Atlas API私钥 | 是 | sk-xxxxxx |
ATLAS_PROJECT_ID | Atlas目标项目ID | 是 | 62fxxxxxxxxx123 |
KUBERNETES_NAMESPACE | 部署命名空间(K8s环境) | 否 | ci-test |
LOG_LEVEL | 日志级别(debug/info/warn/error) | 否 | info |
DEBUG_MODE | 是否启用调试模式 | 否 | false(默认)/true |
bashdocker run -d \ --name atlas-operator-ci \ -e ATLAS_PUBLIC_KEY="pk-xxxxxx" \ -e ATLAS_PRIVATE_KEY="sk-xxxxxx" \ -e ATLAS_PROJECT_ID="62fxxxxxxxxx123" \ -e LOG_LEVEL="debug" \ internal-docker-registry.example.com/mongodb/atlas-operator:ci-latest
创建docker-compose.yml:
yamlversion: '3.8' services: atlas-operator: image: internal-docker-registry.example.com/mongodb/atlas-operator:ci-latest environment: - ATLAS_PUBLIC_KEY=pk-xxxxxx - ATLAS_PRIVATE_KEY=sk-xxxxxx - ATLAS_PROJECT_ID=62fxxxxxxxxx123 - LOG_LEVEL=info - DEBUG_MODE=false ports: - "8080:8080" # 健康检查端口 restart: unless-stopped volumes: - ./ci-config:/etc/operator/config # 挂载自定义配置(可选)
启动命令:
bashdocker-compose up -d
bashkubectl create namespace ci-test
bashkubectl create secret generic atlas-credentials -n ci-test \ --from-literal=publicKey=pk-xxxxxx \ --from-literal=privateKey=sk-xxxxxx
yaml# atlas-operator-ci.yaml apiVersion: apps/v1 kind: Deployment metadata: name: mongodb-atlas-operator namespace: ci-test spec: replicas: 1 selector: matchLabels: app: atlas-operator template: metadata: labels: app: atlas-operator spec: containers: - name: operator image: internal-docker-registry.example.com/mongodb/atlas-operator:ci-latest env: - name: ATLAS_PROJECT_ID value: "62fxxxxxxxxx123" - name: LOG_LEVEL value: "info" - name: ATLAS_PUBLIC_KEY valueFrom: secretKeyRef: name: atlas-credentials key: publicKey - name: ATLAS_PRIVATE_KEY valueFrom: secretKeyRef: name: atlas-credentials key: privateKey ports: - containerPort: 8080
应用部署配置:
bashkubectl apply -f atlas-operator-ci.yaml
检查容器状态:
bash# Docker环境 docker ps | grep atlas-operator-ci # Kubernetes环境 kubectl get pods -n ci-test
查看日志确认启动成功:
bash# Docker环境 docker logs atlas-operator-ci | grep "Operator started successfully" # Kubernetes环境 kubectl logs -n ci-test <operator-pod-name> | grep "Operator started successfully"
| 参数名 | 类型 | 描述 | 默认值 |
|---|---|---|---|
--log-level | 字符串 | 日志输出级别 | info |
--debug | 布尔值 | 启用调试模式 | false |
--metrics-port | 整数 | 指标暴露端口 | 8080 |
/var/log/atlas-operator/目录下的详细日志
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务