# Use zeebe node-js-sdk to connect the zeebe-gateway on k8s

**URL:** <https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674>\
**Category:** Discussion & Questions\
**Tags:** zeebe, node-js-sdk\
**Created:** [December 2, 2024, 3:46pm UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674 "2024-12-02T15:46:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonyan1031](https://forum.camunda.io/user_avatar/forum.camunda.io/jasonyan1031/32/31429_2.png) [@jasonyan1031](https://forum.camunda.io/u/jasonyan1031)\
**Post date:** [December 2, 2024, 3:46pm UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/1 "2024-12-02T15:46:08Z")

</div>

Hi everyone, may you help me? I’m trying to deploy a self-managed Camunda8 on local k8s cluster (with kind), but I have trouble with connecting to the gateway using zeebe node-js-sdk client. Considering that the Desktop Camunda Modeler goes well, I believe there’s something wrong with my sdk config.

I can connect to my gateway and deploy BPs through Desktop Camunda Modeler using the settings as follow:

 ![image](https://forum.camunda.io/uploads/default/original/3X/6/3/63ed4964fe3c63622202a07242a080a443b50ad9.png)  
 ![image](https://forum.camunda.io/uploads/default/original/3X/1/8/18ff6c742c5f39edaba43744e3f755a025a7f0ee.png)

However, I cannot connect to it through the zeebe node-js-sdk using the similar settings. Here is my config for node-js-sdk:

```typescript
const config: Camunda8ClientConfiguration = {
  ZEEBE_ADDRESS: "zeebe.camunda.local",
  ZEEBE_CLIENT_ID: "zeebe",
  ZEEBE_CLIENT_SECRET: "demo",
  ZEEBE_GRPC_ADDRESS: "zeebe.camunda.local",
  CAMUNDA_AUTH_STRATEGY: "OAUTH",
  CAMUNDA_OAUTH_URL:
    "http://camunda.local/auth/realms/camunda-platform/protocol/openid-connect/token",
  CAMUNDA_TASKLIST_BASE_URL: "http://camunda.local/tasklist",
  CAMUNDA_OPERATE_BASE_URL: "http://camunda.local/operate",
  CAMUNDA_OPTIMIZE_BASE_URL: "http://camunda.local/optimize",
  CAMUNDA_SECURE_CONNECTION: false,
  CAMUNDA_ZEEBE_OAUTH_AUDIENCE: "zeebe-api",
  CAMUNDA_OPERATE_OAUTH_AUDIENCE: "operate-api",
  CAMUNDA_TASKLIST_OAUTH_AUDIENCE: "tasklist-api",
  CAMUNDA_OPTIMIZE_OAUTH_AUDIENCE: "optimize-api",
  zeebeGrpcSettings: {
    ZEEBE_CLIENT_LOG_LEVEL: "DEBUG",
    ZEEBE_INSECURE_CONNECTION: true,
  },
  CAMUNDA_LOG_LEVEL: "debug",
  CAMUNDA_TENANT_ID: "",
};

```

and these are my client code outputs:

```auto
20:51:13.464 | zeebe | INFO: Grpc Middleware blocking: false
20:51:13.525 | zeebe | INFO: Middleware emits ready
20:51:18.590 | zeebe | INFO: Set Grpc channel ready timer for 3000ms
/.../camunda-zeebe-client-ts/node_modules/@grpc/grpc-js/src/call.ts:82
  const error = new Error(message);
                ^
Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error

```

I appreciate any help you can offer. Thank you in advance!

---

<div class="post-metadata">

**Author:** ![cpbpm](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/919ad9/32.png) [@cpbpm](https://forum.camunda.io/u/cpbpm)\
**Post date:** [December 3, 2024, 12:04am UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/2 "2024-12-03T00:04:02Z")

</div>

you missed out few more settings.

export ZEEBE\_GRPC\_ADDRESS=‘localhost:26500’  
export ZEEBE\_REST\_ADDRESS=‘[http://localhost:8080](http://localhost:8080)’

Desktop modeler will use grpc protocol to deploy the resource to Zeebe through gateway.

Ref: [GitHub - camunda/camunda-8-js-sdk: The Camunda 8 JavaScript SDK for Node.js](https://github.com/camunda/camunda-8-js-sdk)

---

<div class="post-metadata">

**Author:** ![jasonyan1031](https://forum.camunda.io/user_avatar/forum.camunda.io/jasonyan1031/32/31429_2.png) [@jasonyan1031](https://forum.camunda.io/u/jasonyan1031)\
**Post date:** [December 3, 2024, 1:40pm UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/3 "2024-12-03T13:40:56Z")

</div>

Thank you for your response!

Actually, I’ve set this:

> ZEEBE\_GRPC\_ADDRESS: “zeebe.camunda.local”

I’m not using ‘localhost’ because I’m trying to deploy it on k8s. I followed the official tutorial to deploy a local k8s cluster. ([the official doc here](https://docs.camunda.io/docs/self-managed/setup/deploy/local/local-kubernetes-cluster/#ingress-configuration-in-camunda-8-helm-charts)) And I believe I correctly configured the ingress, otherwise, the Desktop Modeler won’t work as expected.

But unfortunately, the nodejs zeebe client still not work and outputs what I mentioned before. That’s so weird… Hope you can help me, thanks!

---

<div class="post-metadata">

**Author:** ![cpbpm](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/919ad9/32.png) [@cpbpm](https://forum.camunda.io/u/cpbpm)\
**Post date:** [December 3, 2024, 1:58pm UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/4 "2024-12-03T13:58:54Z")

</div>

> [@jasonyan1031](#):
>
> `Received RST_STREAM with code 2 triggered by internal client error: Protocol error`

When you make connection, are you calling method as createInSecure?

Try instead,createSSL function. [ChannelCredentials.createSsl()]

This is not a Camunda issue,it’s node.js issue.

---

<div class="post-metadata">

**Author:** ![jasonyan1031](https://forum.camunda.io/user_avatar/forum.camunda.io/jasonyan1031/32/31429_2.png) [@jasonyan1031](https://forum.camunda.io/u/jasonyan1031)\
**Post date:** [December 4, 2024, 3:34am UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/5 "2024-12-04T03:34:10Z")

</div>

I referred to the [official nodejs-sdk doc](https://docs.camunda.io/docs/apis-tools/node-js-sdk/) and simplified the codes in the doc as follows:

```typescript
const camunda = new Camunda8(clientConfig);
const zeebe = camunda.getZeebeGrpcApiClient();
async function main() {
  const deploy = await zeebe.deployResource({
    processFilename: path.join(process.cwd(), "bpmn/process.bpmn"),
  });
}

main();

```

The connection call is inside the methods and I didn’t make the connection manually.

Before I trying to deploy a local k8s cluster, I’ve successed to deploy one without k8s (using docker-compose) and successed to connect it using the codes above with some similar ‘localhost’ settings. As the docker-compose one and the local k8s one both are not secure connection, maybe it’s not the secure connection issue?

---

<div class="post-metadata">

**Author:** ![jasonyan1031](https://forum.camunda.io/user_avatar/forum.camunda.io/jasonyan1031/32/31429_2.png) [@jasonyan1031](https://forum.camunda.io/u/jasonyan1031)\
**Post date:** [December 24, 2024, 10:28am UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/6 "2024-12-24T10:28:03Z")

</div>

I tried some possible settings and found `ZEEBE_GRPC_ADDRESS: "zeebe.camunda.local:80"` solved my problem.

I must explicitly set the proxy to 80.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [December 31, 2024, 10:28am UTC](https://forum.camunda.io/t/use-zeebe-node-js-sdk-to-connect-the-zeebe-gateway-on-k8s/57674/7 "2024-12-31T10:28:14Z")

</div>

Closed on December 31, 2024, 10:28am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
