Skip to content
Merged
Changes from 2 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
52 changes: 44 additions & 8 deletions docs/contributing/local-development.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Prerequisites

- [Docker](https://docs.docker.com/engine/install/)
- [Docker](https://docs.docker.com/engine/install/) and [docker-buildx](https://github.com/docker/buildx)
- [Helm](https://helm.sh/)
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
- [tilt](https://docs.tilt.dev/install.html)
- [Golang](https://go.dev/doc/install)
Expand All @@ -10,14 +11,33 @@

Tilt offers a simple way of creating a local development environment.

## Create a kind cluster
## Create local k8s cluster

Create a kind cluster with a local registry:
```bash
make deploy-dev
```

Open the `tilt` browser UI by pressing the "space" key when prompted. Note that `tilt` sets up a directory watcher and will automatically redeploy any code changes!

You can check the "temporal-operator-controller-manager" Pod status with `kubectl get pods -n temporal-system -w`.

## Apply Manifests

Once the local cluster is created, start applying your desired manifests and let the temporal operator handle reconciliation:

```bash
make dev-cluster
# example
make artifacts
kubectl apply -f out/release/artifacts/temporal-operator.crds.yaml
kubectl apply -f out/release/artifacts/temporal-operator.yaml
kubectl apply -f examples/cluster-postgres/00-namespace.yaml
kubectl apply -f examples/cluster-postgres/01-postgresql.yaml
kubectl apply -f examples/cluster-postgres/02-temporal-cluster.yaml
kubectl apply -f examples/cluster-postgres/03-temporal-namespace.yaml
```

Note: if you wish to interact with the Temporal Web UI or frontend gRPC service, you should port forward the services to localhost:

## Generate

Generate crd and docs when api is modified
Expand All @@ -26,12 +46,28 @@ Generate crd and docs when api is modified
make generate
```

## Run Tilt
## Test

Run tests with coverage report:

```bash
make test
```

Run end-to-end tests:

Then run:
```bash
make test-e2e
```

Run end-to-end tests on development computer using `kind`:

```bash
tilt up
make test-e2e-dev
```

Now, Tilt will automatically reload the deployment to your local cluster every time you make a code change.
## Gracefully Shutdown k8s Cluster

```bash
make clean-dev-cluster
```