go function failed to run with authentication enabled

未关闭
#362 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go, kubernetes

调研方向

Start with the Function resource's pulsar.authSecret configuration and the Go function connection setup; trace how test-auth is passed to the function and how the broker authentication settings are consumed. Use the reported connection log as the failure point, and consider the issue done when the Go function connects successfully with AuthenticationToken enabled.

由索引模型根据 Issue 内容生成。

描述

help wanted

Hi,
I have a pulsar cluster with auth enabled, using AuthenticationProviderToken.

authenticationEnabled: "true"
authenticationProviders: "org.apache.pulsar.broker.authentication.AuthenticationProviderToken"

However, the go function runs with this error.

go-function-sample-function-0 pulsar-function 2022/05/11 16:04:04.677 asm_amd64.s:1581: [info] [TCP connection established] remote_addr=pulsar://pulsar-broker.pulsar:6650 local_addr=172.20.11.22:51436
go-function-sample-function-0 pulsar-function 2022/05/11 16:04:04.682 connection.go:225: [warning] Failed to establish connection with broker: 'Unable to authenticate' remote_addr=pulsar://pulsar-broker.pulsar:6650 local_addr=172.20.11.22:51436

How does my go function use AuthenticationToken, provided in the test-auth secret, to connect the broker? Any examples?

Here's my config file:

apiVersion: compute.functionmesh.io/v1alpha1
kind: Function
metadata:
  name: go-function-sample
  namespace: default
spec:
  image: lichuan33/pulsar-go-function:t1
  forwardSourceMessageProperty: true
  maxPendingAsyncRequests: 1000
  replicas: 1
  maxReplicas: 1
  logTopic: persistent://public/default/go-function-logs
  input:
    topics:
      - persistent://public/default/go-function-input-topic
  output:
    topic: persistent://public/default/go-function-output-topic
  resources:
    requests:
      cpu: "0.1"
      memory: 1G
    limits:
      cpu: "0.2"
      memory: 1.1G
  pulsar:
    pulsarConfig: "test-go-pulsar"
    authSecret: "test-auth"
  golang:
    go: /pulsar/examples/go-function
    goLocation: ""
  clusterName: pulsar
  autoAck: true
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: test-go-pulsar
data:
  webServiceURL: http://pulsar-broker.pulsar:8080
  brokerServiceURL: pulsar://pulsar-broker.pulsar:6650
---
apiVersion: v1
kind: Secret
metadata:
  name: test-auth
stringData:
  clientAuthenticationPlugin: "org.apache.pulsar.client.impl.auth.AuthenticationToken"
  clientAuthenticationParameters: "token:xxx.yyy.zzz"

Thanks.

主要语言
Go
星标
228
派生
30
平均合并
2 天 8 小时
30 天内合并 PR
2

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

streamnative/function-mesh 的其他 Issue

查看 streamnative/function-mesh 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。