Skip to content

Commit 07cbab2

Browse files
authored
Update contributing guide (#537)
* Update contributing guide Signed-off-by: Pavol Loffay <[email protected]>
1 parent cf2e7e1 commit 07cbab2

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

CONTRIBUTING.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ gh pr create
2323
### Pre-requisites
2424
* Install [Go](https://golang.org/doc/install).
2525
* Install [Kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/).
26+
* Install [Operator SDK](https://sdk.operatorframework.io/docs/installation/).
2627
* Have a Kubernetes cluster ready for development. We recommend `minikube` or `kind`.
2728

29+
### Adding new components - webhook, API
30+
31+
The repository structure MUST be compliant with `operator-sdk` scaffolding, which uses `kubebuilder` behind the scenes. This is to ensure a valid bundle generation and it makes it easy to maintain the project and add new components.
32+
33+
Refer to the [Operator SDK documentation](https://sdk.operatorframework.io/docs/building-operators/golang/) how to generate new APIs, Webhook and other parts of the project.
2834

2935
### Local run
3036

@@ -40,41 +46,39 @@ When running `make run`, the webhooks aren't effective as it starts the manager
4046
1. configure a proxy between the Kubernetes API server and your host, so that it can contact the webhook in your local machine
4147
1. create the TLS certificates and place them, by default, on `/tmp/k8s-webhook-server/serving-certs/tls.crt`. The Kubernetes API server has also to be configured to trust the CA used to generate those certs.
4248

43-
In general, it's just easier to deploy the manager in a Kubernetes cluster instead. For that, you'll need the `cert-manager` installed. You can install it by running:
49+
In general, it's just easier to deploy the operator in a Kubernetes cluster instead. For that, you'll need the `cert-manager` installed. You can install it by running:
4450

4551
```bash
4652
make cert-manager
4753
```
4854

49-
In pursuit of continuous improvement, a variable named `CERTMANAGER_VERSION` which can be run:
55+
The environment variable `CERTMANAGER_VERSION` can be used to override the cert-manager version:
5056
```bash
5157
CERTMANAGER_VERSION=1.60 make cert-manager
5258
```
5359

54-
By default, it will generate an image following the format `quay.io/${USER}/opentelemetry-operator:${VERSION}`. You can set the following env vars in front of the `make` command to override parts or the entirety of the image:
60+
When deploying the operator into the cluster using `make deploy`, an image in the format `ghcr.io/${USER}/opentelemetry-operator` is generated. If this format isn't suitable, it can be overridden by:
5561

56-
* `IMG_PREFIX`, to override the registry, namespace and image name (`quay.io`)
62+
* `IMG_PREFIX`, to override the registry, namespace and image name
5763
* `USER`, to override the namespace
5864
* `IMG_REPO`, to override the repository (`opentelemetry-operator`)
5965
* `VERSION`, to override only the version part
6066
* `IMG`, to override the entire image specification
6167

62-
Ensure the secret [regcred](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) has been created to enable opentelemetry-operator-controller-manager deployment to pull images from your private `quay.io` registry.
63-
6468
```bash
65-
kubectl create secret docker-registry regcred --docker-server=quay.io --docker-username=${USER} --docker-password=${PASSWORD} -n opentelemetry-operator-system
69+
IMG=docker.io/${USER}/opentelemetry-operator:latest make generate bundle container container-push deploy
6670
```
6771

68-
Alternatively, you could create your repository with [Public Visibility](https://docs.projectquay.io/use_quay.html#creating-an-image-repository-via-the-ui).
72+
Your operator will be available in the `opentelemetry-operator-system` namespace.
6973

70-
Once it's ready, the following can be used to build and deploy a manager, along with the required webhook configuration:
74+
#### Using a private container registry
75+
76+
Ensure the secret [regcred](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) has been created to enable opentelemetry-operator-controller-manager deployment to pull images from your private registry.
7177

7278
```bash
73-
make bundle container container-push deploy
79+
kubectl create secret docker-registry regcred --docker-server=<registry> --docker-username=${USER} --docker-password=${PASSWORD} -n opentelemetry-operator-system
7480
```
7581

76-
Your operator will be available in the `opentelemetry-operator-system` namespace.
77-
7882
## Testing
7983

8084
With an existing cluster (such as `minikube`), run:

0 commit comments

Comments
 (0)