|
| 1 | +apiVersion: compute.functionmesh.io/v1alpha1 |
| 2 | +kind: Function |
| 3 | +metadata: |
| 4 | + name: java-log-config-yaml |
| 5 | + namespace: default |
| 6 | +spec: |
| 7 | + image: streamnative/pulsar-functions-java-sample:3.2.2.1 |
| 8 | + className: org.apache.pulsar.functions.api.examples.ExclamationFunction |
| 9 | + forwardSourceMessageProperty: true |
| 10 | + maxPendingAsyncRequests: 1000 |
| 11 | + replicas: 1 |
| 12 | + maxReplicas: 5 |
| 13 | + logTopic: persistent://public/default/logging-function-logs |
| 14 | + input: |
| 15 | + topics: |
| 16 | + - persistent://public/default/input-java-log-config-yaml-topic |
| 17 | + typeClassName: java.lang.String |
| 18 | + output: |
| 19 | + topic: persistent://public/default/output-java-log-config-yaml-topic |
| 20 | + typeClassName: java.lang.String |
| 21 | + resources: |
| 22 | + requests: |
| 23 | + cpu: 50m |
| 24 | + memory: 1G |
| 25 | + limits: |
| 26 | + cpu: "0.2" |
| 27 | + memory: 1.1G |
| 28 | + # each secret will be loaded ad an env variable from the `path` secret with the `key` in that secret in the name of `name` |
| 29 | + secretsMap: |
| 30 | + "name": |
| 31 | + path: "test-secret" |
| 32 | + key: "username" |
| 33 | + "pwd": |
| 34 | + path: "test-secret" |
| 35 | + key: "password" |
| 36 | + pulsar: |
| 37 | + pulsarConfig: "test-pulsar" |
| 38 | + tlsConfig: |
| 39 | + enabled: false |
| 40 | + allowInsecure: false |
| 41 | + hostnameVerification: true |
| 42 | + certSecretName: sn-platform-tls-broker |
| 43 | + certSecretKey: "" |
| 44 | + authConfig: |
| 45 | + oauth2Config: |
| 46 | + audience: urn:sn:pulsar:sndev:test |
| 47 | + issuerUrl: https://auth.sncloud-stg.dev/ |
| 48 | + keySecretName: sn-platform-oauth2-private-key |
| 49 | + keySecretKey: auth.json |
| 50 | + java: |
| 51 | + log: |
| 52 | + javaLog4JConfigFileType: yaml |
| 53 | + logConfig: |
| 54 | + name: "java-log-config-cm" |
| 55 | + key: "log.yaml" |
| 56 | + jar: /pulsar/examples/api-examples.jar |
| 57 | + # to be delete & use admission hook |
| 58 | + clusterName: test |
| 59 | + autoAck: true |
| 60 | +--- |
| 61 | +apiVersion: v1 |
| 62 | +kind: ConfigMap |
| 63 | +metadata: |
| 64 | + name: test-pulsar |
| 65 | +data: |
| 66 | + webServiceURL: http://sn-platform-pulsar-broker.default.svc.cluster.local:8080 |
| 67 | + brokerServiceURL: pulsar://sn-platform-pulsar-broker.default.svc.cluster.local:6650 |
| 68 | +--- |
| 69 | +apiVersion: v1 |
| 70 | +data: |
| 71 | + username: YWRtaW4= |
| 72 | + password: MWYyZDFlMmU2N2Rm |
| 73 | +kind: Secret |
| 74 | +metadata: |
| 75 | + name: test-secret |
| 76 | +type: Opaque |
| 77 | +--- |
| 78 | +apiVersion: v1 |
| 79 | +kind: ConfigMap |
| 80 | +metadata: |
| 81 | + name: java-log-config-cm |
| 82 | +data: |
| 83 | + log.yaml: | |
| 84 | + Configuration: |
| 85 | + name: pulsar-functions-kubernetes-instance |
| 86 | + monitorInterval: 30 |
| 87 | + Properties: |
| 88 | + Property: |
| 89 | + - name: pulsar.log.level |
| 90 | + value: DEBUG |
| 91 | + - name: bk.log.level |
| 92 | + value: DEBUG |
| 93 | +
|
| 94 | + Appenders: |
| 95 | + Console: |
| 96 | + name: Console |
| 97 | + target: SYSTEM_OUT |
| 98 | +
|
| 99 | + PatternLayout: |
| 100 | + Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t] %-5level %logger{36} - %msg%n" |
| 101 | +
|
| 102 | +
|
| 103 | + RollingRandomAccessFile: |
| 104 | + name: RollingRandomAccessFile |
| 105 | + fileName: "${sys:pulsar.function.log.dir}/${sys:pulsar.function.log.file}.log" |
| 106 | + filePattern: "${sys:pulsar.function.log.dir}/${sys:pulsar.function.log.file}.%d{yyyy-MM-dd}-%i.log.gz" |
| 107 | +
|
| 108 | + PatternLayout: |
| 109 | + Pattern: "%d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %msg%n" |
| 110 | +
|
| 111 | + Policies: |
| 112 | + SizeBasedTriggeringPolicy: |
| 113 | + size: "10MB" |
| 114 | + DefaultRolloverStrategy: |
| 115 | + max: 5 |
| 116 | +
|
| 117 | + Loggers: |
| 118 | + Root: |
| 119 | + level: "${sys:pulsar.log.level}" |
| 120 | + AppenderRef: |
| 121 | + - ref: Console |
| 122 | + level: "${sys:pulsar.log.level}" |
| 123 | + - ref: RollingRandomAccessFile |
| 124 | + Logger: |
| 125 | + name: org.apache.pulsar.functions.runtime.shaded.org.apache.bookkeeper |
| 126 | + level: "${sys:bk.log.level}" |
| 127 | + additivity: false |
| 128 | + AppenderRef: |
| 129 | + - ref: Console |
| 130 | + - ref: RollingRandomAccessFile |
0 commit comments