Altinn / altinn-decision-log

Log for architecture and design/ux decisions across Altinn teams and products
0 stars 0 forks source link

Pull-based deploy to Kubernetes clusters #7

Open martinothamar opened 5 months ago

martinothamar commented 5 months ago

Status

Proposed

Context

While working on Maskinporten integration and automation in Altinn 3, we also discussed more general improvements around app clusters and integration with Altinn Studio. This is something that has been discussed before in the Platform team.

Azure DevOps (ADO) pipelines are currently used for deployment from Studio to service owner app clusters. When users click the deploy button in Altinn Studio, a pipeline is run that is parameterized by Altinn Studio backend code to target the correct environment, git-repo, cluster and Azure subscription among other things.

The pipeline

In the future we will be dynamically provisioning per-app infrastructure using Kubernetes operators (some of which won't live in the app Git repo), which will lead to more configuration that needs to work well at deployment-time. For instance, the configuration for which Maskinporten scopes the app needs will be mutated at design-time, but not stored in Gitea. So pulling the repo in the pipeline is not sufficient to build the whole artifact.

There are some drawbacks to the ADO approach

Decision

Rather than extending ADO pipelines to accommodate our new configuration needs, we suggest that Altinn Studio

Then in the app clusters we can

Building the artifact could consist of

For more concrete technical information, read the platform team RFC: https://github.com/Altinn/altinn-platform/blob/rfc/pull-based-cd/rfcs/0000-pull-based-cd.md

Consequences

martinothamar commented 5 months ago

cc @sduranc @bengtfredh - part 2 of k8s/platform related ADRs. Feel free to correct and rewrite as needed

bengtfredh commented 5 months ago

@martinothamar Have a look at this rfc. https://github.com/Altinn/altinn-platform/blob/rfc/pull-based-cd/rfcs/0000-pull-based-cd.md It is focused around deploy platform components, but we want to extend it to cover service owner apps the same way.

altinnadmin commented 5 months ago

@martinothamar Nice! I think we should change the title of this decision to reflect the main architectural change: Pull-based deploy to Kubernetes app clusters.

martinothamar commented 5 months ago

Have a look at this rfc.

Cool! Added the "For more concrete technical information, read the platform team RFC..." paragraph with a link

Nice! I think we should change the title of this decision to reflect the main architectural change

Done

sduranc commented 2 months ago

LGTM. Although, it sounds more like it's specific for Altinn Studio.

Uploads the artifact to a Azure Blob Storage container

Currently we're pushing the OCI artifacts to ACR, using OCI repositories. But that's just implementation details, so it shouldn't matter, ie. we could also end up pushing the OCI artifact to buckets in some point, if that makes sense.

altinnadmin commented 2 months ago

LGTM. Although, it sounds more like it's specific for Altinn Studio.

@sduranc Yup, we agreed to make this more general, like #6, and review it next week.