如何在Kubernetes群集中使用Flux指定上下文?

发布于 2025-02-09 01:42:56 字数 1054 浏览 1 评论 0原文

我正在关注

kustomize

flux bootstrap github --context=staging --owner=${GITHUB_USER} --repository=${GITHUB_REPO} --branch=main --personal --path=clusters/staging

示例

✗ context "staging" does not exist

helm

输出来源全部 Flux获取所有

NAME                        REVISION        SUSPENDED   READY   MESSAGE                                                                        
gitrepository/flux-system   main/3fabbc2    False       True    stored artifact for revision 'main/3fabbc21c473f479389790de8d1daa20d207ebd6'    
gitrepository/podinfo       master/132f4e7  False       True    stored artifact for revision 'master/132f4e719209eb10b9485302f8593fc0e680f4fc'  

如何创建上下文的资源?

I am following
Kustomize helm example

With original tutorial command

flux bootstrap github --context=staging --owner=${GITHUB_USER} --repository=${GITHUB_REPO} --branch=main --personal --path=clusters/staging

I got

✗ context "staging" does not exist

This is what watch helmrelease shows
enter image description here

Output sources all
flux get sources all

NAME                        REVISION        SUSPENDED   READY   MESSAGE                                                                        
gitrepository/flux-system   main/3fabbc2    False       True    stored artifact for revision 'main/3fabbc21c473f479389790de8d1daa20d207ebd6'    
gitrepository/podinfo       master/132f4e7  False       True    stored artifact for revision 'master/132f4e719209eb10b9485302f8593fc0e680f4fc'  

How to create context?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老街孤人 2025-02-16 01:42:56

您需要设置context = $ {k8s_cluster_context} rel =“ nofollow noreferrer”>类型所以我有- context = kind-kind否则您运行

export K8S_CLUSTER_CONTEXT=kind-kind

flux bootstrap github \
 --context=${K8S_CLUSTER_CONTEXT}
 --owner=${GITHUB_USER} \
 --repository=${GITHUB_REPO} \
 --branch=main \
 --personal \
 --path=clusters/staging

You need to set the context=${K8S_CLUSTER_CONTEXT} for example, I am using Kind so I have --context=kind-kind or you run

export K8S_CLUSTER_CONTEXT=kind-kind

flux bootstrap github \
 --context=${K8S_CLUSTER_CONTEXT}
 --owner=${GITHUB_USER} \
 --repository=${GITHUB_REPO} \
 --branch=main \
 --personal \
 --path=clusters/staging
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文