|
| 1 | +apiVersion: compute.functionmesh.io/v1alpha1 |
| 2 | +kind: Function |
| 3 | +metadata: |
| 4 | + name: java-function-batcher-sample |
| 5 | + namespace: default |
| 6 | +spec: |
| 7 | + className: org.apache.pulsar.functions.api.examples.ExclamationFunction |
| 8 | + image: streamnative/pulsar-all:2.7.1 |
| 9 | + sourceType: java.lang.String |
| 10 | + sinkType: java.lang.String |
| 11 | + forwardSourceMessageProperty: true |
| 12 | + MaxPendingAsyncRequests: 1000 |
| 13 | + replicas: 1 |
| 14 | + maxReplicas: 5 |
| 15 | + logTopic: persistent://public/default/logging-function-logs |
| 16 | + input: |
| 17 | + topics: |
| 18 | + - persistent://public/default/java-function-input-topic |
| 19 | + output: |
| 20 | + topic: persistent://public/default/java-function-output-topic |
| 21 | + producerConf: |
| 22 | + batchBuilder: "KEY_BASED" |
| 23 | + resources: |
| 24 | + requests: |
| 25 | + cpu: "0.1" |
| 26 | + memory: 1G |
| 27 | + limits: |
| 28 | + cpu: "0.2" |
| 29 | + memory: 1.1G |
| 30 | + # each secret will be loaded ad an env variable from the `path` secret with the `key` in that secret in the name of `name` |
| 31 | + secretsMap: |
| 32 | + "name": |
| 33 | + path: "test-secret" |
| 34 | + key: "username" |
| 35 | + "pwd": |
| 36 | + path: "test-secret" |
| 37 | + key: "password" |
| 38 | + pulsar: |
| 39 | + pulsarConfig: "test-pulsar" |
| 40 | + #authConfig: "test-auth" |
| 41 | + volumeMounts: |
| 42 | + - mountPath: /cache |
| 43 | + name: cache-volume |
| 44 | + pod: |
| 45 | + labels: |
| 46 | + "locaction": "mtv" |
| 47 | + annotations: |
| 48 | + "managed-function": "true" |
| 49 | + volumes: |
| 50 | + - name: cache-volume |
| 51 | + emptyDir: {} |
| 52 | + imagePullSecrets: |
| 53 | + - name: regcred |
| 54 | + initContainers: |
| 55 | + - name: init-function |
| 56 | + image: busybox:1.28 |
| 57 | + command: ['sh', '-c', 'echo The app is running! && sleep 30'] |
| 58 | + sidecars: |
| 59 | + - name: sidecar-function |
| 60 | + image: busybox:1.28 |
| 61 | + command: ['sh', '-c', 'echo The app is running! && sleep 30000'] |
| 62 | + java: |
| 63 | + jar: /pulsar/examples/api-examples.jar |
| 64 | + jarLocation: "" |
| 65 | + # use package name: |
| 66 | + # jarLocation: function://public/default/nul-test-java-function@v1 |
| 67 | + # to be delete & use admission hook |
| 68 | + clusterName: test-pulsar |
| 69 | + autoAck: true |
| 70 | +--- |
| 71 | +apiVersion: v1 |
| 72 | +kind: ConfigMap |
| 73 | +metadata: |
| 74 | + name: test-pulsar |
| 75 | +data: |
| 76 | + webServiceURL: http://test-pulsar-broker.default.svc.cluster.local:8080 |
| 77 | + brokerServiceURL: pulsar://test-pulsar-broker.default.svc.cluster.local:6650 |
| 78 | +#--- |
| 79 | +#apiVersion: v1 |
| 80 | +#kind: ConfigMap |
| 81 | +#metadata: |
| 82 | +# name: test-auth |
| 83 | +#data: |
| 84 | +# clientAuthenticationPlugin: "abc" |
| 85 | +# clientAuthenticationParameters: "xyz" |
| 86 | +# tlsTrustCertsFilePath: "uvw" |
| 87 | +# useTls: "true" |
| 88 | +# tlsAllowInsecureConnection: "false" |
| 89 | +# tlsHostnameVerificationEnable: "true" |
| 90 | +--- |
| 91 | +apiVersion: v1 |
| 92 | +data: |
| 93 | + username: YWRtaW4= |
| 94 | + password: MWYyZDFlMmU2N2Rm |
| 95 | +kind: Secret |
| 96 | +metadata: |
| 97 | + name: test-secret |
| 98 | +type: Opaque |
0 commit comments