This message was deleted.
# general
s
This message was deleted.
s
Copy code
$ pulsar-admin functions get    --tenant test    --namespace test-namespace    --name example
{
  "tenant": "test",
  "namespace": "test-namespace",
  "name": "example",
  "className": "org.apache.pulsar.functions.api.examples.ExclamationFunction",
  "inputSpecs": {
    "test_src": {
      "isRegexPattern": false,
      "schemaProperties": {},
      "consumerProperties": {},
      "poolMessages": false
    }
  },
  "output": "test_result",
  "producerConfig": {
    "useThreadLocalProducers": false,
    "batchBuilder": "",
    "compressionType": "LZ4"
  },
  "processingGuarantees": "ATLEAST_ONCE",
  "retainOrdering": false,
  "retainKeyOrdering": false,
  "forwardSourceMessageProperty": true,
  "userConfig": {},
  "runtime": "JAVA",
  "autoAck": true,
  "parallelism": 1,
  "resources": {
    "cpu": 1.0,
    "ram": 1073741824,
    "disk": 10737418240
  },
  "cleanupSubscription": true,
  "subscriptionPosition": "Latest"
}
$ pulsar version Current version of pulsar is: 3.1.0.5 Git Revision 366a9912e70872e7300fe197e808eb09dbee12e2 Git Branch auto-release-20231019142746 Built by StreamNative Bot <snbot@streamnative.io> on fv-az1243-951 at 2023-10-19T142850+0000
d
Could you let me know which function runtime environment you’ve set up? Are you running the functions inside a function work node as processes or as separate k8s pods?
s
hi @David K Right now, i believe it is either thread or process runtime. i haven't changed anything in the pulsar config other than spec.config.function.enabled: true i would like to use the k8s runtime, i've started reading https://pulsar.apache.org/docs/next/functions-runtime-kubernetes/.
actually... the default seems to be kubernetes...
Copy code
functions_worker.yml:functionRuntimeFactoryClassName: org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntimeFactory
that's from inside my worker
d
Ok. Can you see the K8s pods associated with the pulsar functions running?
s
nope, it never launches the pod
kubectl get events shows no errors
hmm
d
Ok, so the issue is somewhere between the runtime factory and K8s itself. Check for the proper configuration of the K8s context/permissions, etc.
Chances are that the commands don’t reach the K8s cluster at all.
s
here is my full functions_workers.yaml file in case you want to see: https://gist.github.com/christophercorn/b6b85fb399a7571bc9292c2cea12be60
d
For what it’s worth, I use the function mesh to deploy functions vs. the Pulsar admin command line.
s
i'm considering that also, but the team wants to try out what's native to pulsar first. what are the major differences?
d
FWIW, I see you have
localhost
in your configuration (lines 34 and 35). I am not sure if that is correct.
s
it's reachable from inside broker though?
d
Both native Pulsar and Function Mesh are viable options. The biggest difference is that Function Mesh allows you to create and manage the deployment of multiple functions together as a single logical deployment. In contrast, native pulsar requires you to deploy and manage them individually.
It would be better to have those two localhost addresses point to a proxy or load balancer configured in front of the broker.
or at least the K8s service, i.e.
<pulsar://brokers-broker-headless.pulsar.svc.cluster.local:6650>
s
kk
let me make that change
i would hope to see some kind of error in the logs related to kubernetes, but other than what i posted, there's nothing there.
➕ 1
d
Function mesh also allows you to automatically scale your function instances vertically and/or horizontally.
What does the following configMap contain?
changeConfigMap: brokers-broker-functions-worker-config
s
functions_worker.yml: changeConfigMap: brokers-broker-functions-worker-config functions_worker.yml: changeConfigMapNamespace: pulsar
let me look at the actualy configmap contents
Copy code
apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: "2024-01-24T02:00:24Z"
  name: brokers-broker-functions-worker-config
  namespace: pulsar
  ownerReferences:
  - apiVersion: <http://pulsar.streamnative.io/v1alpha1|pulsar.streamnative.io/v1alpha1>
    blockOwnerDeletion: true
    controller: true
    kind: PulsarBroker
    name: brokers
    uid: 1cdf16b1-745e-44e7-ac5c-c1d2e62a0205
  resourceVersion: "2426879053"
  uid: bdf027dc-e4b8-4b51-8932-cb291d6dc116
not much in there
d
Any authentication in place on either Pulsar or K8s?
s
no auth configured at all on pulsar: this is what i've applied: https://gist.github.com/christophercorn/8011ca733f235de00df0bd6afc351425
i can pub/sub with the client. that works just fine. no auth there.
not sure, what kind of auth i could setup in k8s?
d
As a sanity check, is the function name valid?
👀 1
other than that, I am out of ideas for now….
s
i tried setting the variables but they didn't seem to stick:
however, i do see it in the broker.conf
Copy code
conf/broker.conf:pulsarServiceUrl=<pulsar://brokers-broker-headless.pulsar.svc.cluster.local:6650>
conf/broker.conf:pulsarWebServiceUrl=<http://brokers-broker-headless.pulsar.svc.cluster.local:8080>
yeah the function name is just called "example"
d
I am a bit out of my depth here, as I don’t have much experience with Function Workers. Sorry.
s
it's okay, i appreciate the effort
d
I will reach out within SN for someone with more experience in this area. 🤞
s
thank you sir. maybe i'll try the standard apache pulsar helm chart, see how they handled it there.
@Lari Hotari I don't suppose you have a working implementation of Pulsar function workers on the pulsar operator?
l
@seb I'm not familiar with the operator. Pulsar Functions are available in the Apache Pulsar Helm chart. There is a problem in the released versions with a TLS enabled cluster. The fix will be available in the upcoming 3.2.0 release. The release candidate is available for testing, instructions in the release voting email: https://lists.apache.org/thread/6wst9jqg0w9otyn4ltwoq574029czoqy
s
I don't have tls enabled in my cluster. i guess i can try installing the apache pulsar helm chart instead of the streamnative pulsar operator and see if pulsar functions just work in that case. it does not with the streamnative pulsar operator.
this note on apache pulsar helm chart, makes it sounds like things may not work out of the box:
deploying the official apache pulsar helm chart, v 3.2.0 just worked. pulsar and pulsar functions.
👍 2
thanks for all the help @David K and @Lari Hotari
🙏 1