fleet: fleet-agent cannot find secret in local cluster in Rancher single-install setup
run rancher:master-0f691dc70f86bbda3d6563af11779300a6191584-head
in the single-install mode
The following line floods the log of the pod fleet-agent-7dfdfd5846-xjw96
time="2020-09-15T00:18:30Z" level=info msg="Waiting for secret fleet-clusters-system/c-09ea1d541bf704218ec6fc9ab2d60c0392543af636c1c3a90793946522685 for request-2vz49: secrets \"c-09ea1d541bf704218ec6fc9ab2d60c0392543af636c1c3a90793946522685\" not found"
gz#14319
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 30 (11 by maintainers)
I finally managed to find a workaround for it:
Note: you can directly use your generated Kubeconfig, but as it is shared with others, it is safer to create a new one, that can be revoked in case…
Now, fleet-controller should have the correct secret and start deploying fleet-agent on the cluster “c-xyz123”.
But there is definitely a Bug, that prevents creation of this secret. For us, 2 out of 4 clusters were automatically imported, while the others were not.
The main difference is, that the non working clusters were created a long time ago (shortly after Rancher 2 release).
The reason is absence of
authn.management.cattle.io/kind=agent
label on agent tokens for old clusters. So execute on local clusterkubectl label tokens agent-${agent user name} 'authn.management.cattle.io/kind=agent'
and wait forrancher-operator
to complete your cluster configuration (may be around 20 minutes). Agent user name can be found inkubectl get users -o custom-columns=NAME:.metadata.name,PrincipalIDs:.principalIds
by pricipalsystem://${cluster name}
.see:
I tested with minified
cacerts.pem
file where I put only required certs for our infrastructure and it works!But I was initially confused because ca-bundle it’s kind of default which comes with a package
ca-certificates
and where is no such limitation mentioned in documentation.