Richard Rublev
Richard Rublev

Reputation: 8170

How to specify context with Flux in Kubernetes cluster?

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?

Upvotes: 1

Views: 676

Answers (1)

Rob
Rob

Reputation: 1183

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

Upvotes: 1

Related Questions