Skip to content

Remove the proxy-api container#1813

Merged
adleong merged 5 commits intomasterfrom
alex/proxy-api-begone
Oct 29, 2018
Merged

Remove the proxy-api container#1813
adleong merged 5 commits intomasterfrom
alex/proxy-api-begone

Conversation

@adleong
Copy link
Member

@adleong adleong commented Oct 25, 2018

A container called proxy-api runs in the Linkerd2 controller pod. This container listens on port 8086 and serves the proxy-api but does nothing other than forward gRPC requests to the destination container which listens on port 8089.

We remove the proxy-api container altogether and change the destination container to listen on port 8086 instead of 8089. The result is that clients still use the proxy-api by connecting to proxy-api.<ns>.svc.cluster.local:8086 but the controller has one fewer containers. This results in a simpler system that is easier to reason about.

Signed-off-by: Alex Leong alex@buoyant.io

Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong self-assigned this Oct 25, 2018
@adleong adleong requested review from klingerf, olix0r and siggy October 25, 2018 22:13
Signed-off-by: Alex Leong <alex@buoyant.io>
@olix0r
Copy link
Member

olix0r commented Oct 26, 2018

Should we call the destination container proxy-api? Perhaps as a followup?

Copy link
Contributor

@dadjeibaah dadjeibaah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me. Hooray for making things simpler! 📦


func main() {
addr := flag.String("addr", "127.0.0.1:8089", "address to serve on")
addr := flag.String("addr", ":8086", "address to serve on")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we are no longer using 127.0.0.1? I am sure it's not a big deal but just curious

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I didn't make this change at first and it took me hours to figure out what was wrong.

This causes the destination server to listen on all interfaces instead of just localhost. If it only listens on localhost then the proxy can't connect to it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I get it. Thanks!

Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup! I just had a few additional naming nits, but otherwise looks good to me.

addr := flag.String("addr", ":8086", "address to serve on")
metricsAddr := flag.String("metrics-addr", ":9996", "address to serve scrapable metrics on")
destinationAddr := flag.String("destination-addr", "127.0.0.1:8089", "address of destination service")
metricsAddr := flag.String("metrics-addr", ":9999", "address to serve scrapable metrics on")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My (somewhat arbitrary) preference is to continue to run the proxy-api's admin server on 9996. The rest of our controller executables use that convention (e.g. public-api runs on 8085 / 9995; tap runs on 8088 / 9998, etc.).

enableTLS bool
}

// The Destination service serves service discovery information to the proxy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be:

// The proxy-api services serves...

rand.Seed(time.Now().UnixNano())

addr := flag.String("addr", ":8089", "address of destination service")
addr := flag.String("addr", ":8086", "address of destination service")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"address of destination service" => "address of the proxy API" or something similar? On a related note, maybe we should rename this directory from destination-client to proxy-api-client?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone back and forth on this. You can think of this as a client of the the destination gRPC service, which is served by the proxy-api process. So I can see it either way. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, I like the framing that you gave. Am fine leaving this as is.

Signed-off-by: Alex Leong <alex@buoyant.io>
Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐️ Great, thanks for updating!

@adleong adleong merged commit d8b5eba into master Oct 29, 2018
@adleong adleong deleted the alex/proxy-api-begone branch October 29, 2018 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants