-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Documentation: grpc example #2307
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/assign @aledbf |
@pcj thank you for this example. Please check the headers of the About the PR:
|
thanks @aledbf I'll fix up the go headers. So that I understand you correctly:
What about the kube-cert-manager? Anyway, I guess I should have asked this already, but what is your vision of the files necessary to have a functioning gRPC example? The one I have provided is pretty complete. So, what is the best combination of maintainability but still approachable? An example with multiple magical leaps within it will be pretty frustrating for people wanting to try it out. Thanks for the prompt review! I'll try to keep to the same standard but I have to steal time away from other commitments, but I'll do my best. |
Yes
Yes
No. Just use grpcurl to show the example working. We can publish your image in quay.io so the user doesn't need to build a custom one and have a reference to your code to see how to build a gRPC app
Agree. Your example is self-contained which I like but you assume too much about the environment where the cluster is running.
Agree. That is why I just said you should use the default user guide and avoid using too many references to a particular cloud provider. Keep in mind this must work OOTB with minikube too. |
@pcj ping |
Hi @aledbf sorry for delay, have not lost interest here... traveling now but I think I can get this taken care of by Friday or Saturday. |
@aledbf Apologies for delay. Example is now just a README.md and a few yaml files. I moved implementation of the grpc service to a separate repo and pushed that to a container registry. |
Codecov Report
@@ Coverage Diff @@
## master #2307 +/- ##
==========================================
- Coverage 41.75% 41.61% -0.14%
==========================================
Files 74 74
Lines 5291 5291
==========================================
- Hits 2209 2202 -7
- Misses 2786 2792 +6
- Partials 296 297 +1
Continue to review full report at Codecov.
|
docs/examples/grpc/ingress.yaml
Outdated
metadata: | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
ingress.kubernetes.io/ssl-redirect: "true" |
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.
nginx prefix missing
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.
Done
docs/examples/grpc/cert.yaml
Outdated
name: fortune-teller.stack.build | ||
namespace: default | ||
labels: | ||
stable.k8s.psg.io/kcm.class: "kube-cert-manager" |
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.
is this label required?
@pcj just two comments. Also please squash the commits and we are ready to merge |
/approve |
OK, comments addressed & fixed, squashed into single commit and force pushed. Should be ready for merge. Thx. |
docs/examples/grpc/README.md
Outdated
|
||
### Step 2: the kubernetes `Service` | ||
|
||
```yaml |
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.
Maybe a link to the corresponding YAML files would be better than copying their content directly here?
Or the other way around, keep the content of the manifests in the markdown but delete the files.
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.
Sure I can delete the redundant content. I prefer the readability of the yaml in the markdown but could be convinced otherwise. Unless another feels strongly, I'll just delete the yaml files.
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 like the style in other docs where we provide complete kubectl
command:
cat docs/examples/grpc/svc.yaml | kubectl apply --namespace=fortune-teller-app -f -
Instead of relative path docs/examples/grpc/svc.yaml
we could also use remote path - I don't have any preference there.
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.
@ElvinEfendi done.
docs/examples/grpc/app.yaml
Outdated
spec: | ||
containers: | ||
- name: fortune-teller-app | ||
image: container.stack.build/pcj/fortune-teller:latest |
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.
Should we host this in the repo together with echoserver and other tools @aledbf?
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.
That makes sense
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 was planning on putting this in quay.io, but it seems they still don't support docker registry v2.2 so I decided against it (ref bazelbuild/rules_docker#102 gentle ping @philips).
E0502 07:46:27.210516 20444 docker_session_.py:335] Error during upload of: quay.io/pcj/fortune-teller:latest
F0502 07:46:27.210813 20444 fast_pusher_.py:162] Error publishing quay.io/pcj/fortune-teller:latest: response: {'status': '415', 'content-length': '131', 'server': 'nginx/1.13.6', 'connection': 'keep-alive', 'date': 'Wed, 02 May 2018 13:46:27 GMT', 'content-type': 'application/json'}
manifest invalid: {u'message': u'manifest schema version not supported'}
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.
@aledbf Is hosting this image as @antoineco suggests part of this 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.
Yes please
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.
Sorry for the chatter here but I'm unclear on the requirements. Can I just mkdir images/grpc-fortune-teller
, copy the existing code from https://github.com/stackb/grpc-fortune-teller and call it good, or do the images there need to work within some larger build workflow?
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.
Can I just mkdir images/grpc-fortune-teller
Yes. After merging the PR I will publish the image in the same place than the ingress image
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.
What will the anticipated image name be? (for the app.yaml
image name). Something under quay.io, gcr.io/google_containers, or elsewhere?
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.
quay.io/kubernetes-ingress-controller/grpc-fortune-teller:0.1
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.
Done
075aaa5
to
710127c
Compare
OK, I've added the grpc-fortune-teller under @aledbf, assuming you have bazel installed, you should be able to just type |
Unclear on why travis failed. |
My general feeling is that we could definitely use a simpler example for demonstrating the use of gRPC. Fileutil.go and Bazel especially make me feel like we're showcasing a full-fledged Go project. Regarding the content of the PR itself: |
@pcj you need to add boilerplate code (license) to one or more files. Please execute |
Done. Boilerplate added to *.go files and refactored fileutil away. |
Deps are managed by bazel so these will fail to show up in the vendor tree, triggering false positive build fail.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, antoineco, pcj 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 |
Closes #2284