Hi,
I'm trying to use authentication for a java function with the common use of Secrets to store the JWT token needed to access pulsar.
authSecret works
As I understand, the authSecret is legacy.
apiVersion: compute.functionmesh.io/v1alpha1kind: Functionmetadata:
name: testnamespace: testspec:
className: com.test.Testimage: streamnative/pulsar-functions-java-runner:2.11.2.9forwardSourceMessageProperty: truemaxPendingAsyncRequests: 1000replicas: 1maxReplicas: 3#logTopic: persistent://test/functions.loginput:
topics:
- persistent://test/testresources:
requests:
cpu: "100m"memory: "1G"limits:
cpu: "2"memory: "2G"pulsar:
pulsarConfig: "pulsar-config"authSecret: "pulsar-auth"
---
apiVersion: v1kind: ConfigMapmetadata:
namespace: testname: pulsar-configdata:
webServiceURL: https://test:8443brokerServiceURL: pulsar+ssl://test:6651
---
apiVersion: v1data:
clientAuthenticationParameters: XXX # org.apache.pulsar.client.impl.auth.AuthenticationTokenclientAuthenticationPlugin: XXX # "token:eyJ..."kind: Secrettype: Opaque
authConfig doesn't work
either combination of the approaches:
as environment variables
pulsar:
pulsarConfig: "pulsar-config"secretsMap:
"clientAuthenticationParameters":
path: "pulsar-auth"key: "clientAuthenticationParameters""clientAuthenticationPlugin":
path: "pulsar-auth"key: "clientAuthenticationPlugin"
authConfig
pulsar:
pulsarConfig: "pulsar-config"
authConfig:
genericAuth: "pulsar-auth"
apiVersion: compute.functionmesh.io/v1alpha1kind: Functionmetadata:
name: testnamespace: testspec:
className: com.test.Testimage: streamnative/pulsar-functions-java-runner:2.11.2.9forwardSourceMessageProperty: truemaxPendingAsyncRequests: 1000replicas: 1maxReplicas: 3#logTopic: persistent://test/functions.loginput:
topics:
- persistent://test/testresources:
requests:
cpu: "100m"memory: "1G"limits:
cpu: "2"memory: "2G"pulsar:
pulsarConfig: "pulsar-config"secretsMap:
"clientAuthenticationParameters":
path: "pulsar-auth"key: "clientAuthenticationParameters""clientAuthenticationPlugin":
path: "pulsar-auth"key: "clientAuthenticationPlugin"
---
apiVersion: v1kind: ConfigMapmetadata:
namespace: testname: pulsar-configdata:
webServiceURL: https://test:8443brokerServiceURL: pulsar+ssl://test:6651
---
apiVersion: v1data:
clientAuthenticationParameters: XXX # org.apache.pulsar.client.impl.auth.AuthenticationTokenclientAuthenticationPlugin: XXX # "token:eyJ..."kind: Secrettype: Opaque
I don't want to put the Auth Token into a configmap. How is the correct approach for supplying clientAuthenticationParameters as environment variable from a secret in combination with "authConfig"?
Hi,
I'm trying to use authentication for a java function with the common use of
Secretsto store the JWT token needed to access pulsar.authSecret works
As I understand, the
authSecretis legacy.authConfig doesn't work
either combination of the approaches:
as environment variables
authConfig
I don't want to put the Auth Token into a configmap. How is the correct approach for supplying
clientAuthenticationParametersas environment variable from a secret in combination with "authConfig"?