# Need help with CloudQuery custom plugin documentation for Windows or Linux

**URL:** <https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168>\
**Category:** CloudQuery Plugins\
**Created:** [July 1, 2024, 12:35pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168 "2024-07-01T12:35:24Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 1, 2024, 12:35pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/1 "2024-07-01T12:35:24Z")

</div>

Hi, I’m trying to create a custom plugin in GoLang, but I’m having issues related to the OS type. The documentation provided is only for MacOS, and I couldn’t find any documentation related to Windows or Linux. Can anyone please share the documentation for Linux or Windows, or let me know if it’s even possible?

[CloudQuery Documentation](https://docs.cloudquery.io/docs/developers/creating-new-plugin/go-source)

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 1, 2024, 12:37pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/2 "2024-07-01T12:37:15Z")

</div>

Hey 👋 Which part of these docs are you struggling with? Most of the instructions should be OS-agnostic.

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 1, 2024, 1:38pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/3 "2024-07-01T13:38:38Z")

</div>

Hi, @mariano. The document mentioned above contains macOS commands for creating a custom plugin, but I don’t have access to a macOS. Is it possible to create a custom plugin without using macOS?

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 1, 2024, 1:40pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/4 "2024-07-01T13:40:49Z")

</div>

It is certainly possible to create custom plugins on Linux/Windows. The instructions should be mostly identical. Can you give me an example of a step you couldn’t do in your OS?

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 1, 2024, 1:44pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/5 "2024-07-01T13:44:01Z")

</div>

I don’t have any documentation or related information to create a custom plugin in Windows/Linux for CloudQuery. I can’t seem to find the related documents. If you have any documents on how to create a custom plugin, could you please share them, like the above documentation for Mac OS?

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 1, 2024, 1:44pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/6 "2024-07-01T13:44:50Z")

</div>

I’m saying you should be able to use the same article.

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 1, 2024, 1:48pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/7 "2024-07-01T13:48:10Z")

</div>

okay I got it. I will get back to you if I face any further issues. Thank you.

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 2, 2024, 9:03am UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/8 "2024-07-02T09:03:58Z")

</div>

Hi, @mariano,

This is for Mac OS:

[YouTube Link](https://youtu.be/3Ka_Ob8E6P8?si=iDKsnddx2JHoMHye)

Do you have any documentation or video for doing this in Linux or Windows?

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 2, 2024, 9:39am UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/9 "2024-07-02T09:39:56Z")

</div>

Hey 👋 I think the only part of that video that is Mac-specific is the installation of the tools (`cloudquery` & `scaffold`). The rest of it is just coding on an IDE and then building, running, and testing in a terminal, which should be roughly the same in Linux or Windows.

If you want instructions for installing the tools in a different OS, they are here:  
[Linux Quickstart](https://docs.cloudquery.io/docs/quickstart/linux)  
[Windows Quickstart](https://docs.cloudquery.io/docs/quickstart/windows)

I reviewed these quickstart instructions, and while they tell you how to install the `cloudquery` CLI, they don’t really spell out where to get `scaffold`. You can download the latest `scaffold` version for your OS here:  
[Download Scaffold](https://github.com/cloudquery/cloudquery/releases/tag/scaffold-v3.0.20)

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 4, 2024, 4:46am UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/10 "2024-07-04T04:46:02Z")

</div>

```auto
[root@ip-10-129-6-17 environment]# cq-scaffold --verbose source CloudAdmin Cloudquery_Custom_Plugin
[root@ip-10-129-6-17 environment]# ls -l
total 38344
-rw-r--r--. 1 ec2-user ec2-user 569 Jun 25 03:09 README.md
-rwxr-xr-x. 1 root root 35581952 Jul 4 03:44 cloudquery
-rwxr-xr-x. 1 root root 3678208 Jun 25 14:33 cq-scaffold
[root@ip-10-129-6-17 environment]# cd cq-source-Cloudquery_Custom_Plugin
-bash: cd: cq-source-Cloudquery_Custom_Plugin: No such file or directory
[root@ip-10-129-6-17 environment]# go mod tidy
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
[root@ip-10-129-6-17 environment]# 

```

I am facing this issue.

> **[Creating a New CloudQuery Source Plugin in Go | CloudQuery](https://docs.cloudquery.io/docs/developers/creating-new-plugin/go-source)**
>
> Learn how to write a new CloudQuery source plugin from scratch in Go.

Could you please help me out @mariano?

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 4, 2024, 9:19am UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/11 "2024-07-04T09:19:30Z")

</div>

Could you try it without the `--verbose` flag? I tried to reproduce your results. If I try with `verbose`, I get an error, and if I try without it, it works well.  
I tested with the latest version:

```auto
$ cq-scaffold --version ⏱ 10:21:45
scaffold version 3.0.20

```

But I also originally tested with a slightly older version I had installed (3.0.15), and I get the same results. Just as a sanity check that `cq-scaffold` is not broken.

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 10, 2024, 11:38am UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/12 "2024-07-10T11:38:32Z")

</div>

Hi, @mariano

I am using the Kubernetes source plugin and Postgres destination plugin.

Now I am trying to sync the `k8s_core_pods` table, but I am getting the following error:

```auto
cloudquery sync k8s.yml postgres.yml --log-console --log-level error
2024-07-10T11:36:56Z ERR finished call grpc.code=Internal grpc.component=server grpc.error="rpc error: code = Internal desc = failed to init plugin: failed to initialize client: context \"context\" doesn't exist in kube configuration" grpc.method=Init grpc.method_type=unary grpc.service=cloudquery.plugin.v3.Plugin grpc.start_time=2024-07-10T11:36:56Z grpc.time_ms=3.846 invocation-id=e26bed3c-fa69-4df2-acaf-c801ef8716eb module=cli peer.address=@ protocol=grpc
Error: failed to sync v3 source k8s_6169124300 failed to init source k8s_6169124300: rpc error: code = Internal desc = failed to init plugin: failed to initialize client: context "context" doesn't exist in kube configuration
2024-07-10T11:36:57Z ERR exiting with error error="failed to sync v3 source k8s_6169124300: failed to init source k8s_6169124300: rpc error: code = Internal desc = failed to init plugin: failed to initialize client: context \"context\" doesn't exist in kube configuration" invocation-id=e26bed3c-fa69-4df2-acaf-c801ef8716eb module=cli

```

Could you please help me out to resolve this error?

**k8s.yml file:**

```yaml
kind: source
spec:
  # Source spec section
  name: k8s_6169124300
  path: cloudquery/k8s
  registry: cloudquery
  version: "v6.1.4"
  tables: ["k8s_core_pods"]
  destinations: ["postgresql"]
  # # Learn more about the configuration options at https://cql.ink/k8s_source
  spec:
    contexts: ["context"]

```

**postgres.yml:**

```yaml
kind: destination
spec:
  name: "postgresql"
  path: "cloudquery/postgresql"
  registry: "cloudquery"
  version: "v8.2.5"
  spec:
    connection_string: "XXXXXX"

```

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 10, 2024, 1:12pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/13 "2024-07-10T13:12:28Z")

