【发布时间】:2021-02-10 16:51:02
【问题描述】:
我有一个 GitHub Actions 工作流程,用于替换部署清单中的值。我使用kubectl patch --local=true 来更新图像。直到现在,这曾经完美无缺。今天,工作流开始失败,出现Missing or incomplete configuration info 错误。
我正在运行带有--local 标志的kubectl,因此不需要配置。有谁知道kubectl突然开始需要配置的原因是什么?我在 Kubernetes GitHub 问题中找不到任何有用的信息,而且谷歌搜索数小时也无济于事。
GitHub Actions 工作流程中失败步骤的输出:
Run: kubectl patch --local=true -f authserver-deployment.yaml -p '{"spec":{"template":{"spec":{"containers":[{"name":"authserver","image":"test.azurecr.io/authserver:20201230-1712-d3a2ae4"}]}}}}' -o yaml > temp.yaml && mv temp.yaml authserver-deployment.yaml
error: Missing or incomplete configuration info. Please point to an existing, complete config file:
1. Via the command-line flag --kubeconfig
2. Via the KUBECONFIG environment variable
3. In your home directory as ~/.kube/config
To view or setup config directly use the 'config' command.
Error: Process completed with exit code 1.
kubectl version的输出:
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.0",
GitCommit:"ffd68360997854d442e2ad2f40b099f5198b6471", GitTreeState:"clean",
BuildDate:"2020-11-18T13:35:49Z", GoVersion:"go1.15.0", Compiler:"gc",
Platform:"linux/amd64"}
【问题讨论】:
-
好像你的 kube 上下文没有设置。检查你得到了什么
kubectl config current-context -
我收到了
error: current-context is not set。我看到的问题是我想在本地修补文件,为此我不需要上下文集。还是我弄错了?
标签: kubernetes kubectl github-actions