Error: failed to sync source k8s: failed to fetch resources from stream: rpc error: code = Unknown desc = failed to sync resources: failed to create execution client for source plugin k8s: could not find any context. Try to add context, https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration
Hi @unified-reptile, welcome to the channel! If possible, could you paste your CloudQuery configuration you are using here with any sensitive information redacted?
I’m currently looking into it, a couple of things stand out. The version of the plugin looks to be fairly old if you are using v3.0.1. I recommend updating to the latest if possible v5.0.8. The other thing I’m looking into is what will happen if you configure an empty context. I think you are safe to leave this configuration line out when running CQ inside of a k8s cluster.
@martin Yes, I have an old version and that is being used in other environments also.
The only thing is, in other environments we defined the kube config manually and deployed that as a secret, and mounted it in the pod.
But here I am trying to achieve the same with a service account.
A weird thing I am noticing is that the service account token inside the pod under /var/run/secrets/kubernetes.io/serviceaccount/token is different than the secret token that is created after deploying the service account.
In your CQ source plugin configuration, is the context set to a list with a single empty string or did you redact that? Since you are seeing the error message at line 115 in this code snippet, I’m trying to understand how the context configuration you are providing is being interpreted.
My current recommendations are to:
i) Add [..., "--log-level", "debug"] to your container arguments to see the debug messaging that provides some more information.
ii) Try with the contexts configuration removed from your spec in the source plugin configuration - this should use the default context with this configuration.
@martin Context is set to * only.
I am not copying any kube config file or anything else.
I want my service account to take care of kube authentication.
Also, the command is already running with --log-level, debug. @martin Thanks!
I guess service account support started after 3.1.0. Change Log
I will try to update and see.
Thanks for your support!