Skip to content

Latest commit

 

History

History
112 lines (88 loc) · 3.06 KB

CONTRIBUTING.md

File metadata and controls

112 lines (88 loc) · 3.06 KB

Contributing to Coralogix Operator

Thank you for your interest in contributing to the Coralogix Operator. We welcome your contributions. Here you'll find information to help you get started with operator development.

You are contributing under the terms and conditions of the Contributor License Agreement. For signing.

Building the Operator

Requirements

  • You’ll need a Kubernetes cluster to run against. You can use KIND
  • Go 1.20.x (for building the operator locally)
  • kuttl (for running e2e tests).
  • kubebuilder for developing the operator.

Steps

Clone the repository locally.

$ git clone [email protected]:coralogix/coralogix-operator

Navigate to the operator directory and install it. This command will build the operator and install the CRDs located at crd directory into the K8s cluster specified in ~/.kube/config.

$ make install

Add the region and api-key as environment variables (or later as flags).

$ export CORALOGIX_API_KEY="xxx-xxx-xxx"
$ export CORALOGIX_REGION = "EUROPE2"

Run the operator locally

$ go run main.go

Or with regin and api-key flags

$ go run main.go -region EUROPE2 -api-key xxx-xxx-xxx

For not running the prometheusRule controller set the prometheus-rule-controller flag to false

$ go run main.go -prometheus-rule-controller=false

Or build and push your image to a registry

make docker-build docker-push IMG=<some-registry>/coralogix-operator:tag

Then deploy it to the cluster

make deploy IMG=<some-registry>/coralogix-operator:tag

Running examples

---------------------
It's possible to use one of the samples in the [sample directory](./config/samples) or creating your own sample file.
Then apply it -

```sh
$ kubectl apply -f config/samples/alerts/standard_alert.yaml

Getting the resource status

$ kubectl get alerts.coralogix.com standard-alert-example -oyaml

Destroying the resource.

$ kubectl delete alerts.coralogix.com standard-alert-example

Developing

We use kubebuilder for developing the operator. When creating or updating CRDs remember to run

make manifests

Tests

We use kuttl for end-to-end tests. The test files are located at ./tests/e2e/ In order to run the full suite of kuttl tests, run -

$ make e2e

Note: kuttl tests create real resources and in a case of failure some resources may not be removed.

Releases

To determine the release convention we use semantic-release -

"releaseRules": [
          {"message": "major*", "release": "major"},
          {"message": "minor*", "release": "minor"},
          {"message": "patch*", "release": "patch"}
        ]