Repository navigation
Flare: add identity database, cold storage, Resources page and image overrides - #2610
Open
aminparsa18 wants to merge 3 commits into
Open
aminparsa18 wants to merge 3 commits into
aminparsa18 wants to merge 3 commits into
Conversation
Stores Flare's identity database in PostgreSQL instead of a SQLite file shared by the ingest service and the query API through one volume. A volume mounted by two workloads usually can't be attached on different nodes, so this is what a multi-node Kubernetes deployment needs.
Adds an S3-compatible bucket to Flare's ClickHouse server as a cold storage tier, so retention can move older telemetry off the local disk. The disk and the flare_tiered storage policy are added as a ClickHouse config file; the endpoint and keys are passed as environment variables.
…ation WithResourceGraph turns on the Flare dashboard's Resources page. It labels the Flare containers, ClickHouse and Redis, and gives the query API read-only access to the container runtime: a Docker socket proxy locally and in Docker Compose output, or a service account with a read-only role when publishing to Kubernetes. WithFlareImageRegistry and WithFlareImages change where the four Flare images come from, keeping the shared tag.
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 2610Or
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 2610" |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2609
Adds the deployment options from the original
Flare.Hosting.Aspirepackage that the integration didn't have yet. Each one is opt-in, and the defaults ofAddFlareare unchanged. The three commits can be reviewed one at a time.WithIdentityDatabase(database)Sets
Identity__Provider=PostgresandIdentity__ConnectionStringon the ingest service and the query API, and makes both wait for the database. The alert worker doesn't read identity and is left as it is. Use it for a Kubernetes cluster with more than one node, where the volumeWithDataVolume()shares usually can't be mounted by both workloads. The parameter isIResourceWithConnectionString, so there's no dependency on the PostgreSQL integration.WithColdStorage(endpoint, accessKey, secretKey)Adds an S3-compatible bucket to the ClickHouse server passed to
AddFlareas a cold tier. Aconfig.dfile added withWithContainerFilesdefines an S3 disk and theflare_tieredpolicy, and the endpoint and keys go in as environment variables, which the file reads withfrom_env. The bucket is passed in rather than created, so any S3-compatible store works. The README shows local use with the RustFS integration.WithResourceGraph()Turns on the dashboard's Resources page. It adds
flare.resource,flare.roleandflare.relationshipslabels to the Flare containers, ClickHouse and Redis, and gives the query API read-only access to the container runtime:aspire runand in Docker Compose output: atecnativa/docker-socket-proxy:3.4container with the Docker socket mounted read-only and onlyCONTAINERS=1allowed. The query API talks to the proxy, never to the socket.:or,.The Compose and Kubernetes settings are added in
BeforeStartEvent, once the whole app model is built. Two reasons:PublishAsDockerComposeServicemakes publishing fail when there's no Compose environment, and an environment added afterWithResourceGraph()still has to count. This adds dependencies onAspire.Hosting.DockerandAspire.Hosting.Kubernetes.WithFlareImageRegistry(registry)andWithFlareImages(ingest, api, alertWorker, dashboard)These set the registry of all four images (for example a private mirror), or replace any of the images. Replaced images keep the shared tag and registry, whatever order the calls come in.
PR Checklist
Other information
Tested by hand against the published Flare images. In each case I temporarily changed the example AppHost and didn't commit the change, so the example stays minimal:
colddisk and theflare_tieredpolicy. A table using the policy moved its part to thecoldvolume and read it back correctly.aspire run: the API's/api/resources/snapshotreturned the graph from Docker with all six containers and their dependency edges.helm lintandhelm templatepassed. I haven't deployed it to a real cluster.Known limits, documented in the README:
WithContainerFilesyet, so cold storage isn't configured in Kubernetes output. Flare then reports cold storage as unavailable.AddBucketcreates it only in run mode.WithIdentityDatabaseandWithColdStorageare marked[AspireExport]withIResourceBuilder<IResourceWithConnectionString>andReferenceExpressionparameters. I haven't tried them from a TypeScript or Go AppHost, and can switch either to[AspireExportIgnore]if you prefer.