How to Integrate a K8 Secret's data into Aspire When Secret Not Managed by Aspire? #8942
markphillips100
started this conversation in
General
Replies: 1 comment 18 replies
-
When you run aspire locally what do you want to happen? |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to integrate connection string and endpoint data from infrastructure dependencies NOT created by Aspire without resorting to explicitly adding connection string and/or parameters to the App Model.
My solution's applications have their innerloop infrastructure dependencies provisioned by Crossplane using my own custom compositions applied to a local KinD cluster. Claim manifests are applied to the cluster to facilitate the desired resource compositions and their provisioning of resources in the cloud.
When all of a specific claim's composition resources are provisioned, some data specific to the composition may be written to a k8 secret, the name of which is supplied by the claim's yaml. For example, a claim to create a sqldb in Azure would supply the connection string in the claim's secret, but only when the resource is ready (has been provisioned).
Now, I'd like my app projects in the solution to make use of the data supplied by those claim secrets as part of their configuration. Some of the data may not be following some semantic convention in terms of naming. There may be a random postfix for example. So supplying explicit connection strings and endpoints as parameters to the model won't suffice.
I'm thinking about writing a custom hosting integration for a CrossplaneClaim resource. Is this a viable approach for what I am looking for, considering I only want to monitor the state of a claim resource (in the cluster) rather than have Aspire create it? If so, is there a specific base resource I should inherit from or is this a start from scratch thing?
The resource would need to integrate with a k8 api via a Kubernetes Client for sure so it can enquire for details about a specific claim in a specific namespace (that the dev would need access to), its claim secret and how to map the relevant parts of the secret's data to an Aspire ConnectionString or EndpointReference. It also needs to handle app's waiting for the secret to be ready, or more specifically, when the Claim has a Ready status and its secret was created.
A bonus to having a resource is its inclusion in the dashboard. Would be nice to show those resources, and also have the apps wait on the readiness of them.
Beta Was this translation helpful? Give feedback.
All reactions