-
Notifications
You must be signed in to change notification settings - Fork 816
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
Add cluster creation Quickstart. #122
Conversation
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 a great start, but I think it would be better as a series of gcloud steps, rather than using deployment manager - I think it will feel closer to what our users are actually likely to do. Deployment manager is a tad niche to be honest.
Also need a section on Minikube.
Let me know your thoughts on my review comments.
examples/cluster/README.md
Outdated
@@ -0,0 +1,84 @@ | |||
# Creating a Kubernetes Cluster Quickstart |
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 feel like we want a better title for this - because we are both creating a cluster, and installing Agones
"Install and Configure Agones on Kubernetes Quickstart" ?
examples/cluster/README.md
Outdated
@@ -0,0 +1,84 @@ | |||
# Creating a Kubernetes Cluster Quickstart | |||
|
|||
In this quickstart, we will create a Kubernetes cluster, and populate it with the CRD's ([Custom Resource Definitions][crd]), service accounts, and [RBAC][rbac] roles and bindings that power Agones. |
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 don't think we need to mention CRD's - and if we do, we should use the full name, at least the first time.
"In this quickstart we will create a Kubernetes cluster and install Agones"
^ removed references to the technical Kubernetes terms until after the user has done the @steps.
Let's mention what the install script actually did (CRD, RBAC, etc) after we've installed, as to not make the installation steps too intimidating for those not that familiar with Kubermetes
examples/cluster/README.md
Outdated
[crd]: https://kubernetes.io/docs/concepts/api-extension/custom-resources/ | ||
[rbac]: https://kubernetes.io/docs/admin/authorization/rbac/ | ||
|
||
## Prerequisites |
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 split this in two - one for GKE, and one for Minikube?
(We can lift the command for starting minikube from here)
examples/cluster/README.md
Outdated
[gcloud-install]: https://cloud.google.com/sdk/docs/#install_the_latest_cloud_tools_version_cloudsdk_current_version | ||
[kubectl-install]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ | ||
|
||
We'll also need a Google Cloud Project, which we can create via the [Developer Console][pantheon], or by running `gcloud init`, following the prompts, and selecting `Create a new project` when asked which project to use. |
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.
pantheon the term, and this link is internal only. Remove and replace with console.cloud.google.com
examples/cluster/README.md
Outdated
|
||
## Creating a Cluster | ||
|
||
We will use the deployment config defined in [gke-test-cluster/deployment.yml](gke-test-cluster/deployment.yml) and [gke-test-cluster/cluster.yml.jinja](gke-test-cluster/cluster.yml.jinja). If you would like more control over the zone, cluster name, or other details, you can edit those files accordingly before running the command to create the cluster. But first, let's make sure we're authenticated. |
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 - I wasn't clear on my thinking with this.
I think it would be ideal if the user could do this without having to download/git clone anything other than the gcloud tools (maybe we direct them to cloud shell for this - that would actually be really cool - maybe we do that?)
So rather than making them git clone
- can we instead have a series of gcloud commands to setup the cluster, and setup the firewall rules and configure rbac.
I think it will be a better learning experience for the user so they can see how they might do this themselves.
How does that sound?
examples/cluster/README.md
Outdated
--clusterrole cluster-admin --user $(gcloud config get-value account) | ||
``` | ||
|
||
## Applying Agones CRD's |
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.
Let's use "Custom Resource Definition" (and we can link to what they are here).
Let's not assume our users know what these acronyms are.
examples/cluster/README.md
Outdated
Finally, it's time to define the CRD's that power Agones to the cluster. | ||
|
||
```bash | ||
kubectl apply -f ../../install.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.
kubectl can pull straight from a URL - so once we're open source, we can link directly to the install.yaml in the release-1.0
branch, and people can install directly without having to download any code.
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 probably wasn't clear - release-1.0 branch can go live once my do-release
#121 PR has been approved and merged, and I'll keep it up to date.
examples/cluster/README.md
Outdated
kubectl apply -f ../../install.yaml | ||
``` | ||
|
||
That's it! You're ready to create GameServer type resources, using the `gcr.io/agones-images` repository. For a quick and easy example of how to do so, see the [simple-udp example](../simple-udp). |
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 placeholder for the Game Server quickstart that @Kuqd is currently working on?
e5664a2
to
c8ee09c
Compare
docs/installing_agones.md
Outdated
Finally, we install Agones to the cluster. | ||
|
||
```bash | ||
kubectl apply -f ../../install.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.
This looks awesome!
Very quick question - was this meant to point to the URL? Or did we want to update this when we go public on Monday?
docs/installing_agones.md
Outdated
|
||
## Creating an `agones` profile | ||
|
||
We need a minikube profile for `agones`. |
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.
So we don't need to have one, maybe this is more of a nice to have?
c8ee09c
to
580be35
Compare
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 minor things I think we could add(some extra links and the like), but this is great!
I also tested everything out on GKE and Minikube, and it all works!
docs/installing_agones.md
Outdated
|
||
# Table of contents | ||
|
||
1. [Table of contents](#table-of-contents) |
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.
So I totally just noticed that I did the same thing in my build
TOC, but should we have the table of contents listed in our table contents?
Or do we need to go deeper 😆
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.
Yeah I was just copying that. I'm good kicking it.
docs/installing_agones.md
Outdated
|
||
Take the following steps to enable the Kubernetes Engine API: | ||
|
||
1. Visit the Kubernetes Engine page in the Google Cloud Platform Console. |
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 can link to: https://console.cloud.google.com/kubernetes/list
docs/installing_agones.md
Outdated
1. Visit the Kubernetes Engine page in the Google Cloud Platform Console. | ||
1. Create or select a project. | ||
1. Wait for the API and related services to be enabled. This can take several minutes. | ||
1. [Enable billing][billing] for your project. |
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.
Curious - do you have to enable billing, or can you run off the free trial?
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 sign up for the free trial you still need to enter credit card or bank account information, though it doesn't explicitly say you need to enable billing as well. But I would think so.
docs/installing_agones.md
Outdated
Our Project ID is chosen or generated when we create the project. The compute zone will be something like `us-west1-a`. A full list can be found [here][zones]. | ||
|
||
```bash | ||
gcloud config set project [PROJECT_ID] |
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 a better path be to send them down gcloud init
(at the very least they are running locally, rather than on cloud shell? - on cloud shell, they only need to set the compute/zone
)
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.
Reworked this section to
- run
gcloud init
in the Local Shell section (including choosing a compute zone) - set compute/zone in the Cloud Shell section
docs/installing_agones.md
Outdated
A [cluster][cluster] consists of at least one *cluster master* machine and multiple worker machines called *nodes*: [Compute Engine virtual machine][vms] instances that run the Kubernetes processes necessary to make them part of the cluster. | ||
|
||
```bash | ||
gcloud container clusters create [CLUSTER_NAME] --cluster-version=v1.9.0 \ |
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.
Version should be 1.9.2-gke.1
So:
gcloud container clusters create [CLUSTER_NAME] --cluster-version=1.9.2-gke.1 \
--no-enable-legacy-authorization \
--tags=game-server \
--enable-basic-auth \
--password=supersecretpassword \
--scopes=https://www.googleapis.com/auth/devstorage.read_only,compute-rw,cloud-platform```
docs/installing_agones.md
Outdated
--password=supersecretpassword \ | ||
--scopes=https://www.googleapis.com/auth/devstorage.read_only,compute-rw,cloud-platform | ||
``` | ||
|
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.
Not sure where, but we I think should probably mention that this defaults to creating a 3 node cluster and what machines it creates (n1-standard-1), just so people know the resources they are spinning up.
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 point. I can include the --machine-type/--num-nodes params with an explanations even if they're the default values
docs/installing_agones.md
Outdated
* enable-basic-auth/password: Sets the master auth scheme for interacting with the cluster. | ||
* scopes: Defines the Oauth scopes required by the nodes. | ||
|
||
Finally, let's tell `gcloud` that we are speaking with this cluster, and get auth credentials for 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.
"for it" => "for kubectl to use"
Just thinking to be explicit that the auth credentials are for kubectl.
docs/installing_agones.md
Outdated
kubectl apply -f https://raw.githubusercontent.com/googlecloudplatform/agones/release-0.1/install.yaml | ||
``` | ||
|
||
That's it! This creates the [Custom Resource Definitions][crds] that power Agones and allows us to define resources of type `GameServer`. |
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.
Shall we add a step that confirms that the install worked correctly.
I was thinking something like:
To confirm that Agones is running correctly, run the following:
kubectl logs --namespace=agones-system --selector=stable.agones.dev/role=controller
This should return a result like:
{"Version":"0.1","alwaysPullSidecarImage":false,"cert-file":"/home/agones/certs/server.crt","key-file":"/home/agones/certs/server.key","level":"info","maxPort":8000,"minPort":7000,"msg":"starting gameServer operator...","sidecar":"gcr.io/agones-images/agones-sdk:0.1","source":"main","time":"2018-03-02T01:15:06Z"}
....
And no errors should be displayed in the output.
WDYT? I figured the best way would to output the logs, but this way, we don't have to specify the Pod name.
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 works.
As an alternative, if we wanted to use describe
, did you know that if you ask kubectl
to describe a resource type of which you only have one instance, it will just describe that instance?
I use kubectl describe gs
all the time when I don't feel like typing out the name of it.
Which do you think would be better? There'd be no danger of there being more than one pod even if it's a cluster they've used before, since we create it in the agones-system
namespace.
|
||
That's it! This creates the [Custom Resource Definitions][crds] that power Agones and allows us to define resources of type `GameServer`. | ||
|
||
[crds]: https://kubernetes.io/docs/concepts/api-extension/custom-resources/ |
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.
Shall we add a (for when #124 is merged):
What's next
- Go through the Create a Game Server Quickstart
945ab0d
to
129c70a
Compare
1. Visit the [Kubernetes Engine][kubernetes] page in the Google Cloud Platform Console. | ||
1. Create or select a project. | ||
1. Wait for the API and related services to be enabled. This can take several minutes. | ||
1. [Enable billing][billing] for your project. |
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.
Stealing from the istio docs, shall we add:
If you are not an existing GCP user, you may be able to enrol for a $300 US Free Trial credit.
Just so that it's clear you can use the free trial 👍
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 :)
88e1777
to
6445aae
Compare
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.
Found a couple of broken links, but otherwise - LGTM!
README.md
Outdated
|
||
_Note:_ There has yet to be a release of Agones, so you will need to edit the `install.yaml` to specify a | ||
development release or [build from source](build/README.md) | ||
Follow [these instructions][./docs/installing_agones.md] to create a cluster on Google Kubernetes Engine (GKE) or Minikube, and install Agones. |
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.
Whoops, broken link! :)
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/installing_agones.md
Outdated
|
||
* Go through the [Create a Game Server Quickstart][quickstart] | ||
|
||
[quickstart]: docs/create_gameserver.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.
Broken link - should be create_gameserver.md
(since it is already in the docs folder)
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.
damn it. Done.
6445aae
to
df40107
Compare
Closes #93