function-mesh
function-mesh copied to clipboard
[Waiting] ]Use init container to download packages and functions
Fixes #400
Wait for function-mesh-worker-service support oauth2, leave any comment you want
Motivation
Use an init container to download packages/functions from pulsar: https://github.com/streamnative/function-mesh/pull/390#issuecomment-1155933847
Modifications
Attach an init container and empty volume if JarLocation/PyLocation/GoLocation is specified
Verifying this change
-
[ ] Make sure that the change passes the CI checks.
-
[ ] This change added tests and can be verified as follows:
- Added unit test for generating init container and volume when one of JarLocation/PyLocation/GoLocation is specified
- Require integration tests for end-to-end deployment with one of JarLocation/PyLocation/GoLocation specified
Documentation
-
[x]
doc-required
need docs for dev
pulsarctl
need some additional steps for oauth2: pulsarcl oauth2 activate
and pulsarctl context set
, which require some extra parameters like: --issuer-endpoint
, --client-id
, --audience
there are two ways to achieve this:
-
adding another field like
oauth2
in thePulsarMessaging
struct and dooauth2 activate
andcontext set
in the init container -
make pulsarctl parse those parameters from the auth JSON file, and do
oauth2 activate
automatically when auth plugin is OAuth2(I don't know why pulsarctl doesn't do this likepulsar-admin
, so not sure whether it's possible)
I prefer the 2nd way, do you have any opinions? @streamnative/serverless
for the compatibility issue, I tested that we can pass undefined fields when creating k8s resources, like with FM v0.4.0, which doesn't define the spec.pulsar.oauth2Config
field yet, we can still apply the below config:
pulsar:
pulsarConfig: "test-pulsar"
authSecret: "test-auth"
tlsSecret: "test-tls"
oauth2Config:
audience: "test"
clientId: "test"
issuerUrl: "aaa.com"
keySecretName: "test-secret"
keySecretKey: "credential.json"
the controller works well and just ignores the undefined oauth2Config
.
so for compatibility, we can support passing the oauth2Config
in function-mesh-worker-service first, and then merge this pr(let's say it will be released in v0.5.0), finally, we can bump function-mesh to v0.5.0 without any error.
related issue: https://github.com/streamnative/function-mesh-worker-service/issues/334
@streamnative/serverless this is ready to review and can be merged after this: https://github.com/streamnative/function-mesh-worker-service/pull/400
The doc is updated for this feature through this doc PR. Therefore, remove the doc-required label and add the doc-added label.