</div>

Hey @known-yeti 👋

I’m assuming you have some level of access to this K8s deployment. If you can use `kubectl`, this will tell you what the available contexts are:

```auto
kubectl config get-contexts

```

If there is no context listed with the name `context`, then that’s the problem. You set this configuration in the spec:

```auto
contexts: ["context"]

```

Replace `context` there with the context listed on `kubectl config get-contexts` that you want to sync from.

There are other tools available other than `kubectl` to do the same. For example, `k9s`, or [Lens](https://k8slens.dev/).

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 10, 2024, 1:14pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/14 "2024-07-10T13:14:35Z")

</div>

Hi, @mariano

```auto
:~/environment/plugin (feat/kubernetes_images) $ kubectl config get-contexts
W0710 13:14:12.732346 22591 loader.go:221] Config not found: /home/ec2-user/.kube/config
CURRENT NAME CLUSTER AUTHINFO NAMESPACE

```

This is the output of that command. Could you please help me out here?

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 10, 2024, 1:17pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/15 "2024-07-10T13:17:36Z")

</div>

The output of `kubectl config get-contexts` is saying that `kubectl` cannot answer your question because it hasn’t found any configuration to talk to your K8s cluster. This is outside of the scope of the help I can give you since it’s not related to CloudQuery, so I’d suggest Googling or using ChatGPT for that.

If you have further issues with the sync, I’m here to help.

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 10, 2024, 1:19pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/16 "2024-07-10T13:19:23Z")

</div>

> **[Kubernetes Plugin documentation](https://hub.cloudquery.io/plugins/source/cloudquery/k8s/latest/docs?utm_source=yaml&utm_content=source_k8s)**
>
> The CloudQuery Kubernetes plugin allows you to pull data from Kubernetes to any supported destination

In the Authentication section, it mentioned `KUBECONFIG`.

I tried with the default and used `$ echo KUBECONFIG` too.

It’s working fine over there, but it is not working when I try the sync command.  
@mariano

---

<div class="post-metadata">

**Author:** ![mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mariano](https://community.cloudquery.io/u/mariano)\
**Post date:** [July 10, 2024, 1:32pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/17 "2024-07-10T13:32:55Z")

</div>

From the error when you sync, it looks like you gave `cloudquery` correct access to your `k8s` cluster, because it was able to find out that your context doesn’t exist.

When you ran `kubectl config get-contexts` in your EC2 instance, `kubectl` wasn’t configured properly, because it couldn’t answer your question.

You need to set up `kubectl` properly first, then query the context names, and from there you can configure the spec as I explained before.

---

<div class="post-metadata">

**Author:** ![known-yeti](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@known-yeti](https://community.cloudquery.io/u/known-yeti)\
**Post date:** [July 10, 2024, 2:04pm UTC](https://community.cloudquery.io/t/need-help-with-cloudquery-custom-plugin-documentation-for-windows-or-linux/168/18 "2024-07-10T14:04:15Z")

</div>

Thank you @mariano
