Skip to content

Commit

Permalink
add DEVELOPMENT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Apr 16, 2021
1 parent 6e24283 commit 24fd9fd
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Build and run `kcp`

```
go run ./cmd/kcp start
```

This will build and run your kcp server, and generate a kubeconfig in `.kcp/data/admin.kubeconfig` you can use to connect to it:

```
KUBECONFIG=.kcp/data/admin.kubeconfig
kubectl api-resources
```

The kubeconfig configures two contexts, `user` (the default) and `admin`.
Switch the default context to `admin` with the following command:

```
kubectl config use-context admin
```

# Build and run Cluster Controller

First, be sure to define the Cluster CRD type:

```
kubectl apply -f config/cluster.example.dev_clusters.yaml
```

The Cluster Controller requires a `--syncer_image` to install on new clusters.
To build this image and pass it to the Cluster Controller, you can use [`ko`](https://github.com/google/ko):

```
go run ./cmd/cluster-controller \
--syncer_image=$(ko publish ./cmd/syncer) \
--kubeconfig=.kcp/data/admin.kubeconfig
```

`ko publish` requires the `KO_DOCKER_REPO` env var to be set to the container image registry to push the image to (e.g., `KO_DOCKER_REPO=quay.io/my-user`).
If you're using [KinD](https://kind.sigs.k8s.io), you can set `KO_DOCKER_REPO=kind.local` to publish to your local KinD cluster.

0 comments on commit 24fd9fd

Please sign in to comment.