
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://circleci.com/gh/battleforcastile/battleforcastile-match-recorder/tree/master.svg?style=svg](https://circleci.com/gh/battleforcastile/battleforcastile-match-recorder/tree/master)
这是一个处理《Battle For Castile》游戏匹配记录流程的微服务,支持在Google Cloud环境中通过Kubernetes(K8s)集群和PostgreSQL数据库部署。
适用于《Battle For Castile》游戏的后端服务,用于记录和管理玩家之间的匹配数据,确保游戏匹配记录的可靠存储与查询。
本指南假设已在Google Cloud中设置好K8s集群和PostgreSQL数据库。由于Google Cloud仅允许通过代理容器访问其数据库,需先设置代理用户。
请先激活以下API:https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview?project=678954142891
若已从该组织设置过其他微服务,可省略1.1-1.5步骤(代理用户创建)。
bashgcloud iam service-accounts create proxy-user --display-name "proxy-user"
bashgcloud iam service-accounts list
bashgcloud projects add-iam-policy-binding <project> --member \ serviceAccount:<service_account_email> --role roles/cloudsql.client
bashgcloud iam service-accounts keys create key.json --iam-account <service_account_email>
bashopenssl base64 < key.json | tr -d '\n'
接下来需设置Helm以简化集群中的发布部署。
bashhelm init --history-max 200 kubectl create serviceaccount --namespace kube-system tiller kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
/helm/battleforcastile-match-recorder/文件夹,将templates-examples中的内容复制到templatesbashcp helm/battleforcastile-match-recorder/templates-examples/* helm/battleforcastile-match-recorder/templates/*
templates目录下battleforcastile-match-recorder-cloudsql-instance-credentials.yml的注释,并替换:credentials.json的值为之前记录的key.json的base64值templates目录下battleforcastile-match-recorder-secrets.yml的注释,并替换:secret_key的值为Flask应用密钥的base64值(可随机生成)sqlalchemy_database_uri的值为Google Cloud数据库URI的base64值(格式如postgresql+pg8000://<db_user>:<db_password>@127.0.0.1:5432/<database_name>)/helm/battleforcastile-match-recorder/values.yml,将instance_connection_name替换为从Google Cloud获取的值(格式如<project>:<zone>:<sql_instance_name>)bashhelm install helm/battleforcastile-match-recorder
几分钟后即可完成部署!
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务