Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket logs endpoint for polling envoy fleet container logs #80

Merged
merged 19 commits into from
Nov 25, 2022

Conversation

kylehodgetts
Copy link
Contributor

@kylehodgetts kylehodgetts commented Nov 2, 2022

Changes

  • add websocket handler and client to api
  • add gorilla websocket as dependency for serving the websocket
  • update websocket container to build and release pipelines

when starting websocket process you can specify the following options

...
flag.IntVar(&port, "port", 8080, "port to listen on")
flag.IntVar(&writeWaitSecs, "write-wait", defaultWriteWaitSecs, "time allowed to write a message to the peer")
flag.IntVar(&pongWaitSecs, "pong-wait", defaultPongWaitSecs, "time allowed to read the next pong message from the peer")
flag.Int64Var(&maxMessageSize, "max-message-size", defaultMaxMessageSize, "maximum message size allowed from peer")
...

when a request for envoy fleet logs comes in, a container log stream for the envoy container in the requested envoy fleet deployment is fetched from the api and the new logs that are sent over the stream are then sent over the websocket.

jasmingacic
jasmingacic previously approved these changes Nov 2, 2022
Copy link
Contributor

@jasmingacic jasmingacic left a comment

Choose a reason for hiding this comment

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

I know it is a draft but It is looking good to be packaged.

Wrap up the docker file and add it to https://github.com/kubeshop/kuskgateway-api-server/blob/main/kgw-api.yaml and we are good to go

jasmingacic
jasmingacic previously approved these changes Nov 4, 2022
Copy link
Contributor

@jasmingacic jasmingacic left a comment

Choose a reason for hiding this comment

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

This is looking good.

Ready to be shipped

@kylehodgetts kylehodgetts changed the title Kylehodgetts/feature/stream logs websocket Websocket logs endpoint for polling envoy fleet container logs Nov 8, 2022
content:
application/json:
schema:
type: object
Copy link
Contributor

Choose a reason for hiding this comment

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

can we change the type to an array of string? because it generates a wrong type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's it? Are you using a library on the front end to generate stuff?

@kylehodgetts kylehodgetts merged commit 8146f39 into main Nov 25, 2022
@kylehodgetts kylehodgetts deleted the kylehodgetts/feature/stream-logs-websocket branch November 25, 2022 10:52
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.

3 participants