Skip to content
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

Re-architecture to better fit the modular nature of the project #2

Open
kurktchiev opened this issue Apr 16, 2024 · 12 comments
Open

Re-architecture to better fit the modular nature of the project #2

kurktchiev opened this issue Apr 16, 2024 · 12 comments
Assignees
Labels
proposal New design proposals
Milestone

Comments

@kurktchiev
Copy link
Contributor

The project's current state allows for a great showcase of the general idea behind The BACK Stack. However, it poses challenges regarding the lifecycle management of components and the modularity of said components.

To alleviate some of these challenges, I am proposing a re-architecture that will ultimately enhance the original Hub/Spoke idea and allow us to better:

  • manage individual hub components
  • lifecycle management of those components
  • control installation/or not of components
  • include new packages as needed
  • break out the core code from example implementations

This new design makes a few assumptions:

  1. Hub clusters are a single tenant that houses the BACK stack HUB components, nothing else
  2. We are basing the install/upgrade/uninstall process through porter
  3. Each component is installed through helm
  4. Break out the cluster/app claims to their own repository

It also introduces a new concept to the Hub/Spoke, called a Bead. Beads are 3rd party packages that allow an end user to extend the platform to their liking.

Below is the diagram describing the breakouts and decisions around the re-architecture:
BackStack-ReStack-Re-Architecture (1)

Also, the following diagram is my current sketch of how I envision Beads working:
BackStack-ReStack-Beads - 3rd party addons

cc @JimBugwadia @patelrit @morey-tech for comments

@kurktchiev kurktchiev added enhancement New feature or request proposal New design proposals labels Apr 16, 2024
@kurktchiev kurktchiev added this to the v0.2.0 milestone Apr 16, 2024
@kurktchiev kurktchiev removed the enhancement New feature or request label Apr 16, 2024
@morey-tech
Copy link

Love the new design! Something to consider:

We are basing the install/upgrade/uninstall process through porter

It's common for Argo CD to manage itself after the initial bootstrapping, and it could also manage the other components of the hub. I wonder if Porter should be solely responsible for the install/uninstall but not the upgrade and ongoing operation of the hub components.

This would reduce the complexity we need in Porter. It could simply create the Hub cluster and bootstrap it with Argo CD. Then, uninstallation is simply deleting the hub cluster. In the long term, we could integrate Porter with Terraform (OpenTofu) to create the hub cluster on cloud providers and clean them up after uninstalling them.

Upgrading would be managed through GitOps, with changes to the manifests in the hub cluster repo. Argo CD can do the deployment. If there's any special logic we need to implement for those upgrades, it should be done using resource hooks in the Applications.

This answers how Beads are managed; Argo CD would handle them just like the other hub components.

@kurktchiev
Copy link
Contributor Author

I am on board with using Argo as a the source of truth for things, take a look over at https://github.com/back-stack/bead-gke I am working through building out what adding GKE support can look like. I think overall things can be moved into Argo except the backstage stuff which is wonky and I am not sure what the best way to handle the wiring into that is honestly. It requires either manual interventions of a configmap potentially or whole new images for backstage, neither option is super appealing.

@morey-tech
Copy link

except the backstage stuff which is wonky and I am not sure what the best way to handle the wiring into that is honestly. It requires either manual interventions of a configmap potentially or whole new images for backstage, neither option is super appealing.

  1. What is the official recommendation from the Backstage project for people adding in their customizations?
  2. Maybe we should treat Backstage as a bead (e.g., if a user wants to customize it, they have to bring their own Backstage).

@kurktchiev
Copy link
Contributor Author

There is no official way to specifically enhance it once the image has been built outside of rebuilding. There are ways to extend it to a point (the gke example leans onto that by using a catalog that can be imported to add in functionality), but if there is need for say new plugins to be added etc, it requires a new image altogether.

I am not against backstage being a Bead tbh, it is a nice interface into the system for those that want it but I think the heart of things should be git+argo/porter

@JimBugwadia
Copy link

Have we looked at Backstage templates (blog, docs) for extensions?

I feel we need to define a higher level abstraction to add a Service to a BACK Stack deployment, which allows declarative configuration of:

  1. Backstage Template
  2. ArgoCD Application
  3. Crossplane Composite
  4. Kyverno Policy Set

Perhaps the minimal requirement is the ArgoCD Application and the rest are optional?

I am still trying to understand what exactly a Bead is....did you have something similar to the above in mind?

This can be formalized as a new CRD.

@kurktchiev
Copy link
Contributor Author

kurktchiev commented Apr 21, 2024 via email

@JimBugwadia
Copy link

Yes a Bead is exactly what you described and in the linked repo I am building out what the specific needs for each of those components looks like.

Naming aside, is this just a set of 1-4 K8s resources in a Helm chart or do we need a CRD and some lifecycle management via a Golang controller?

And yes the backstage templates is what I am using for extending but as I said there are limitations with the running image and requirements a template can have.

Is this a bug that is being addressed, or a more permanent limitation?

The blog post makes it seem like templates should simply work via declarative configuration. Is that not the case?

@kurktchiev
Copy link
Contributor Author

kurktchiev commented Apr 22, 2024

Naming aside, is this just a set of 1-4 K8s resources in a Helm chart or do we need a CRD and some lifecycle management via a Golang controller?

For the most part yes, it is a few k8s resources, that I think in general as @morey-tech suggested can be Argo controlled, so I don’t know that we need a specialty controller for. As example defining the Back stack Crossplane CRDs https://github.com/back-stack/bead-gke/tree/main/crossplane (which requires building an OCI image, check the supplied action) and then configuring and applying them to the cluster https://github.com/back-stack/bead-gke/tree/main/porter/manifests/crossplane

Is this a bug that is being addressed, or a more permanent limitation?
The blog post makes it seem like templates should simply work via declarative configuration. Is that not the case?

Yeah so the blog shows you how to add them locally to the image, which the process does not work the same way on a live running instance, and that is a current design limitation of backstage. I am using templates (https://github.com/back-stack/bead-gke/tree/main/backstage) and the overall process described in the blogs and docs to extend, however, there are a couple of intermediary steps that are less clean when it comes to making it work in a live container. It is also design limited around plugins, I have not found a way to add new plugins to backstage to a running instance and the only way to do it is to rebuild an image. With that said, there are some things we can do if I had a bit more React experience that can make some of this a bit better.

@JimBugwadia
Copy link

Yeah so the blog shows you how to add them locally to the image

What do you mean by image? The catalog?

This article lists a few ways to add templates, or other components, to the catalog:

https://dev.to/mccricardo/backstage-catalog-393c

@kurktchiev
Copy link
Contributor Author

The catalog is one piece; that is how I am extending Backstage to support GKE https://github.com/back-stack/bead-gke/tree/main/backstage. However, in order to extend Backstage beyond what the catalog supports, you need to do full image rebuilds. As an example, if we wanted to install and support, say, Google Authorization on the front page, a number of components would have to be edited that cannot be controlled with templates, resources, and components.

@JimBugwadia
Copy link

Creating a custom image does not seem right to me.

I would suggest focusing on the extensions, and not the initial installs as we want flexibility in how each component is setup.

Lets discuss the requirements and the desired flow.

@kurktchiev
Copy link
Contributor Author

kurktchiev commented Apr 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal New design proposals
Projects
Status: In review
Development

No branches or pull requests

4 participants