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 finished without calling Shutdown
, your job will be in a NotReady
state with only the daprd
container running endlessly.
Be sure to use the POST HTTP verb when calling the shutdown HTTP API.
import (
"context"
"log"
dapr "github.com/dapr/go-sdk/client"
)
func main() {
client, err := dapr.NewClient()
log.Panic(err)
}
defer client.Close()
defer client.Shutdown()
// Job