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

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:


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

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:

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!

you missed out few more settings.

export ZEEBE_GRPC_ADDRESS=‘localhost:26500’
export ZEEBE_REST_ADDRESS=‘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

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) 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!

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.

I referred to the official nodejs-sdk doc and simplified the codes in the doc as follows:

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?

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.

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