Rename linkerd-proxy-api to linkerd-destination#2281
Conversation
|
Note that this shouldn't even be a backwards incompatible change when upgrading an existing cluster: as long as the linkerd-proxy-api service isn't actively deleted (which it shouldn't be in most workflows), then extant running proxies should Just Work, because the linkerd-proxy-api and linkerd-destination service will both point at linkerd-controller pods on the same port. @adleong |
klingerf
left a comment
There was a problem hiding this comment.
Cool, works for me, but I have a bunch of nit-picky feedback. I'm happy to submit a PR against your branch to address this, if that's easier. I've already implemented some of it in my local checkout anyway.
For all the files that you're moving from controller/api/proxy to controller/api/destination, we should update their package name to be "destination" instead of "proxy", to match the directory structure.
Our install templates still reference the ProxyAPIPort field in the installConfig struct, and the proxyAPIPort field in the proxyConfigOptions struct. For consistency I'd like to rename those to DestinationAPIPort and destinationAPIPort.
In the web UI on the service mesh page, we're still calling this container "Proxy API", here:
cli/cmd/logs.go
Outdated
| } | ||
|
|
||
| cmd.PersistentFlags().StringVarP(&options.container, "container", "c", options.container, "Tail logs from the specified container. Options are 'public-api', 'proxy-api', 'tap', 'destination', 'prometheus', 'grafana' or 'linkerd-proxy'") | ||
| cmd.PersistentFlags().StringVarP(&options.container, "container", "c", options.container, "Tail logs from the specified container. Options are 'public-api', 'destination', 'tap', 'destination', 'prometheus', 'grafana' or 'linkerd-proxy'") |
There was a problem hiding this comment.
Not your fault, but 'destination' was already included in the list of containers here, so now it shows up twice.
controller/api/destination/server.go
Outdated
|
|
||
| // this server satisfies 2 gRPC interfaces: | ||
| // 1) linkerd2-proxy-api/destination.Destination (proxy-facing) | ||
| // 1) linkerd2-destination/destination.Destination (proxy-facing) |
There was a problem hiding this comment.
Maybe this is an inadvertent rename? Am pretty sure "linkerd2-proxy-api" refers to the name of the repo here, which isn't changing.
| "github.com/golang/protobuf/proto" | ||
| "github.com/golang/protobuf/ptypes/duration" | ||
| "github.com/linkerd/linkerd2/controller/api/proxy" | ||
| "github.com/linkerd/linkerd2/controller/api/destination" |
There was a problem hiding this comment.
Oof, why does this test depend on the proxy package? Looks like this dependency was introduced in #2195, when we added the linkerd endpoints command. My preference would be to move it to a separate discovery package and have both destination and public depend on that. But I'm happy to do that in a follow-up branch. In the meantime, once you change the destination package name as suggested above, you'll need to use the new package name in this file, like so:
diff --git a/controller/api/public/grpc_server_test.go b/controller/api/public/grpc_server_test.go
index f30030cc..cf3c8b6c 100644
--- a/controller/api/public/grpc_server_test.go
+++ b/controller/api/public/grpc_server_test.go
@@ -549,7 +549,7 @@ func TestEndpoints(t *testing.T) {
}
k8sAPI.Sync()
- discoveryClient, gRPCServer, proxyAPIConn := proxy.InitFakeDiscoveryServer(t, k8sAPI)
+ discoveryClient, gRPCServer, proxyAPIConn := destination.InitFakeDiscoveryServer(t, k8sAPI)
defer gRPCServer.GracefulStop()
defer proxyAPIConn.Close()
controller/cmd/public-api/main.go
Outdated
| prometheusURL := flag.String("prometheus-url", "http://127.0.0.1:9090", "prometheus url") | ||
| metricsAddr := flag.String("metrics-addr", ":9995", "address to serve scrapable metrics on") | ||
| proxyAPIAddr := flag.String("proxy-api-addr", "127.0.0.1:8086", "address of proxy-api service") | ||
| proxyAPIAddr := flag.String("destination-addr", "127.0.0.1:8086", "address of destination service") |
There was a problem hiding this comment.
Can we also rename this variable to destinationAPIAddr? And then for completeness later in this file, proxyAPIConn to destinationAPIConn?
dadjeibaah
left a comment
There was a problem hiding this comment.
This is looking great! I left one comment but it's more of a nit than anything else.
| plane. | ||
| - [`controller`](controller) | ||
| - [`proxy-api`](controller/api/proxy): Accepts requests from `proxy` | ||
| - [`destination`](controller/api/destination): Accepts requests from `proxy` |
There was a problem hiding this comment.
Do we need to reword the description for this to remove the implication that this API could serve other information to the proxy? i.e. "Accepts requests from proxy instances and serves service discovery information"
Up until now, the proxy-api controller service has been the sole service that the proxy communicates with, implementing the majoriry of the API defined in the `linkerd2-proxy-api` repo. But this is about to change: linkerd/linkerd2-proxy-api#25 introduces a new Identity service; and this service must be served outside of the existing proxy-api service in the linkerd-controller deployment (so that it may run under a distinct service account). With this change, the "proxy-api" name becomes less descriptive. It's no longer "the service that serves the API for the proxy," it's "the service that serves the Destination API to the proxy." Therefore, it seems best to bite the bullet and rename this to be the "destination" service (i.e. because it only serves the `io.linkerd.proxy.destination.Destination` service).
Signed-off-by: Kevin Lingerfelt <[email protected]>
Signed-off-by: Kevin Lingerfelt <[email protected]>
Signed-off-by: Kevin Lingerfelt <[email protected]>
ad11905 to
762a4b5
Compare
klingerf
left a comment
There was a problem hiding this comment.
@olix0r Ok, I pushed some commits addressing my feedback and @dadjeibaah's feedback, and I rebased to latest master. I think we freaked the DCO bot out though...
Anyway, once you've reviewed my changes, feel free to merge. Looks good to me.
|
thank you, @klingerf ! |
dadjeibaah
left a comment
There was a problem hiding this comment.
Thanks for updating this @klingerf! 📦

Up until now, the proxy-api controller service has been the sole service
that the proxy communicates with, implementing the majoriry of the API
defined in the
linkerd2-proxy-apirepo. But this is about to change:linkerd/linkerd2-proxy-api#25 introduces a new Identity service; and
this service must be served outside of the existing proxy-api service
in the linkerd-controller deployment (so that it may run under a
distinct service account).
With this change, the "proxy-api" name becomes less descriptive. It's no
longer "the service that serves the API for the proxy," it's "the
service that serves the Destination API to the proxy." Therefore, it
seems best to bite the bullet and rename this to be the "destination"
service.