-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adding WebSocket Go example #6109
Conversation
✅ Deploy Preview for knative ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
b9cde4e
to
b6d1241
Compare
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
b6d1241
to
d5e6911
Compare
template: | ||
spec: | ||
containers: | ||
- image: ko://github.com/knative/docs/code-samples/serving/websockets-go/cmd/server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other samples have docker.io/{username}/grpc-ping-go, so let's keep consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But than the ko
does not work. (also the docker buildx
does not directly work for me w/ podman
, b/c of the --push
. that's why I want to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we remove that part for now, we don't use ko in the other examples. I am not saying we should or not use it, just suggesting that we keep things as is for now. Updating the samples with a different build approach is the topic for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past we added buildx and since it touches many files any other addition should be more visible and get proper reviews. On top of that, if something does not work we can open another issue and fix it (migrate to ko etc).
Btw I am in favor of adding more options as suggested here #5273 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# This is based on Debian and sets the GOPATH to /go. | ||
FROM golang:latest as builder | ||
|
||
ARG TARGETOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally works as expected:
$ wscat --connect 127.0.0.1:8080/ws
Connected (press CTRL+C to quit)
> hello
< hello
> hi
< hi
>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with the other samples eg. grpc we need to add a section for running with docker, something like in the example for grpc
docker run --rm {username}/grpc-ping-go \
/client \
-server_addr="grpc-ping.default.1.2.3.4.sslip.io:80" \
-insecure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never done that before. I mostly do never use docker
, I just run things w/ ko
feel free to add things to this post.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand but the docs have a common pattern to follow for now see my comment above about ko
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker run --rm docker.io/matzew/ws-goss \
/server \
-server_addr="websockets-go.default.1.2.3.4.sslip.io:80" \
-insecure
I am not getting this to work, please feel free to add the correct content. Otherwise we merge this and deal with this later?
The section above shows how to the binary w/in kube already. Not really adding too much value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do go run cmd/server/main.go
...
and localhost - that is simple enought - and has similar value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok let's fix this in #6110
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, skonto The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
As per title