linkerd2/controller/api/destination
Kevin Leimkuhler 6b7a39c9fa
Set FQN in profile resolutions (#5019)
## Motivation

Closes #5016

Depends on linkerd/linkerd2-proxy-api#44

## Solution

A `profileTranslator` exists for each service and now has a new
`fullyQualifiedName` field.

This field is used to set the `FullyQualifiedName` field of
`DestinationProfile`s each time an update is sent.

In the case that no service profile exists for a service, a default
`DestinationProfile` is created and we can use the field to set the correct
name.

In the case that a service profile does exist for a service, we still use this
field to set the name to keep it consistent.

### Example

Install linkerd on a cluster and run the destination server:

```
go run controller/cmd/main.go destination -kubeconfig ~/.kube/config
```

Get the IP of a service. Here, we'll get the ip for `linkerd-identity`:

```
> kubectl get -n linkerd svc/linkerd-identity
NAME               TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
linkerd-identity   ClusterIP   10.43.161.68   <none>        8080/TCP   4h25m
```

Get the profile of `linkerd-identity` from service name or IP and note the
`FullyQualifiedName` field:

```
> go run controller/script/destination-client/main.go -method getProfile -path 10.43.161.68:8080
INFO[0000] fully_qualified_name:"linkerd-identity.linkerd.svc.cluster.local" ..
```

```
> go run controller/script/destination-client/main.go -method getProfile -path linkerd-identity.linkerd.svc.cluster.local
INFO[0000] fully_qualified_name:"linkerd-identity.linkerd.svc.cluster.local" ..
```

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-10-01 11:06:00 -04:00
..
watcher Bump k8s client-go to v0.19.2 (#5002) 2020-09-28 12:45:18 -05:00
client.go Trace Control plane Components with OC (#3495) 2019-10-18 12:19:13 -07:00
endpoint_translator.go Bump k8s client-go to v0.19.2 (#5002) 2020-09-28 12:45:18 -05:00
endpoint_translator_test.go Bump k8s client-go to v0.19.2 (#5002) 2020-09-28 12:45:18 -05:00
fallback_profile_listener.go Update ServiceProfile CRD to version v1alpha2 and remove validation (#3078) 2019-07-23 11:46:31 -07:00
fallback_profile_listener_test.go Update ServiceProfile CRD to version v1alpha2 and remove validation (#3078) 2019-07-23 11:46:31 -07:00
profile_translator.go Set FQN in profile resolutions (#5019) 2020-10-01 11:06:00 -04:00
profile_translator_test.go profiles: Eliminate default timeout (#4958) 2020-09-10 14:00:18 -07:00
server.go Set FQN in profile resolutions (#5019) 2020-10-01 11:06:00 -04:00
server_test.go Set FQN in profile resolutions (#5019) 2020-10-01 11:06:00 -04:00
traffic_split_adaptor.go Always return destination overrides for services (#4890) 2020-08-19 12:25:58 -07:00
traffic_split_adaptor_test.go Always return destination overrides for services (#4890) 2020-08-19 12:25:58 -07:00