-
Benachrichtigungen
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow creation of service connectors at application level #40
Kommentare
Hi @julienbourgoin-maif, thanks for raising this issue. There're some differences of the design between service bindings and service connector, one of which is that the connections are part of the deployment properties rather than the app properties. And this leads to some changes in the usage. For better understanding of your scenario, could you please describe more details for:
|
Hello @LGDoor,
Every time we construct a new version of one of our microservices, we can choose to deploy it at the end of the build.
Yes, as we are still on the workflow where we delete the staging deployment after the switch, we will need to recreate a new deployment with a new service connector each time we want to deploy a new app version. As I explained : because we have to create the deployment (with our jar file which need database connection infos) before the service connector, the app will first start without the connection string and username/password, and then fail. We will have to wait for the deployment to be created (the app may take 1 or 2 minutes to start and fail) and then, create the service connector (around 40 sec if you use username/password, more if you use passwordless connection) So we may loose up to 4/5 minutes for an app deployment, in addition to the normal time to deploy a new app version, which may be avoided if the service connector was already present when creating a new staging deployment (as it is for the service bindings). The result of this is:
We are thinking to move to a new workflow where we don't delete the old version deployment after the new version app as started, but stopping it instead. |
@julienbourgoin-maif Glad to see you're unblocked with the workaround. Thanks for sharing such valuable information with us. Your explanation of this scenario is extremely helpful! To resolve this issue, we are still conducting some internal discussions for the possibilities of introducing some new design. If any progress, I'll update it here. |
Hi @LGDoor, any updates on this? |
@SandraAhlgrimm Might you be able to tell us your scenarios about it? What would you use for different deployment? As deployment is the smallest runtime unit. While adding service connector at deployment level, it is not hard to create same service connector across different deployment. But if the service connector is added at app level, it is impossible to connect different target in different deployment (for example, connect to staging DB at staging deployment) |
Hello @ChenTanyi What about to let the possibility for the user to choose between app level or deployment level ? The use of a staging DB is usefull if you don't switch your deployments from staging to production. |
Yeah, it may be the most likely solution, but it would also introduce confusion when customers see creation failure in the other level. Therefore, we just want to know more scenarios to see if the app level is much better than deployment level at most case (or even Spring Service level). Usually, if you all treat different deployments of App as multiple revisions rather than multiple environment. It is more reasonable to support App Connector rather than Deployment Connector. And for your specific scenario, as you said before, you can just keep the deployment so that service connector would not be deleted rather than delete the deployment every time. It should be fine as deployment is designed to do re-deploy every time. And also the deployment level have multiple independent runtime parameters, how do you deal with them? for example, the environment variables. Do you just reset everything when you re-deploy? (As Service Connector serves like environment variables) And indeed, the re-creation problem of Service Connector is still existing no matter which level it is. We try to find solutions of it, but it still under discussion at it may related to infrastructure problem. (Service Connector needs to depend on the deployment existence, so we could not take effect during deployment creation) |
@ChenTanyi Having two deployment also requires to stop the staging one to avoid billing. Every time I deploy a new app version on the staging deployment, I give all the informations like environment variables as they may be differents. Another example is the runtime as we are currently migrating ours apps from Java_11 to Java_17. For the moment, we do not have implemented the fact to keep the two deployments in our deploy workflow, we are still deleting the old production deployment and creating a new one. But the day we will modify our deploy workflow to keep the two deployment, we may be facing problems if we need to change some parameters on the already existing one (cpu, memory, env, runtime, etc), I don't know if all will be updatable easily. |
Thanks for your more information! It makes sense just to delete deployment to avoid billing as it is just for rolling update. But in your case, it is more like a rolling update scenario. As far as I know, Azure Spring App has supported rolling update already, showed in "Plan comparison" part of pricing page. It is based on kubernetes deployment rolling update (create new pod then delete old pod after new pod ready). You don't need to do it manually, and you could change every properties in deployment as you need. Usually, you would only need to validate the update succeeded in the INT or Staging environment. The problem is still under discussion as usual, but as it is more about user experience than technical problem. It is not so easy to make a final decision yet. So, appreciate your patience about it. |
We are happy to add an update here. The Service Connector for Application Level is now available! And the Service Connector button in Spring Application portal page has been replaced. |
Hi @ChenTanyi I will now be able to use service connectors way more easily than before and move from deprecated service bindings to service connectors ! Thanks |
Hi @julienbourgoin-maif! Is it fine for you of we close the issue? |
Is your feature request related to a problem? Please describe.
We are currently using service bindings to connect our apps to a cosmosdb database.
Service bindings are created at the application level. I mean, you don't need a deployment to create a service binding.
The advantage of this approach is that you can delete and create new deployments, they will automatically have the properties given by the service binding (
spring.data.mongodb.uri
in my case).With service connectors, you need to have an existing deployment, to create the connector, as the attribute
--deployment <deploymentname>
is mandatory (https://learn.microsoft.com/en-us/cli/azure/spring/connection/create?view=azure-cli-latest#az-spring-connection-create-cosmos-mongo)This involve that the first time you create your deployment, your app start will fail as the database connection string is not available before you create the service connector in a second time.
It's not such a big deal until you begin to do blue/green deployment and delete the Staging deployment, because when you delete a deployment, the service connector attached to this deployment is also deleted.
My actual deployment workflow is the following:
blue
)green
) with my jar file and all the required configurationsgreen
) to Productionblue
)With service connectors, this workflow won't work anymore. The working one will be :
blue
)green
) with my jar file and all the required configurationsgreen
)green
) to Productionblue
)This is impactfull because:
Describe the solution you'd like
Allow creation of services connectors at the app level as it is for service bindings.
Or at least, do not delete the service connector attached to a deployment when this deployment is deleted, so that when we will recreate the deployment with the same name, the service connector is already there.
Describe alternatives you've considered
One solution would be to not delete our deployments after the switch, but to stop it instead.
By doing that, we keep the deployment AND the service connector until the next time we deploy a new app version.
We can deploy a new app version on a stopped deployment without restarting it at first.
After the new version is deployed, we can restart the deployment and the service connector will already be there.
The text was updated successfully, but these errors were encountered: