opendevstack / ods-jenkins-shared-library

Shared Jenkins library which all ODS projects & components use - provisioning, SonarQube code scanning, Nexus publishing, OpenShift template based deployments and repository orchestration
Apache License 2.0
70 stars 57 forks source link

[component pipeline] Allow to deploy to multiple clusters #496

Open michaelsauter opened 3 years ago

michaelsauter commented 3 years ago

Is your feature request related to a problem? It would be nice to deploy to multiple clusters (and within each cluster to multiple namespaces). This is a typical scenario, and currently users have to build it themselves.

Describe the solution you'd like odsComponentStageRolloutOpenShiftDeployment should be able to deploy to multiple clusters/namespaces. For this, it first needs to change from rolling out one deployment (identified by resourceName) to rolling out all deployments for the selector. Then, it needs to be able to read "environment configuration", that specifies for each environment the clusters / namespaces to deploy to. The configuration could/should be largely identical to https://www.opendevstack.org/ods-documentation/opendevstack/3.x/jenkins-shared-library/orchestration-pipeline.html#_environments, but it should be able to specify multiple clusters. Further, the configuration cannot be sourced from a repo/file, but must either be inline in the Jenkinsfile (which works well for one component) or it could be sourced from a ConfigMap in the *-cd project (which would be the better fit for multiple components with same/similar configuration).

Describe alternatives you've considered The orchestration pipeline is also missing this functionality. One could add the functionality there, and require users wanting to deploy to multiple clusters to use the orchestration pipeline. I would like to avoid this because:

Additional context We also need to take care of importing images to the target clusters.

metmajer commented 3 years ago

Related to https://github.com/opendevstack/ods-jenkins-shared-library/issues/389

metmajer commented 3 years ago

As discussed with @michaelsauter, the following topics need to be addressed: