streamnative / function-mesh-website

Website for https://functionmesh.io/
https://functionmesh.io/
3 stars 4 forks source link

Configuration options need to be better explained #113

Open polyzos opened 2 years ago

polyzos commented 2 years ago

From a user's perspective its not clear and its hard to understand how they can properly configure their functions/sources/connectors.

Consider the following example we have in the docs

apiVersion: compute.functionmesh.io/v1alpha1
kind: Function
metadata:
  name: java-function-sample
  namespace: default
spec:
  image: streamnative/example-function-image:latest # using function image here
  className: exclamation_function.ExclamationFunction
  forwardSourceMessageProperty: true
  maxPendingAsyncRequests: 1000
  replicas: 1
  maxReplicas: 5
  logTopic: persistent://public/default/logging-function-logs
  input:
    topics:
    - persistent://public/default/java-function-input-topic
    typeClassName: java.lang.String
  output:
    topic: persistent://public/default/java-function-output-topic
    typeClassName: java.lang.String
  pulsar:
    pulsarConfig: "test-pulsar"
  java:
    extraDependenciesDir: random-dir/
    jar: /pulsar/example-function.jar # the package location in image
    jarLocation: "" # leave empty since we will not download package from Pulsar Packages

and here is how we describe the configuration options: https://functionmesh.io/docs/functions/function-crd/#function-configurations

Some examples:

  1. The configuration options start with an uppercase letter but the reality is they need to pass them with a lowercase start letter.
  2. We don't specify which are the default values and what their type is.. For example is it a string? an integer? a map? etc.
  3. We don't specify which configurations are optional and which are mandatory

Then consider the input/output section on the example above and see our docs here: https://functionmesh.io/docs/functions/function-crd/#input For example the inputs section has typeClassName which is not described in the docs. Or for example in the output section we have the ProducerConf. The users get confused around -> what should i specify there? how to i specify it?

Here you can find some example i had created a few months back: https://github.com/streamnative/streamnative-academy/blob/master/microservices-webinars/deployment/mesh.yaml#L196 as you can see here for example the user can add some ConfigMaps and secrets In the docs: https://github.com/streamnative/streamnative-academy/blob/master/microservices-webinars/deployment/mesh.yaml#L196 we just mention the configuration names, we don't actually educate the user HOW we should specify them for deployment.

All these things cause a lot of confusion and its hard to start using function-mesh for realworld applications.

Huanli-Meng commented 2 years ago

@polyzos I have submitted a PR to fix this doc bug. PTAL, and feel free to let me know. I will fix the rest issues in several follow-up PRs. Thanks.

The configuration options start with an uppercase letter but the reality is they need to pass them with a lowercase start letter.