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

Fix contributing docs #1762

Merged
merged 2 commits into from
Feb 21, 2022
Merged
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
51 changes: 20 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,80 +12,69 @@ This project is a regular [Kubernetes Operator](https://coreos.com/operators/)

### Installing the Operator SDK command line tool

Follow the installation guidelines from [Operator SDK GitHub page](https://github.com/operator-framework/operator-sdk) or run `make install-sdk`.
Follow the installation guidelines from [Operator SDK GitHub page](https://github.com/operator-framework/operator-sdk)

### Developing

As usual for operators following the Operator SDK in recent versions, the dependencies are managed using [`go modules`](https://golang.org/doc/go1.11#modules). Refer to that project's documentation for instructions on how to add or update dependencies.

The first step is to get a local Kubernetes instance up and running. The recommended approach is using `minikube`. Refer to the Kubernetes' [documentation](https://kubernetes.io/docs/tasks/tools/install-minikube/) for instructions on how to install it.
The first step is to get a local Kubernetes instance up and running. The recommended approach for development is using `minikube` with *ingress* enabled. Refer to the Kubernetes' [documentation](https://kubernetes.io/docs/tasks/tools/install-minikube/) for instructions on how to install it.

Once `minikube` is installed, it can be started with:

```
minikube start
minikube start --addons=ingress
```

NOTE: Make sure to read the documentation to learn the performance switches that can be applied to your platform.

Log into docker (or another image registry):
```
docker login --username <dockerusername>
```

Once minikube has finished starting, get the Operator running:

```
make cert-manager
IMG=docker.io/$USER/jaeger-operator:latest make generate bundle docker push deploy
```

NOTE: If your registry username is not the same as $USER, modify the previous command before executing it. Also change *docker.io* if you are using a different image registry.

At this point, a Jaeger instance can be installed:

```
kubectl apply -f examples/simplest.yaml
kubectl get jaegers
kubectl get pods
kubectl get pods
```

To remove the instance:

To verify the Jaeger instance is running, execute *minikube ip* and open that address in a browser, or follow the steps below
```
kubectl delete -f examples/simplest.yaml
export MINIKUBE_IP=`minikube ip`
curl http://{$MINIKUBE_IP}/api/services
```
NOTE: you may have to execute the *curl* command twice to get a non-empty result

Tests should be simple unit tests and/or end-to-end tests. For small changes, unit tests should be sufficient, but every new feature should be accompanied with end-to-end tests as well. Tests can be executed with:

```
make test
```

NOTE: you can adjust the Docker image namespace by overriding the variable `NAMESPACE`, like: `make test NAMESPACE=quay.io/my-username`. The full Docker image name can be customized by overriding `BUILD_IMAGE` instead, like: `make test BUILD_IMAGE=quay.io/my-username/jaeger-operator:0.0.1`

#### Model changes

The Operator SDK generates the `pkg/apis/jaegertracing/v1/zz_generated.*.go` files via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/jaegertracing/v1/jaeger_types.go`)

#### Ingress configuration

Kubernetes comes with no ingress provider by default. For development purposes, when running `minikube`, the following command can be executed to install an ingress provider:
#### Cleaning up
To remove the instance:

```
make ingress
kubectl delete -f examples/simplest.yaml
```

This will install the `NGINX` ingress provider. It's recommended to wait for the ingress pods to be in the `READY` and `RUNNING` state before starting the operator. You can check it by running:

```
kubectl get pods -n ingress-nginx
```

To verify that it's working, deploy the `simplest.yaml` and check the ingress routes:

```
$ kubectl apply -f examples/simplest.yaml
jaeger.jaegertracing.io/simplest created
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
simplest-query * 192.168.122.69 80 12s
```
#### Model changes

Accessing the provided "address" in your web browser should display the Jaeger UI.
The Operator SDK generates the `pkg/apis/jaegertracing/v1/zz_generated.*.go` files via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/jaegertracing/v1/jaeger_types.go`)

#### Storage configuration

Expand Down