Service profiles

A service profile is implemented as a Custom Resource Definition (CRD) in Kubernetes and is used to define a list of routes for a service that can then be used by the Linkerd proxy to report per-route metrics and configure retries and timeouts. 

Service profiles can be generated automatically if you have swagger or protobuf specifications for your services. For example, the following code will create a service profile from a webapp.swagger or web.proto file for the webapp service. This is then fed to kubectl to generate the service profile:

$ linkerd profile --open-api webapp.swagger webapp | kubectl apply -f -

$ linkerd profile --proto webapp.proto webapp | kubectl apply -f -

If no service profile specifications exist, Linkerd can also automatically generate a service profile by watching live traffic. The following example shows that tap is used to get the live feed for the emojivoto service for 10 seconds. The output is fed to kubectl to create the service profile:

$ linkerd profile -n emojivoto web-svc --tap deploy/web --tap-duration 10s | kubectl apply -f -

Linkerd also allows you to generate a template, as follows:

$ linkerd profile -n emjoivoto web-svc --template

Make changes to the emojivoto microservice template and then apply it using kubectl to create the service profile.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.108.9