Multiple Deployment targets (Auto DevOps and custom deployments)
## Background We want to introduce ECS as a new deployment target for Auto DevOps. This is in addition to the current sole target of Kubernetes Cluster. Note: this is application to custom deployments as well ## Problem to solve GitLab will have now at least two deployment targets, Kubernetes and ECS. Users need a way to - Define these deployment targets - Choose which deployment targets to use when there are multiple deployment targets ## Proposal 1. We provide project-level config pages for setting creds, something like: * Project > Operations > Kubernetes > GKE (Already exist) * Project > Operations > Kubernetes > EKS (Already exist) * Project > Operations > AWS > ECS * Project > Operations > AWS > FARGATE 2. We modify `DeploymentPlatform.deployment_platform` for properly injecting each creds - To achieve this, we can add a new `platform` to `Clusters::Cluster` - ECS **Note**: `Clusters::Cluster` in theory can have different `platform`s. Currently we only have one platform which is `Clusters::Platform::Kubernetes`. The `deployments` table already has `cluster_id`. 3. Optionally, we allow GitLab CI to specify different targets: ```yaml deploy: environment: deployment_target: platform: <DEPLOYMENT_TARGET_PLATFORM> name: <DEPLOYMENT_TARGET_NAME> ``` - `environment.deployment_target` CI keyword is optional. - `DEPLOYMENT_TARGET_PLATFORM` is one of `kubernetes`, `ecs`, `fargate` - `DEPLOYMENT_TARGET_NAME` is the name of the target. We can also consider a UUID number ala [AWS ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) 4. The applicable credentials are injected into the deployment job as environment variables: - Kubernetes as `KUBECONFIG` - ECS as ?? ## Further details 1. We default to Kubernetes cluster as a deployment target. 1. For other platforms, CI needs to be specified /cc @ogolowinski @ebaque @hfyngvason @nicholasklick @dosuken123
epic