Adding Your Service
For convenience, Linkerd provides a linkerd inject
text transform command will add this annotation to a given Kubernetes manifest. Of course, these annotations can be set by other mechanisms.
Note that simply adding the annotation to a resource with pre-existing pods will not automatically inject those pods. You will need to update the pods (e.g. with kubectl rollout restart
etc.) for them to be injected. With a , the proxy often can be added to a live service without interruption.)
To add the data plane proxies to a service defined in a Kubernetes manifest, you can use linkerd inject
to add the annotations before applying the manifest to Kubernetes:
This example transforms the file to add injection annotations in the correct places, then applies it to the cluster.
Note that it may take several seconds for these metrics to appear once the data plane proxies have been injected.
Alternatively, you can query Kubernetes for the list of containers in the pods, and ensure that the proxy is listed:
If everything was successful, you’ll see linkerd-proxy
in the output, e.g.:
Finally, you can verify that everything is working by verifying that the corresponding resources are reported to be meshed in the “Meshed” column of the Linkerd dashboard.
Dashboard
Note
There is currently an whereby network calls made during initialization of your application may fail as the linkerd-proxy
has yet to start. If your application exits when these initializations fail, and has a of Always
(default) or OnFailure
(providing your application exits with with a failure i.e. exit(1)
), your container will restart with the ready, thus allowing your application to successfully complete initializations.
For more information on how the inject command works and all of the parameters that can be set, see the linkerd inject
reference page.