Running Dapr with a Kubernetes Job

    Kubernetes Job

    The Dapr sidecar is designed to be a long running process, in the context of a Kubernetes Job this behaviour can block your job completion. To address this issue the Dapr sidecar has an endpoint to the sidecar.

    When a job is finish without calling Shutdown your job will be in a NotReady state with only the daprd container running endlessly.

    You can also call the Shutdown from any of the Dapr SDK

    1. package main
    2. import (
    3. "context"
    4. "log"
    5. dapr "github.com/dapr/go-sdk/client"
    6. )
    7. func main() {
    8. client, err := dapr.NewClient()
    9. log.Panic(err)
    10. }
    11. defer client.Close()
    12. defer client.Shutdown()
    13. }