Flux: cannot patch secrets in the namespace kube-system

Created on 16 Jan 2019  路  5Comments  路  Source: fluxcd/flux

git clone https://github.com/weaveworks/flux
cd flux
kubectl apply -f deploy

...

kubectl logs -f flux-7b4dbb76d6-mg45j
ts=2019-01-16T12:56:39.059459979Z caller=main.go:153 version=1.9.0
ts=2019-01-16T12:56:39.136186881Z caller=main.go:237 err="secrets \"flux-git-deploy\" is forbidden: User \"system:serviceaccount:kube-system:flux\" cannot patch secrets in the namespace \"kube-system\""
question

Most helpful comment

Or: if you're applying the manifests in a namespace other than default, you'll need to edit this line: https://github.com/weaveworks/flux/blob/master/deploy/flux-account.yaml#L37 so that the ClusterRoleBinding refers to the right service account.

All 5 comments

Looks like your kubectl is set with kube-system as the default namespace. The deploy yamls only work when running Flux in the default namespace. Delete Flux from kube-system and install it with kubectl -n default apply -f deploy

Or: if you're applying the manifests in a namespace other than default, you'll need to edit this line: https://github.com/weaveworks/flux/blob/master/deploy/flux-account.yaml#L37 so that the ClusterRoleBinding refers to the right service account.

You are right. I was in kube-system by mistake ...

but with helm chart seems you create a flux namespace ... why don't do it by default without helm as well ?

You should be able to install the Helm chart in whichever namespace you want. The same is true of the example deployments, it just takes some manual work.

Was this page helpful?
0 / 5 - 0 ratings