-
Notifications
You must be signed in to change notification settings - Fork 97
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 for running event-gateway on k8s #498
Conversation
Codecov Report
@@ Coverage Diff @@
## master #498 +/- ##
=======================================
Coverage 71.01% 71.01%
=======================================
Files 37 37
Lines 2201 2201
=======================================
Hits 1563 1563
Misses 575 575
Partials 63 63 Continue to review full report at Codecov.
|
README.md
Outdated
@@ -92,6 +92,15 @@ Then run the binary in development mode with: | |||
$ event-gateway -dev | |||
``` | |||
|
|||
### Kubernetes | |||
|
|||
We've added `helm` charts to the repo for a quick deploy to an existing cluster. Please note, the default |
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 instead of writing "we've added" we could change it to something like "There are"
command: ["--db-hosts=eg-etcd-cluster-client:2379", "--log-level=debug"] |
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's the reason for this change?
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 prefer the GNU
CLI flags and changed these accordingly. In golang now there isn't really any difference between the single -
and the double --
when processing long flags. IMHO, short flags are single -
and long flags are --
.
https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html
If you're not happy with this change I'm happy to revert.
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.
Would be great to be consistent in the docs. Here https://github.com/serverless/event-gateway/blob/cd14c4004bb4aa3c3082526235fff0d8a357736d/docs/running-locally.md e.g. we use single -
. I'm fine with both options.
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.
Also a good call here, will update to keep the double --
for consistency.
contrib/README.md
Outdated
|
||
With your environment set up, you can now jump to the [examples](#examples) section to put your `event-gateway` to use! | ||
|
||
## Minikube or local clusters |
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 think we should simply link to this page https://kubernetes.io/docs/tasks/tools/install-minikube/
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.
Also lates version of Docker includes simply way to run K8s locally https://docs.docker.com/docker-for-mac/kubernetes/#override-the-default-orchestrator. I think we should also include that in this guide. Tho it can be done as a separate PR (task).
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 would disagree with your first comment, as the k8s
documentation is notoriously difficult to read. I was debating where to include the raw fedora
instructions but opted to do it ourselves because each environment is different. Still pending instructions on the MacOS side, but will update that shortly.
ACK on the second comment, will investigate this option soon.
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.
Regarding installation guide, so maybe better options is to extract it to separate md file? Probably most of the people interested in k8s will have minikube already installed. I think it will be better this guide will be straight-forward.
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.
Good call on that, I'll move the instructions to a supplemental file and link to it here. Will ping you when that update is ready.
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.
@sebito91 This looks great. Very clean scripts and the README is mostly pretty clear.
The biggest areas I got hung up on are:
- Minikube and what areas that affects.
- Duplicated helm portions in the quickstart?
- Environment variable vs. IP address for EG.
Happy to discuss further.
contrib/README.md
Outdated
instructions [here](https://docs.helm.sh/using_helm/#quickstart) if you have not set this up previously. | ||
|
||
**NOTE:** This portion of the config expects you to have a pre-existing kubernetes cluster (not minikube). For | ||
local development please check the [minikube](MINIKUBE.md) information below. |
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.
@sebito91 I'm confused about this note. Couple questions:
-
Is this different than the GKE vs. minikube note in the first paragraph of this section?
-
Does it mean I don't run the helm commands below?
-
It says to check the minikube information "below", but does that refer to the MINIKUBE.md doc? Don't see anything below.
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.
Ah, good call. @mthenw had comments earlier to move the minikube
instructions from this doc to a standalone, the MINIKUBE.md
you see now. I'll update this to remove the below
from the statement.
Other than that, the instructions should be the exact same pushing to minikube
locally or to GKE. I have to admit I have not tested the latter.
contrib/README.md
Outdated
|
||
With your environment set up, you can now jump to the [examples](#examples) section to put your `event-gateway` to use! | ||
|
||
### Using helm |
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 Using helm
section a duplicate of the section above? Should I be running both the commands above and the commands in this Using helm
section?
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.
They are indeed largely the same (if not exact now). Initially the requirements were different for minikube
, specifically since minikube
doesn't support LoadBalancers like GKE would. We replaced the LB with Ingress across the board, so the instructions are largely the same.
I think in honesty we should just remove each of the helm
and CRD
sections here, they are confusing.
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.
Agree that this section is confusing and seems redundant. Can we simply remove this and rename Quickstart as "Quickstart using helm". We can add a CRD Quickstart later
contrib/README.md
Outdated
routing will ensure the request goes to the proper service managed by the cluster. | ||
|
||
**DOUBLENOTE:** if you did not want to use an environment variable for connecting to the `event-gateway`, you can use | ||
the IP address of your Ingress. Please check the [Quickstart](#quickstart) for reference. |
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'm a little confused on the env variable vs. IP address split here.
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 does say the same thing :/
It should reference the /etc/hosts
instructions.
contrib/README.md
Outdated
curl --request POST \ | ||
--url http://eventgateway.minikube/v1/spaces/default/eventtypes \ | ||
--header 'content-type: application/json' \ | ||
--data '{ "name": "eventgateway.function.invoked" }' |
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 might be good to do the default http.request
Event Type. Then, after setting up a subscription, show the user how to emit an http.request
event and get a response.
On the other hand, it could require a working function example, which would add length to the tutorial. 🤔 Open to thoughts here.
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.
These are loosely arranged in functions as a reference, not necessarily in any particular sequence. I think if anything we might want a separate tutorial on how to use an actual EG example from https://github.com/serverless/event-gateway/tree/master/examples
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.
Yep good point. Not worth including in this resource ATM.
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.
@sebito91 Looks good overall. Left some comments for your review though
README.md
Outdated
|
||
The repo contains `helm` charts for a quick deploy to an existing cluster. Please note, the default | ||
installation requires proper `loadbalancer` support out of the box. If you don't have this enabled in your | ||
cluster you can check the `minikube` instructions for more guidance. |
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.
@sebito91 When we say "requires proper loadbalancer support OOTB" what do we mean? Didn't we switch to using an ingress?
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 needs to be removed, great catch.
README.md
Outdated
cluster you can check the `minikube` instructions for more guidance. | ||
|
||
[Helm Chart](./contrib/helm/README.md) | ||
[Minikube](./contrib/helm/README.md) |
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.
Are both of these links correct?
Should Minikube link out to Minikube readme ?
contrib/MINIKUBE.md
Outdated
# Event Gateway on Kubernetes (minikube) | ||
|
||
To develop and deploy the `event-gateway` and all related elements locally, the easiest method includes using | ||
the [minikube](https://github.com/kubernetes/minikube) toolset. To get started, set up your cluster with the |
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.
would recommend calling it "...set up your local cluster with..."
contrib/README.md
Outdated
# Event Gateway on Kubernetes | ||
|
||
This chart deploys the Event Gateway with etcd onto a Kubernetes cluster. Please note, the default instructions expect | ||
an existing kubernetes cluster that supports ingress, such as GKE. If your environment doesn't have ingress support |
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.
Are there any instructions that users can use to test if their cluster supports ingress?
Also, here we say ingress, but in the top level Readme, we say load balancer which should be fixed.
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.
FIxed the top-level README but I'm not quite sure if there are examples to check for ingress enablement. From a minikube
perspective we need to active enable the addons (e.g. minikube addons enable ingress
), but from from hosted version of k8s I'm not sure.
I can dig into this and amend as necessary.
contrib/README.md
Outdated
|
||
**etcd-operator** | ||
```bash | ||
helm install stable/etcd-operator --name ego [--namespace <namespace>] |
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 the release name (--name) required? I guess its autogenerated if not specified
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, that's correct. It's better to name it than to go searching for the service later.
[sborza@icebox]:~/src/github.com/serverless/event-gateway (k8s):$ helm install -h
This command installs a chart archive.
...
Usage:
helm install [CHART] [flags]
Flags:
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--dep-up run helm dependency update before installing the chart
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.
--dry-run simulate an install
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "/home/sborza/.gnupg/pubring.gpg")
-n, --name string release name. If unspecified, it will autogenerate one for you
...
contrib/README.md
Outdated
|
||
**event-gateway** | ||
```bash | ||
helm install event-gateway --name eg [--namespace <namespace>] |
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.
Same comment as above
contrib/README.md
Outdated
|
||
With your environment set up, you can now jump to the [examples](#examples) section to put your `event-gateway` to use! | ||
|
||
### Using helm |
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.
Agree that this section is confusing and seems redundant. Can we simply remove this and rename Quickstart as "Quickstart using helm". We can add a CRD Quickstart later
contrib/README.md
Outdated
} | ||
``` | ||
|
||
#### Register an event |
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.
We are registering an 'Event Type' as against an 'Event'. Would be good to update references in this section to reflect the same
contrib/README.md
Outdated
1. [Quickstart](#quickstart) | ||
1. [Using helm](#using-helm) | ||
1. [Using custom resources](#using-custom-resources) | ||
1. [Examples](#examples) |
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 section should ideally take the user through an end to end EG example that it links out to. Just providing Curl examples for the API is not incredibly satisfying as an outcome for what EG enables developers to do. Can be done in a follow up PR. @alexdebrie @sebito91 Please review.
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.
A few more notes
contrib/MINIKUBE.md
Outdated
|
||
To develop and deploy the `event-gateway` and all related elements locally, the easiest method includes using | ||
the [minikube](https://github.com/kubernetes/minikube) toolset. To get started, set up your cluster with the | ||
following instructions... |
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.
Remove "..."
contrib/README.md
Outdated
instructions [here](https://docs.helm.sh/using_helm/#quickstart) if you have not set this up previously. | ||
|
||
**NOTE:** This portion of the config expects you to have a pre-existing kubernetes cluster (not minikube). For | ||
local development please check the [minikube](MINIKUBE.md) information. |
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 note still needed? As I understand it, the helm
instructions work with both minikube and something like GKE?
contrib/README.md
Outdated
Next we'll need to collect the Event Gateway IP to use on the CLI. We have a couple of options available to reference the | ||
internal services of the kubernetes cluster exposed via Ingress: | ||
|
||
1. add Ingress IP to /etc/hosts (recommended) |
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 switching between eventgateway.minikube
and EVENT_GATEWAY_URL
environment variable is confusing to me. I'd suggest consolidating on one or the other just to make it easier. The more forks in a tutorial, the more confusing it gets.
My guess would be to use the environment variable as some people may be averse to messing with their /etc/hosts
file but will defer to you.
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 hoping that showing both methods in various functions would be helpful, given that we need to specify a header
in one version but not the other.
Do you think this would be better suited for the TUTORIAL.md
we discussed offline?
contrib/README.md
Outdated
curl --request POST \ | ||
--url http://eventgateway.minikube/v1/spaces/default/eventtypes \ | ||
--header 'content-type: application/json' \ | ||
--data '{ "name": "eventgateway.function.invoked" }' |
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.
Yep good point. Not worth including in this resource ATM.
contrib/README.md
Outdated
@@ -0,0 +1,341 @@ | |||
# Event Gateway on Kubernetes |
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 readme for the whole contrib directory. It also contains other stuff (Terraform module) so please rename this README and create another one pointing also to https://github.com/serverless/event-gateway/blob/master/contrib/terraform/README.md
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.
OK, I can move this down a level
contrib/helm/MINIKUBE.md
Outdated
@@ -0,0 +1,66 @@ | |||
# Event Gateway on Kubernetes (minikube) |
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 doc is about setting up minikube. I think we should rename the title.
``` | ||
|
||
### Kubernetes |
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.
We do not point to the long readme file here. Only to MINIKUBE guide. I think it's worth to link "helm
chart" to the /contrib/helm dir.
@@ -8,7 +8,6 @@ | |||
"@serverless/serverless-event-gateway-plugin": "^0.7.3" |
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 we remove those files from 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.
LGTM
What did you implement:
Update instructions on deploying to kubernetes, both local and remote clusters.
How did you implement it:
Helm charts, custom resource definitions and kubernetes
How can we verify it:
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO