diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index e39a5b9..3933756 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -16,9 +16,25 @@ env: permissions: {} jobs: + make: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run make all and generate definitions + run: | + # This step is not needed per se, but runs all the tests + # and generate the manifests + make && cp -v config/crd/bases/* charts/mimirrules-controller/crds/ + build-image: permissions: packages: write # needed for ghcr access + needs: + - make runs-on: ubuntu-latest steps: - name: Checkout @@ -65,6 +81,7 @@ jobs: contents: write # to push chart release and create a release (helm/chart-releaser-action) packages: write needs: + - make - build-image runs-on: ubuntu-latest steps: @@ -78,12 +95,6 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Run make and generate definitions - run: | - # This step is not needed per se, but runs all the tests - # and generate the manifests - make && cp -v config/crd/bases/* charts/mimirrules-controller/crds/ - - name: Set up Helm uses: azure/setup-helm@v4 diff --git a/README.md b/README.md index 966b572..ee2a1af 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # o11y-rules-telemetry-operator K8S controller to manage Mimir Alerting and Recording rules with dynamic tenants, based on namespace name or annotations. -Visit https://springernature.github.io/o11y-rules-telemetry-operator to see how to install with Helm. -**This repository uses GitHub pages with [chart-releaser](https://github.com/helm/chart-releaser) in a workflow with [chart-releaser-action](https://github.com/helm/chart-releaser-action) to automatically create an manage a Helm repository. See below for more info** +## Production installation + +1. Follow the instructions at https://springernature.github.io/o11y-rules-telemetry-operator +2. See all available settings in the Chart: https://github.com/springernature/o11y-rules-telemetry-operator/blob/main/charts/Readme.md ## Description @@ -14,7 +16,7 @@ apiVersion: mimirrules.telemetry.springernature.com/v1beta1 kind: MimirRules metadata: annotations: - "change.telemetry.springernature.com/o11y-tenant": "jose" + "telemetry.springernature.com/o11y-tenant": "jose" name: mimirrules-sample spec: groups: @@ -25,11 +27,12 @@ spec: labels: severity: warning ``` -The operator applies the rules to Mimir (Ruler) Api using the tenant defined in the annotation, or -It updates the status according to the results and emits events. +The operator applies the rules to Mimir (Ruler) Api using the tenant defined in the annotation or namespace and it updates the status according to the results and emits events. -## Getting Started developing +# Getting Started developing + +**This repository uses GitHub pages with [chart-releaser](https://github.com/helm/chart-releaser) in a workflow with [chart-releaser-action](https://github.com/helm/chart-releaser-action) to automatically create an manage a Helm repository. See below for more info** Code: - `cmd/main.go`: Arguments and environment variables @@ -37,8 +40,12 @@ Code: - `internal/controller/mimirrules_controller.go`: Controller logic - `internal/controller/mimirrules.go`: Mimir Rule API HTTP client +More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) + ## Cheat sheet +Run `make help` for more information on all potential `make` targets + ### Prerequisites - go version v1.21.0+ @@ -128,6 +135,12 @@ make uninstall make undeploy ``` +**Generate K8S manifests:** + +```sh +make build-installer +``` + ## Project Distribution Following are the steps to build the installer and distribute this project to users. @@ -151,14 +164,9 @@ Users can just run kubectl apply -f to install the project kubectl apply -f https://raw.githubusercontent.com//o11y-rules-telemetry-operator//dist/install.yaml ``` -## Contributing -Run `make help` for more information on all potential `make` targets - -More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) - -## License +# License -Copyright 2024. +Copyright Springer Nature 2024. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/charts/Readme.md b/charts/Readme.md index a8c4f87..d16b033 100644 --- a/charts/Readme.md +++ b/charts/Readme.md @@ -8,10 +8,10 @@ Github repository: https://github.com/springernature/o11y-rules-telemetry-operat To install the app chart in the Kubernetes cluster. ```console -helm upgrade --install mimirrules o11y-rules-telemetry-operator/mimirrules +helm upgrade --install mimirrules-controller o11y-rules-telemetry-operator/mimirrules-controller --set config.mimirAPI=http://your.mimir.api ``` -This will install CRD `MimirRules`. Take this into account for CRD updates or when deleting the controller, those operations will require manual steps with `kubectl delete/apply`. +This command install CRD `MimirRules`. Take this into account for CRD updates or when deleting the controller, those operations will require manual steps with `kubectl delete/apply`. ### Values