Steps to upgrade Dapr on a Kubernetes cluster

Follow these steps to upgrade Dapr on Kubernetes and ensure a smooth upgrade.

Prerequisites

Upgrade existing cluster running 0.11.x

  1. Run these two commands to prevent helm upgrade from uninstalling 0.11.x placement service:

    1. kubectl annotate deployment dapr-placement helm.sh/resource-policy=keep -n dapr-system
    1. kubectl annotate svc dapr-placement helm.sh/resource-policy=keep -n dapr-system
  2. Export certificates:

    1. dapr mtls export -o ./certs
  3. Upgrade Dapr to 1.0.0-rc.2:

    1. helm repo update
    1. helm upgrade dapr dapr/dapr --version 1.0.0-rc.2 --namespace dapr-system --reset-values --set-file dapr_sentry.tls.root.certPEM=./certs/ca.crt --set-file dapr_sentry.tls.issuer.certPEM=./certs/issuer.crt --set-file dapr_sentry.tls.issuer.keyPEM=./certs/issuer.key --set global.ha.enabled=true --wait
  4. Upgrade CRDs:

    1. kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/21636a9237f2dcecd9c80f329e99b512e8377739/charts/dapr/crds/configuration.yaml
    1. kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/21636a9237f2dcecd9c80f329e99b512e8377739/charts/dapr/crds/components.yaml
  5. Ensure 0.11.x dapr-placement service is still running and wait until all pods are running:

    1. kubectl get pods -n dapr-system -w
    2. NAME READY STATUS RESTARTS AGE
    3. dapr-dashboard-69f5c5c867-mqhg4 1/1 Running 0 42s
    4. dapr-operator-5cdd6b7f9c-9sl7g 1/1 Running 0 41s
    5. dapr-operator-5cdd6b7f9c-jkzjs 1/1 Running 0 29s
    6. dapr-operator-5cdd6b7f9c-qzp8n 1/1 Running 0 34s
    7. dapr-placement-5dcb574777-nlq4t 1/1 Running 0 76s <---- 0.11.x placement
    8. dapr-placement-server-0 1/1 Running 0 41s
    9. dapr-placement-server-1 1/1 Running 0 41s
    10. dapr-placement-server-2 1/1 Running 0 41s
    11. dapr-sentry-84565c747b-7bh8h 1/1 Running 0 35s
    12. dapr-sentry-84565c747b-fdlls 1/1 Running 0 41s
    13. dapr-sentry-84565c747b-ldnsf 1/1 Running 0 29s
    14. dapr-sidecar-injector-68f868668f-6xnbt 1/1 Running 0 41s
    15. dapr-sidecar-injector-68f868668f-j7jcq 1/1 Running 0 29s
    16. dapr-sidecar-injector-68f868668f-ltxq4 1/1 Running 0 36s
  6. Restart your application deployments to update the Dapr runtime.

    1. kubectl rollout restart deploy/<DEPLOYMENT-NAME>
  7. Once the deployment is completed, delete the 0.11.x dapr-placement service:

    1. kubectl delete deployment dapr-placement -n dapr-system
    1. kubectl delete svc dapr-placement -n dapr-system
  8. All done!

Upgrade existing cluster running 1.0.0-rc.1

  1. Export certs:

    1. dapr mtls export -o ./certs
  2. Upgrade Dapr to 1.0.0-rc.2:

    1. helm repo update
    1. helm upgrade dapr dapr/dapr --version 1.0.0-rc.2 --namespace dapr-system --reset-values --set-file dapr_sentry.tls.root.certPEM=./certs/ca.crt --set-file dapr_sentry.tls.issuer.certPEM=./certs/issuer.crt --set-file dapr_sentry.tls.issuer.keyPEM=./certs/issuer.key --set global.ha.enabled=true --wait
  3. Upgrade CRDs:

    1. kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/21636a9237f2dcecd9c80f329e99b512e8377739/charts/dapr/crds/configuration.yaml
    1. kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/21636a9237f2dcecd9c80f329e99b512e8377739/charts/dapr/crds/components.yaml
  4. Ensure all pods are running:

    1. kubectl get pods -n dapr-system -w
    2. NAME READY STATUS RESTARTS AGE
    3. dapr-dashboard-69f5c5c867-mqhg4 1/1 Running 0 42s
    4. dapr-operator-5cdd6b7f9c-9sl7g 1/1 Running 0 41s
    5. dapr-operator-5cdd6b7f9c-jkzjs 1/1 Running 0 29s
    6. dapr-operator-5cdd6b7f9c-qzp8n 1/1 Running 0 34s
    7. dapr-placement-server-0 1/1 Running 0 41s
    8. dapr-placement-server-1 1/1 Running 0 41s
    9. dapr-placement-server-2 1/1 Running 0 41s
    10. dapr-sentry-84565c747b-7bh8h 1/1 Running 0 35s
    11. dapr-sentry-84565c747b-fdlls 1/1 Running 0 41s
    12. dapr-sentry-84565c747b-ldnsf 1/1 Running 0 29s
    13. dapr-sidecar-injector-68f868668f-6xnbt 1/1 Running 0 41s
    14. dapr-sidecar-injector-68f868668f-j7jcq 1/1 Running 0 29s
    15. dapr-sidecar-injector-68f868668f-ltxq4 1/1 Running 0 36s
  5. Restart your application deployments to update the Dapr runtime:

    1. kubectl rollout restart deploy/<DEPLOYMENT-NAME>
  6. All done!

Next steps

Last modified February 16, 2021: Merge pull request #1235 from dapr/update-v0.11 (b4e9fbb)