faas-netes
faas-netes copied to clipboard
Update openfaas chart to support JetStream
Description
Update the openfaas chart to support JetStream.
Motivation and Context
Part of the migration to JetStream for the OpenFaaS async system.
How Has This Been Tested?
- Deploy OpenFaaS with the updated chart
git clone https://github.com/welteki/faas-netes \
--depth=1 \
--branch jetstream
cd faas-netes
kubectl apply -f namespaces.yml
kubectl create secret generic \
-n openfaas \
openfaas-license \
--from-file license=$HOME/.openfaas/LICENSE
helm upgrade openfaas --install chart/openfaas \
--namespace openfaas \
--set functionNamespace=openfaas-fn \
--set generateBasicAuth=true \
--set openfaasPro=true \
--set nats.queueMode=jetstream
- Verify NATS JetStream is running and that the queue-worker created the default stream.
kubectl port-forward -n openfaas svc/nats 4222:4222
nats stream info faas-request
Information for Stream faas-request created 2022-07-22T19:52:35+02:00
Configuration:
Subjects: faas-request
Acknowledgements: true
Retention: File - Limits
Replicas: 1
Discard Policy: Old
Duplicate Window: 2m0s
Allows Msg Delete: true
Allows Purge: true
Allows Rollups: false
Maximum Messages: unlimited
Maximum Bytes: unlimited
Maximum Age: unlimited
Maximum Message Size: unlimited
Maximum Consumers: unlimited
State:
Messages: 200
Bytes: 108 KiB
FirstSeq: 1 @ 2022-07-22T17:52:43 UTC
LastSeq: 200 @ 2022-07-22T17:52:43 UTC
Active Consumers: 1
- Deployed some functions and successfully invoked them asynchronously.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the CONTRIBUTION guide
- [x] I have signed-off my commits with
git commit -s
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.
Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.
:bulb: Shall we fix this?
This will only take a few moments.
First, clone your fork and checkout this branch using the git CLI.
Next, set up your real name and email address:
git config --global user.name "Your Full Name"
git config --global user.email "[email protected]"
Finally, run one of these commands to add the "Signed-off-by" line to your commits.
If you only have one commit so far then run: git commit --amend --signoff
and then git push --force
.
If you have multiple commits, watch this video.
Check that the message has been added properly by running "git log".
Impact to existing users:
If you are running OF CE and upgrade, the template will just use the stan field.
If you are running OF Pro and upgrade, the template will just use the stan field.
If you are running OF Pro and enable JetStream, it will use the nats field
If you're running OF with a pinned value in .Values.nats, then upgrade, it will deploy the wrong version. Assuming you're not using an external NATS server