Hi, I’m trying to run a cloudquery k8s sync for an on-prem kubernetes cluster and it is failing with below error. kindly I’ve given the source and destination yaml files that we have used for syncing cloudquery
Command used: cloudquery sync source.yml destination.yml --log-console --log-level error --log-format json
source.yml
kind: source
spec:
name: "k8s"
path: "cloudquery/k8s"
version: "v6.1.2"
registry: cloudquery
destinations: ["postgresql"]
tables: ["*"]
spec:
kubeconfig_path: "./kubeconfig.yaml"
contexts: []
destnation.yml
kind: destination
spec:
name: "postgresql"
path: "cloudquery/postgresql"
version: "v7.1.2"
write_mode: "overwrite-delete-stale"
migrate_mode: "safe"
spec:
connection_string: "postgresql://xxxxxxxx"
Cloudquery CLI Version: v5.20.5
Error:
{"level":"error","module":"cli","invocation-id":"xxxxxxxxx","grpc.code":"Internal","grpc.component":"server","grpc.error":"rpc error: code = Internal desc = failed to init plugin: failed to initialize client: failed to build k8s RES config for context \"default\": unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined","grpc.method":"Init","grpc.method_type":"unary","grpc.service":"cloudquery.plugin.v3.Plugin","grpc.start_time":"2025-07-01T19:49:30+05:30","grpc.time_ms":"5.058","message":"finished call","peer.address":"@","protocol":"grpc","time":"2025-07-01T14:19:30Z"}
Error: failed to sync v3 source k8s: failed to init source k8s: rpc error: code = Internal desc = failed to init plugin: failed to initialize client: failed to build k8s RES config for context "default": unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
{"level":"error","module":"cli","invocation-id":"=xxxxxxxx","error":"failed to sync v3 source k8s: failed to init source k8s: rpc error: code = Internal desc = failed to init plugin: failed to initialize client: failed to build k8s RES config for context \"default\": unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined","time":"2025-07-01T14:19:30Z","message":"exiting with error"}
Any quick help would be appreciated.
Thank you!!!