prom3theu5 / aspirational-manifests

Handle deployments of .NET Aspire AppHost Projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QA: Tool to deploy to a docker instance (no k8s)

adamtrip opened this issue · comments

Maybe this is not the right place to talk about it but here it goes.

How hard could it be to have a tool like Aspir8 but for a docker instance instead of a kubernetes cluster?
Is it even possible to do it inside Aspir8?

I believe that are many scenarios out there were services are just hosted in a docker environment with no kubernetes. I believe that you having the skill to do something as Aspir8 could do something like this. I would like to help despite not being proficient with this kind of tooling.

I've been toying with the idea actually of adding another cli option that allows you to output manifests as docker compose files as well
This would also give you the benefit of being able to deploy to docker in swarm mode as well as standard docker
Watch this space for now :)

You're a legend!

Just release in v0.1.27-preview
Will be on nuget in a few

Very cool!

Wait, you done this already? 😮 Trying it now!!

Very cool!

Cheers David

Wait, you done this already? 😮 Trying it now!!

Aye - its kinda lightweight for now, as in it disables secret generation, and adds all values as env vars
But i'll be building upon it with future support for network and secret generation
The builders are there for them

Looks good. I guess the next step would be secret handling and app settings variables

Aye I think so - definitely secrets.

AppSettings is possible now, just ensure you have configuration.AddEnvironmentalVariables() chained to your configuration root, but you'll have to add variables yourself to the docker compose.

If its not exposed in the Aspire manifest then aspir8 won't be able to handle it.
The thing about AppSettings is - yeah thats the default filename, but you can add any json file with the method that registers it under the hood (AddJson()), and any number of them.

Then there is the complexity of where they are registered in code. Are they directly in Program.cs - Are then in an extension method somewhere that extends IConfiguration or IConfigurationRoot, or the ConfigurationBuilder itself to register them?

Would be messy to try to handle tbh

I believe that on the last manifest I generated, those app settings variables were created on the manifest. I'll confirm once I get home :D

But I agree with you, aspir8 should only handle what's on the manifest.json, and if those variables are on the manifest then yeah.

Im gonna check later today what I can find and if the variables are being passed on to the manifest and then into docker compose file.

Another question, by default would apps be able to communicate via app name url like https://authservice ? Would that require any kind of network configuration on docker or should work out of the box?

If you use docker compose to deploy, then the apps will communicate fine using their service names as defined in the manifest.json file.

Thats because the hostname of each container is set by the compose file as the resource key from the manifest file, and docker will route according to those hostnames within a compose and swarm network instance.

It creates that network along with routing at deployment time when you run docker compose up etc

Awesome! I'll try it further and give you feedback about it

@mitchdenny This experience is broken with volumes because we don't preserve that notion in the manifest. Related to dotnet/aspire#1521