{"id":20793805,"url":"https://github.com/telekom/pubsub-horizon-quasar","last_synced_at":"2025-05-05T23:52:34.503Z","repository":{"id":244931687,"uuid":"811718631","full_name":"telekom/pubsub-horizon-quasar","owner":"telekom","description":"A service for synchronizing the state of custom resources with caches or databases :milky_way:","archived":false,"fork":false,"pushed_at":"2025-05-01T20:27:26.000Z","size":216,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-01T21:37:52.978Z","etag":null,"topics":["crd","go","golang","kubernetes","mongodb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telekom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-07T06:56:17.000Z","updated_at":"2025-04-11T08:02:30.000Z","dependencies_parsed_at":"2024-06-18T12:04:34.617Z","dependency_job_id":"80342cab-8eba-426a-8620-f4ba982524af","html_url":"https://github.com/telekom/pubsub-horizon-quasar","commit_stats":null,"previous_names":["telekom/pubsub-horizon-quasar"],"tags_count":4,"template":false,"template_full_name":"telekom/reuse-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telekom%2Fpubsub-horizon-quasar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telekom%2Fpubsub-horizon-quasar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telekom%2Fpubsub-horizon-quasar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telekom%2Fpubsub-horizon-quasar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telekom","download_url":"https://codeload.github.com/telekom/pubsub-horizon-quasar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252596390,"owners_count":21773844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crd","go","golang","kubernetes","mongodb"],"created_at":"2024-11-17T16:11:40.358Z","updated_at":"2025-05-05T23:52:34.472Z","avatar_url":"https://github.com/telekom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nCopyright 2024 Deutsche Telekom IT GmbH\n\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"docs/img/quasar-logo.png\" alt=\"Quasar logo\" width=\"200\"\u003e\n    \u003ch1 align=\"center\"\u003eQuasar\u003c/h1\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nQuasar is a tiny service for synchronizing the state of custom resources with caches or databases.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e •\n  \u003ca href=\"#building-quasar\"\u003eBuilding Quasar\u003c/a\u003e •\n  \u003ca href=\"#configuration\"\u003eConfiguration\u003c/a\u003e •\n  \u003ca href=\"#running-quasar\"\u003eRunning Quasar\u003c/a\u003e\n\u003c/p\u003e\n\n[![REUSE status](https://api.reuse.software/badge/github.com/telekom/pubsub-horizon-quasar)](https://api.reuse.software/info/github.com/telekom/pubsub-horizon-quasar)\n[![Go Test](https://github.com/telekom/pubsub-horizon-quasar/actions/workflows/go-test.yml/badge.svg)](https://github.com/telekom/pubsub-horizon-quasar/actions/workflows/go-test.yml)\n\n## Overview\nQuasar is the config-controller powering the Horizon ecosystem. \n\n\u003e **Note:** Quasar is an essential part of the Horizon ecosystem. Please refer to [documentation of the entire system](https://github.com/telekom/pubsub-horizon) to get the full picture.\n\n## Prerequisites\n- A running [Kubernetes](https://github.com/kubernetes/kubernetes) cluster\n- A running instance of [MongoDB](https://www.mongodb.com/) or [Redis (_not fully supported yet_)](https://redis.io)\n\n## Building Quasar\n### Go build\n\nAssuming you have already installed [Go](https://go.dev/), simply run the following to build the executable:\n```bash\ngo build\n```\n\n\u003e Alternatively, you can also follow the Docker build in the following section if you want to build a Docker image without the need to have Golang installed locally.\n\n### Docker build\nThis repository provides a multi-stage Dockerfile that will also take care of compiling the software, as well as dockerizing Quasar. Simply run:\n\n```bash\ndocker build -t horizon-quasar:latest  . \n```\n\n## Configuration\nQuasar can be configured using environment variables and/or a configuration file. The following table lists all available configuration options:\n\n**Environment variables aren't officially supported for the `resources` option. It is recommended to configure the `resources` using a configuration/configmap.**\n\n\u003e **Please note:** Redis isn't fully supported (yet) as Hazelcast is the primary cache method of Horizon in its current state.\n\n| Path                        | Variable                       | Type          | Default                   | Description                                                                                                        |\n|-----------------------------|--------------------------------|---------------|---------------------------|--------------------------------------------------------------------------------------------------------------------|\n| logLevel                    | QUASAR_LOGLEVEL                | string        | info                      | The log-level.                                                                                                     |\n| fallback.type               | QUASAR_FALLBACK_TYPE           | string        | mongo                     | The fallback type that should be used. (mongo or none)                                                             |\n| fallback.mongo.database     | QUASAR_FALLBACK_MONGO_DATABASE | string        | horizon                   | The database that should be used to restore the cache in case of a CR unavailability                               |\n| fallback.mongo.uri          | QUASAR_FALLBACK_MONGO_URI      | string        | mongodb://localhost:27017 | MongoDB uri of the fallback database.                                                                              |\n| reSyncPeriod                | QUASAR_RESYNCPERIOD            | string        | 30s                       | Resync-period of the Kubernetes informer.                                                                          |\n| store.type                  | QUASAR_STORE_TYPE              | string        | hazelcast                 | Type of store Quasar should write to.                                                                              |\n| store.hazelcast.addresses   | QUASAR_HAZELCAST_ADDRESSES     | string (list) | []                        | The addresses to connect to.                                                                                       |\n| store.hazelcast.clusterName | QUASAR_HAZELCAST_CLUSTERNAME   | string        | horizon                   | Hazelcast cluster to write to.                                                                                     |\n| store.hazelcast.username    | QUASAR_HAZELCAST_USERNAME      | string        | -                         | Username to authenticate with.                                                                                     |\n| store.hazelcast.password    | QUASAR_HAZELCAST_PASSWORD      | string        | -                         | Password to authenticate with.                                                                                     |\n| store.hazelcast.writeBehind | QUASAR_HAZELCAST_WRITEBEHIND   | bool          | true                      | Whether or not to perform write-behind writes to the fallback database.                                            |\n| store.mongo.uri             | QUASAR_MONGO_URI               | string        | mongodb://localhost:27017 | MongoDB uri of the database.                                                                                       |\n| store.mongo.database        | QUASAR_MONGO_DATABASE          | string        | horizon                   | The database that should be written to.                                                                            |\n| store.redis.host            | QUASAR_REDIS_HOST              | string        | localhost                 | The redis host.                                                                                                    |\n| store.redis.port            | QUASAR_REDIS_PORT              | int           | 6379                      | The redis port.                                                                                                    |\n| store.redis.username        | QUASAR_REDIS_USERNAME          | string        | -                         | Username to authenticate with.                                                                                     |\n| store.redis.password        | QUASAR_REDIS_PASSWORD          | string        | -                         | Password to authenticate with.                                                                                     |\n| metrics.enabled             | QUASAR_METRICS_ENABLED         | bool          | false                     | Whether or not metrics should be served.                                                                           |\n| metrics.port                | QUASAR_METRICS_PORT            | int           | 8080                      | The port for exposing the metrics service.                                                                         |\n| metrics.timeout             | QUASAR_METRICS_TIMEOUT         | string        | 5s                        | Timeout of HTTP connections to the metrics service.                                                                |\n| resources                   | -                              | object (list) | []                        | The custom resources that should be synchronized. See [configuring resources](#configuring-resources) for details. |\n\n### Configuring resources\nThe `resources` configuration option is a list of custom resources that should be synchronized. Each resource has the following fields:\n```yaml\nkubernetes:\n  group: mygroup\n  resource: myresource\n  version: v1\n  namespace: mynamespace\nprometheus:\n  enabled: true\n  labels:\n    fixed_value: foobar\n    my_dynamic_value: $spec.myfield\nmongoIndexes:\n  - spec.myfield: 1\n  - spec.myfield: 1\n    spec.myotherfield: 1\nhazelcastIndexes:\n  - name: myfield_myotherfield_idx\n    fields:\n      - data.spec.environment\n    type: sorted\n```\n\n#### Understanding resources\n- `kubernetes`: The Kubernetes resource that should be synchronized.\n  - `group`: The group of the resource.\n  - `resource`: The name of the resource.\n  - `version`: The version of the resource.\n  - `namespace`: The namespace of the resource.\n- `prometheus`: Prometheus metrics configuration.\n     - `enabled`: Whether to expose metrics for this resource.\n    - `labels`: Labels that should be exposed as metrics. Labels can be fixed values or values from the resource.\n        - Fixed values are defined as strings.\n        - Values from the resource are defined as `$\u003cfield\u003e`.\n- `mongoIndexes`: Indexes that should be created in the MongoDB database.\n- `hazelcastIndexes`: Indexes that should be created in the Hazelcast cache.\n  - `name`: The name of the index.\n  - `fields`: The fields that should be indexed.\n  - `type`: The type of the index. Currently, only `sorted` and `hash` are supported.\n\n#### Generating a local configuration\nYou can generate a local configuration file by running the following command in the directory of the executable:\n```bash\n./quasar init\n```\n\n## Running Quasar\nOnce you have prepared your configuration, you can run Quasar by executing the following command in the directory of the executable:\n```bash\n./quasar run\n```\n\n## Contributing\nWe're committed to open source, so we welcome and encourage everyone to join its developer community and contribute, whether it's through code or feedback.  \nBy participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times.\n\n## Code of Conduct\nThis project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/) in version 2.1 as our code of conduct. Please see the details in our [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). All contributors must abide by the code of conduct.\n\nBy participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times.\n\n## Licensing\nThis project follows the [REUSE standard for software licensing](https://reuse.software/).    \nEach file contains copyright and license information, and license texts can be found in the [LICENSES](./LICENSES) folder. For more information visit https://reuse.software/. \nYou can find a guide for developers at https://telekom.github.io/reuse-template/.   ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelekom%2Fpubsub-horizon-quasar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelekom%2Fpubsub-horizon-quasar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelekom%2Fpubsub-horizon-quasar/lists"}