Skip to content

PROPOSAL - refactor the templates to be more composable to reduce the amount of repetition #773

Open
@mrsimonemms

Description

@mrsimonemms

At the moment, the structure of the templates is <cloud>-<vcs> (eg, aws-github or civo-gitlab). IMO, this means that there will be an awful lot of duplication in these templates. For example, when I did the recent GCP cluster work (#769) it was only for GitHub - the likelihood is that most (if not all) of this will be identical for GitLab.

This is an additional maintenance burden on our small team that we don't need.

├── akamai-github
├── aws-github
...<lots-more>
└── vultr-gitlab

I would advocate for refactoring this repo so that it incorporates a common folder. This would be for each level. My proposed structure will be something like this:

├── common 
│   ├── cloud  # One folder for each cloud provider, eg `aws`, `civo`, `gcp` etc
│   │   ├── aws # Everything in here is copied to every "aws" gitops
│   │   └── <...>
│   ├── template # Everything in here is copied to every gitops
│   └── vcs # One folder for each VCS provider, eg `github`, `gitlab` etc
│       ├── github # Everything in here is copied to every "github" gitops
│       └── <...>
└── template # Each of the folders we currently have
    ├── akamai-github
    ├── aws-github
    ├── <...>
    └── vultr-gitlab

Pros

  • Reduce the amount of duplication we have
  • Make it easier to rollout updates

Cons

  • The gitops repo for the user is no longer a fork of the gitops-template repo
  • How would we maintain backwards compatibility?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions