Runtime Sidecar - a Dapr inspired story
- Install Go:
- Download Go for windows; Go 1.17
- Editor:
- Visual studio Code + Go extension
- Build:
- install make
choco install make
- install protoc
choco install protoc
- build with make
make build-linux
- install make
- Debug:
- install delve debug tool: dlv-dap - suggested by vs-code
- debug with vscode :> Run sidecar
- Test:
- install gcc
choco install mingw
- test with make
make test
- install gcc
In self-hosted mode, component files have to be saved on the local machine, and provide a components-path
to the sidecar.
In Kubernetes mode Rusi will query the kubernetes api in order to find and register all components
-
Create a pub/sub message broker component
apiVersion: rusi.io/v1alpha1 kind: Component metadata: name: natsstreaming-pubsub spec: type: pubsub.natsstreaming version: v1 metadata: - name: natsURL value: "replace with your host" - name: natsStreamingClusterID value: "replace with your cluster name" # below are subscription configuration. - name: subscriptionType value: queue # Required. Allowed values: topic, queue. - name: ackWaitTime value: "" # Optional. - name: maxInFlight value: "1" # Optional. - name: durableSubscriptionName value: "" # Optional.
-
Add custom middlewares (optional)
apiVersion: rusi.io/v1alpha1 kind: Component metadata: name: uppercase spec: type: middleware.http.uppercase version: v1
-
Configure middleware pipeline (optional)
configuration is not mandatory, unless you want to specify a specific pipeline for pubsub
apiVersion: rusi.io/v1alpha1 kind: Configuration metadata: name: node-pipeline-config spec: subscriberPipeline: handlers: - name: pubsub-uppercase type: middleware.pubsub.uppercase # add other middlewares publisherPipeline: handlers: - name: pubsub-uppercase type: middleware.pubsub.uppercase # add other middlewares
- kubernetes
go run cmd/rusid/sidecar.go --mode kubernetes --app-id your-app-id --config "kube-config-resource-name"
If you run out of cluster, it will use your kubectl current context, to scan for all components in all namespaces.
- standalone
go run cmd/rusid/sidecar.go --app-id your-app-id --components-path="path-to-components-folder" --config "path-to-config.yaml"