github.com/redhat-appstudio/release-service@v0.0.0-20240507045911-a8558ef3422a/README.md (about) 1 # HACBS Release service 2 3 Release service is a Kubernetes operator to control the life cycle of HACBS-managed releases in the context of AppStudio. 4 5 ## Running, building and testing the operator 6 7 This operator provides a [Makefile](Makefile) to run all the usual development tasks. This file can be used by cloning 8 the repository and running `make` over any of the provided targets. 9 10 ### Running the operator locally 11 12 When testing locally (eg. a CRC cluster), the command `make run install` can be used to deploy and run the operator. 13 If any change has been done in the code, `make manifests generate` should be executed before to generate the new resources 14 and build the operator. 15 16 ### Build and push a new image 17 18 To build the operator and push a new image to the registry, the following commands can be used: 19 20 ```shell 21 $ make docker-build 22 $ make docker-push 23 ``` 24 25 These commands will use the default image and tag. To modify them, new values for `TAG` and `IMG` environment variables 26 can be passed. For example, to override the tag: 27 28 ```shell 29 $ TAG=my-tag make docker-build 30 $ TAG=my-tag make docker-push 31 ``` 32 33 Or, in the case the image should be pushed to a different repository: 34 35 ```shell 36 $ IMG=quay.io/user/release:my-tag make docker-build 37 $ IMG=quay.io/user/release:my-tag make docker-push 38 ``` 39 40 ### Running tests 41 42 To test the code, simply run `make test`. This command will fetch all the required dependencies and test the code. The 43 test coverage will be reported at the end, once all the tests have been executed. 44 45 ## Disabling Webhooks for local development 46 47 Webhooks require self-signed certificates to validate the resources. To disable webhooks during local development and 48 testing, export the `ENABLE_WEBHOOKS` variable setting its value to `false` or prepend it while running the operator 49 using the following command: 50 51 ```shell 52 $ ENABLE_WEBHOOKS=false make run install 53 ``` 54 55 ## Metrics 56 57 Apart from the [metrics provided by controller-runtime](https://book.kubebuilder.io/reference/metrics-reference.html) 58 by default, this operator exports the following custom metrics: 59 60 | Metric name | Type | Description | 61 |--------------------------------------------------|-----------|---------------------------------------------------------------------| 62 | release_concurrent_total | Gauge | Total number of concurrent release attempts. | 63 | release_concurrent_post_actions_executions_total | Gauge | Total number of concurrent release post actions executions attempts | 64 | release_concurrent_processings_total | Gauge | Total number of concurrent release processing attempts. | 65 | release_duration_seconds | Histogram | How long in seconds a Release takes to complete. | 66 | release_post_actions_execution_duration_seconds | Histogram | How long in seconds Release post-actions take to complete. | 67 | release_processing_duration_seconds | Histogram | How long in seconds a Release processing takes to complete. | 68 | release_pre_processing_duration_seconds | Histogram | How long in seconds a Release takes to start processing | 69 | release_validation_duration_seconds | Histogram | How long in seconds a Release takes to validate | 70 | release_total | Counter | Total number of releases reconciled by the operator. |