jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.57k stars 787 forks source link

Consolidate multiple deployments in a repo to one app #3095

Closed EamonKeane closed 5 years ago

EamonKeane commented 5 years ago

For repos with multiple deployments (such as separate nginx and php deployments), jenkinsx currently thinks there are two apps by parsing each of the deployment.

In reality there is one and jx promote only works on the main repo not each of the displayed apps. If multiple deployments are detected jenkinsx should possibly revert to the name of the repo and pick the version from one of the deployments or throw an error if both of them are not the same.

APPLICATION          STAGING PODS URL                                                                   PRODUCTION PODS URL
fleetcore-nginx      0.0.11  2/2  http://fleetcore-nginx-jx-staging.test.squareroute.io
fleetcore-phpfpm     0.0.11  2/2
ccojocar commented 5 years ago

@EamonKeane At the moment, jx supports one application per deployment. There isn't any dedicated CRD for an application which stores the metadata of an application consisting of multiple deployments.

You have a few options:

EamonKeane commented 5 years ago

@ccojocar Thanks. Maybe it's not a commonly used pattern but the main benefit of separate deployment is independent scalability of replicas for the nginx and php components. Bitnami use it in their example chart.

The separate application doesn't really fit the use case, but a side car would resolve it. Alternatively knowing to run jx promote fleetcore and not the individual ones also works.

https://github.com/bitnami/tutorials/blob/master/phpfpm-k8s/helm-chart/templates/deployment.yaml

ccojocar commented 5 years ago

@EamonKeane I am going to close this issue, since we are not planning to support multiple deployments per application. Thanks