Skip to content
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

Split development docs into subsections and removed some old tutorials #320

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 0 additions & 318 deletions docs/development.md

This file was deleted.

21 changes: 21 additions & 0 deletions docs/development/README.md
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
```
35 changes: 35 additions & 0 deletions docs/development/debugging.md
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`
Loading