
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
?) in this text to find pending decisions. Search for TODO to find pending work.Kubernetes Assert is our re-think of https://github.com/Yolean/build-contract, for Kubernetes. As usual we don't write tooling. We com***e mainstream stuff that we find lean enough.
Summary:
skaffold devassertions_failed.kubectl -n monitoring exec alertmanager-main-0 -c alertmanager -- wget -qO- http://127.0.0.1:9093/api/v2/alerts | jq
or the web interface, or a pager.The idea is that any container that exports an assertions_failed counter (OR gauge?) is a test.
Obviously the metric needs to be scraped, and your team must be alerted about any(?) non-zeroness.
Integration test results are inherently less ***ary than unit tests. You may want to tweak the parameters for alerting, maybe on a per test basis.
There won't be any tests if the dev loop is unpleasant. Our idea of a good dev loop is that while you're editing your specs, they re-run on save and you'll see the test output.
The goal however is that tests run unattended, and reliably call for your attention when they fail. At that point you'll want to know which test suite and test run that failed, and see the output.
Assu***ions:
skaffold run is the CI tool.deploy section has been applied (you'll do the waiting), and the given context's current namespace is all yours.
We recommend using a runtime for tests to a) minimize bolerplate and b) aid "common code ownership" for specs by enforcing a structure.
Our first runtime for Kubernets Assert is based on https://jestjs.io/:
assertions_failed. Specs are free to https://www.npmjs.com/package/prom-client#counter other metrics of any kind.How are specs delivered to the runtime?
/usr/src/specs(?). See example TODO.
--watch (i.e. the runtime's skaffold dev) requires source to be in a git repo. A git init with no commits is fine, but remember to include your .gitignore.dependencies
(feel free to have utility .js files alongside specs) they need to be mounted or copied to /usr/src/specs/src(?)How to avoid boilerplate?
- github.com/Yolean/kubernetes-assert/runtime-nodejs/kustomize/?ref=[your choice].skaffold init. See example TODO.Assuming that github.com/coreos/prometheus-operator/?ref=[a recent revision] is already installed,
start from the example kustomize base:
kubectl apply -k example-small kubectl -n monitoring create -k kubernetes-mixin-dashboards kubectl apply -k grafana
Note how Prometheus will match rules and monitors using the label(s) that the kustomization.yaml adds.
A real stack might start from example-small and then:
now to a bit longerThis repo needs to have some generated content, where upstream kustomize bases could not be found
docker-compose -f docker-compose.test.yml build --no-cache kubernetes-mixin docker-compose -f docker-compose.test.yml up --no-build kubernetes-mixin
WIP
docker volume rm kubernetes-monitoring_admin 2> /dev/null || true ./test.sh
WIP. We tend to use https://github.com/y-stack/ystack but when working with test (in particular failing ones) it might help to reuse the CI stack.
compose='docker-compose -f docker-compose.test.yml -f docker-compose.dev-overrides.yml' $compose down \ ;docker volume rm kubernetes-monitoring_admin kubernetes-monitoring_k3s-server 2>/dev/null || true sudo rm test/.kube/kubeconfig.yaml $compose up -d sut export KUBECONFIG=$PWD/test/.kube/kubeconfig.yaml
git push # wait for https://hub.docker.com/r/solsson/kubernetes-assert, then YOLEAN_PROMOTE=true IMAGE_NAME=solsson/kubernetes-assert:latest ./hooks/build # update examples so that people get started from refs grep -A 1 bases: runtime-nodejs/example-project/kustomization.yaml grep FROM runtime-nodejs/example-project/Dockerfile # validate examples
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务