-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split development into subsections and removed some old tutorials (#320)
- Loading branch information
Showing
7 changed files
with
178 additions
and
318 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
layout: default | ||
title: Development | ||
nav_order: 14 | ||
has_children: true | ||
--- | ||
|
||
# Development | ||
|
||
This section contains development notes and tips for working with Thundernetes source code. | ||
|
||
## Kubebuilder notes | ||
|
||
Project was bootstrapped using [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) using the following commands: | ||
|
||
```bash | ||
kubebuilder init --domain playfab.com --repo github.com/playfab/thundernetes/pkg/operator | ||
kubebuilder create api --group mps --version v1alpha1 --kind GameServer | ||
kubebuilder create api --group mps --version v1alpha1 --plural gameserverbuilds --kind GameServerBuild | ||
kubebuilder create api --group mps --version v1alpha1 --plural gameserverdetails --kind GameServerDetail | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
layout: default | ||
title: Debugging | ||
parent: Development | ||
nav_order: 1 | ||
--- | ||
|
||
# Debugging | ||
|
||
To test your local code you have 2 options: you can run the code in a local kind cluster, or you can build local container images, upload them to a container registry, and then deploy them to a cluster. | ||
|
||
## Run end to end tests locally | ||
|
||
This command will run the e2e tests locally, and it won't delete the cluster after it's done, so you can either deploy more GameServerBuilds or check the ones used for the tests under the `e2e` namespace. | ||
|
||
```bash | ||
make clean deletekindcluster builddockerlocal createkindcluster e2elocal | ||
``` | ||
|
||
### Running end to end tests on macOS | ||
|
||
First of all, end to end tests require `envsubst` utility, assuming that you have Homebrew installed you can get it via `brew install gettext && brew link --force gettext`. | ||
We assume that you have installed Go, then you should install kind with `go install sigs.k8s.io/kind@latest`. Kind will be installed in `$(go env GOPATH)/bin` directory. Then, you should move kind to the `<projectRoot>/operator/testbin/bin/` folder with a command like `cp $(go env GOPATH)/bin/kind ./operator/testbin/bin/kind`. You can run end to end tests with `make clean builddockerlocal createkindcluster e2elocal`. | ||
|
||
## Test your changes on a cluster | ||
|
||
To test your changes to Thundernetes on a Kubernetes cluster, you can use the following steps: | ||
|
||
- The Makefile on the root of the project contains a variable `NS` that points to the container registry that you use during development. So you'd need to either set the variable in your environment (`export NS=<your-container-registry>`) or set it before calling `make` (like `NS=<your-container-registry> make build push`). | ||
- Login to your container registry (`docker login`) | ||
- Run `make clean build push` to build the container images and push them to your container registry | ||
- Run `create-install-files-dev` to create the install files for the cluster | ||
- Checkout the `installfilesdev` folder for the generated install files. This file is included in .gitignore so it will never be committed. | ||
- Test your changes as required. | ||
- single command: `NS=docker.io/<repo>/ make clean build push create-install-files-dev` |
Oops, something went wrong.