Upgrade

There are three components that need to be upgraded:

  • CLI
  • Control Plane
  • Data Plane
    In this guide, we’ll walk you through how to upgrade all three componentsincrementally without taking down any of your services.

Upgrade the CLI

This will upgrade your local CLI to the latest version. You will want to followthese instructions for anywhere that uses the linkerd CLI.

To upgrade the CLI locally, run:

  1. curl -sL https://run.linkerd.io/install | sh

Alternatively, you can download the CLI directly via theLinkerd releases page.

Verify the CLI is installed and running correctly with:

  1. linkerd version

Which should display:

  1. Client version: stable-2.0.0
  2. Server version: v18.8.1

It is expected that the Client and Server versions won’t match at this point inthe process. Nothing has been changed on the cluster, only the local CLI hasbeen updated.

Notes

  • Until you upgrade the control plane, most CLI commands will not work.

    Upgrade the control plane

Now that you have upgraded the CLI running locally, it is time to upgrade theLinkerd control plane on your Kubernetes cluster. Don’t worry, the existing dataplane will continue to operate with a newer version of the control plane andyour meshed services will not go down.

To upgrade the control plane in your environment, run the following command.This will cause a rolling deploy of the control plane components that havechanged.

  1. linkerd install | kubectl apply -f -

The output will be:

  1. namespace "linkerd" configured
  2. serviceaccount "linkerd-controller" unchanged
  3. clusterrole "linkerd-linkerd-controller" configured
  4. clusterrolebinding "linkerd-linkerd-controller" configured
  5. serviceaccount "linkerd-prometheus" unchanged
  6. clusterrole "linkerd-linkerd-prometheus" configured
  7. clusterrolebinding "linkerd-linkerd-prometheus" configured
  8. service "api" configured
  9. service "proxy-api" configured
  10. deployment "controller" configured
  11. service "web" configured
  12. deployment "web" configured
  13. service "prometheus" configured
  14. deployment "prometheus" configured
  15. configmap "prometheus-config" configured
  16. service "grafana" configured
  17. deployment "grafana" configured
  18. configmap "grafana-config" configured

Check to make sure everything is healthy by running:

  1. linkerd check

This will run through a set of checks against your control plane and make surethat it is operating correctly.

To verify the Linkerd control plane version, run:

  1. linkerd version

Which should display:

  1. Client version: stable-2.0.0
  2. Server version: stable-2.0.0

Notes

  • You will lose the historical data from Prometheus. If you would like to havethat data persisted through an upgrade, take a look at thepersistence documentation

    Upgrade the data plane

With a fully up-to-date CLI running locally and Linkerd control plane running onyour Kubernetes cluster, it is time to upgrade the data plane. This will changethe version of the linkerd-proxy sidecar container and run a rolling deploy onyour service.

For each of your meshed services, you will want to take your YAML resourcedefinitions and pass them through linkerd inject. This will update the podspec to have the latest version of the linkerd-proxy sidecar container. Byusing kubectl apply, Kubernetes will do a rolling deploy of your service andupdate the running pods to the latest version.

To do this with the example application, emojivoto, you can run:

  1. curl https://run.linkerd.io/emojivoto.yml \
  2. | linkerd inject - \
  3. | kubectl apply -f -

Check to make sure everything is healthy by running:

  1. linkerd check --proxy

This will run through a set of checks against both your control plane and dataplane to verify that it is operating correctly.

You can make sure that you’ve fully upgraded all the data plane by running:

  1. kubectl get po --all-namespaces -o yaml \
  2. | grep linkerd.io/proxy-version

The output will look something like:

  1. linkerd.io/proxy-version: stable-2.0.0
  2. linkerd.io/proxy-version: stable-2.0.0

If there are any older versions listed, you will want to upgrade them as well.

原文: https://linkerd.io/2/upgrade/