
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Reflector是一个Kubernetes插件,旨在监控secrets和configmaps资源的变化,并将这些变化反映到同一或其他命名空间的镜像资源中。支持amd64、arm和arm64架构。
如果需要帮助或发现bug,请在GitHub上提交Issue(https://github.com/emberstack/kubernetes-reflector/issues%EF%BC%89%E3%80%82
Reflector可通过手动方式或使用Helm(推荐)进行部署。
使用Helm部署
使用Helm安装最新发布的chart:
shellsession$ helm repo add emberstack https://emberstack.github.io/helm-charts $ helm repo update $ helm upgrade --install reflector emberstack/reflector
可通过以下参数自定义Helm部署的值:
| 参数 | 描述 | 默认值 |
|---|---|---|
nameOverride | 覆盖发布名称 | "" |
fullnameOverride | 覆盖发布全名 | "" |
image.repository | 容器镜像仓库 | emberstack/kubernetes-reflector |
image.tag | 容器镜像标签 | 与chart版本相同 |
image.pullPolicy | 容器镜像拉取策略 | IfNotPresent |
configuration.logging.minimumLevel | 日志最低级别 | Information |
rbac.enabled | 创建并使用RBAC资源 | true |
serviceAccount.create | 创建ServiceAccount | true |
serviceAccount.name | ServiceAccount名称 | 发布名称 |
livenessProbe.initialDelaySeconds | livenessProbe初始延迟 | 5 |
livenessProbe.periodSeconds | livenessProbe周期 | 10 |
readinessProbe.initialDelaySeconds | readinessProbe初始延迟 | 5 |
readinessProbe.periodSeconds | readinessProbe周期 | 10 |
resources | 资源限制 | {} |
nodeSelector | 用于pod分配的节点标签 | {} |
tolerations | 用于pod分配的容忍标签 | [] |
affinity | 用于pod分配的节点亲和性 | {} |
在Artifact Hub上查看更多信息
手动部署
每个发布版本(可在GitHub的https://github.com/emberstack/kubernetes-reflector/releases%E9%A1%B5%E9%9D%A2%E6%89%BE%E5%88%B0%EF%BC%89%E5%8C%85%E5%90%AB%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2%E6%96%87%E4%BB%B6%EF%BC%88%60reflector.yaml%60%EF%BC%89%EF%BC%9A
shellsession$ kubectl -n kube-system apply -f https://github.com/emberstack/kubernetes-reflector/releases/latest/download/reflector.yaml
secret或configmapreflector.v1.k8s.emberstack.com/reflection-allowed: "true",以允许向镜像资源反射。reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "<列表>",以仅允许从逗号分隔的命名空间列表或正则表达式中进行反射。注意:若省略此注解或为空,则允许所有命名空间。自动创建镜像
Reflector可自动在其他命名空间中创建同名镜像资源,以下注解控制创建行为:
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"以自动创建镜像(需reflection-allowed为true)。reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "<列表>"以指定自动创建镜像的命名空间(若省略或为空,允许所有命名空间,且需通过reflection-allowed-namespaces检查)。重要提示:删除源资源时自动镜像会被删除;关闭反射/自动镜像功能或命名空间不再匹配时,自动镜像也会被删除。 重要提示:创建自动镜像时会跳过冲突资源,若目标命名空间已存在同名资源,将跳过并记录警告。
源secret示例:
yamlapiVersion: v1 kind: Secret metadata: name: source-secret annotations: reflector.v1.k8s.emberstack.com/reflection-allowed: "true" reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "namespace-1,namespace-2,namespace-[0-9]*" data: ...
源configmap示例:
yamlapiVersion: v1 kind: ConfigMap metadata: name: source-config-map annotations: reflector.v1.k8s.emberstack.com/reflection-allowed: "true" reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "namespace-1,namespace-2,namespace-[0-9]*" data: ...
secret或configmap向镜像对象添加reflector.v1.k8s.emberstack.com/reflects: "<源命名空间>/<源名称>"注解,值为源对象的命名空间/名称格式全名。
注意:手动修改镜像时(如通过
helm部署),添加reflector.v1.k8s.emberstack.com/reflected-version: ""可重置反射版本。
镜像secret示例:
yamlapiVersion: v1 kind: Secret metadata: name: mirror-secret annotations: reflector.v1.k8s.emberstack.com/reflects: "default/source-secret" data: ...
镜像configmap示例:
yamlapiVersion: v1 kind: ConfigMap metadata: name: mirror-config-map annotations: reflector.v1.k8s.emberstack.com/reflects: "default/source-config-map" data: ...
Reflector将监控源对象变化并复制以下字段:
data字段data和binaryData字段cert-manager支持自cert-manager 1.5版本起,可通过secretTemplate为证书创建的secrets添加注解实现镜像(参见[***]
yamlapiVersion: cert-manager.io/v1 kind: Certificate ... spec: secretTemplate: annotations: reflector.v1.k8s.emberstack.com/reflection-allowed: "true" reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "" ...
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务