Skip to content

Commit

Permalink
docs: add contributing docs to site (#112)
Browse files Browse the repository at this point in the history
Move contribution guidelines to site

fixes #105 #103
  • Loading branch information
sircthulhu committed Apr 3, 2024
1 parent 09f0e5a commit 1058ba5
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 53 deletions.
52 changes: 0 additions & 52 deletions HOW-TO-START-DEVELOPMENT.md

This file was deleted.

72 changes: 71 additions & 1 deletion site/content/en/docs/v0.1/contribution-guidelines/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,74 @@ weight: 10
description: How to contribute to the project
---

TODO
etcd operator guide for developers.

## How to start contributing
First of all, etcd operator uses kubebuilder. [See official docs](https://book.kubebuilder.io/introduction) to learn
more.

### Easy way
Using this way, you don't be able to debug the controller locally. After every change you will have to redeploy changes.
#### Pre-requisites
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)

**Steps**
1. Create and prepare kind cluster:
```shell
make kind-prepare
```

2. Install CRDs into kind cluster
```shell
make install
```

3. Build image and load it into kind cluster, deploy etcd-operator, RBAC, webhook certs
```shell
make deploy
```

4. To deploy your code changes, redeploy etcd-operator:
```shell
make redeploy
```

5. To clean up after all, delete kind cluster:
```shell
make kind-delete
```
### Advanced way
Using VSCode you can connect your IDE to a pod in kubernetes cluster and use `go run cmd/main.go` from the pod.
It will allow you to debug easily and faster integrate code changes to you develop environment.

**General steps**
1. Install VSCode Kubernetes extension.
2. Install VSCode Dev Containers extension.
3. Create pvc to store operator code, go modules and your files.
4. Build Dockerfile to create image for your develop environment (git, golang , etc...). Take base image that you love
most.
5. Patch operator deployment to
* Attach PVC from step 3.
* Change operator image to your image.
* Change command and args to endless sleep loop.
* Change rolling update strategy to recreate if you use RWO storage class.
* Change security context RunAsNonRoot to false.
* Increase requests and limits.
* Remove readiness and liveness probes.
6. Attach VSCode to a running container through Kubernetes extension.
7. Install necessary extensions to the container. They will be preserved after container restart if you attached pvc to
home directory.
8. Run `go run cmd/main.go`.


## Release procedure
Every PR should have a label to show what kind of changes does it bring. For example, PRs with docs changes should have
`documentation` label. This labels will be used by the `release-drafter` workflow to prepare the release draft.

### Cutting off a release
When all tasks for the release are merged to `main` branch, maintainer should

- create new minor or major version in `site` if it's not a patch release and merge this PR to `main` branch
- check that tag has not been already created. If it has been, delete it
- publish the release using draft, created by `release-drafter`
- you are amazing :)

0 comments on commit 1058ba5

Please sign in to comment.