debian-mirror-gitlab/doc/topics/autodevops/requirements.md
2021-04-29 21:17:54 +05:30

8 KiB

stage group info
Configure Configure To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments

Requirements for Auto DevOps (FREE)

You can set up Auto DevOps for Kubernetes, Amazon Elastic Container Service (ECS), or Amazon Cloud Compute. For more information about Auto DevOps, see the main Auto DevOps page or the quick start guide.

Auto DevOps requirements for Kubernetes

To make full use of Auto DevOps with Kubernetes, you need:

  • Kubernetes (for Auto Review Apps, Auto Deploy, and Auto Monitoring)

    To enable deployments, you need:

    1. A Kubernetes 1.12+ cluster for your project. The easiest way is to create a new cluster using the GitLab UI. For Kubernetes 1.16+ clusters, you must perform additional configuration for Auto Deploy for Kubernetes 1.16+.

    2. NGINX Ingress. You can deploy it to your Kubernetes cluster by installing the GitLab-managed app for Ingress, after configuring the GitLab integration with Kubernetes in the previous step.

      Alternatively, you can use the nginx-ingress Helm chart to install Ingress manually.

      NOTE: If you use your own Ingress instead of the one provided by GitLab Managed Apps, ensure you're running at least version 0.9.0 of NGINX Ingress and enable Prometheus metrics for the response metrics to appear. You must also annotate the NGINX Ingress deployment to be scraped by Prometheus using prometheus.io/scrape: "true" and prometheus.io/port: "10254".

  • Base domain (for Auto Review Apps, Auto Deploy, and Auto Monitoring)

    You must specify the Auto DevOps base domain, which all of your Auto DevOps applications use. This domain must be configured with wildcard DNS.

  • GitLab Runner (for all stages)

    Your runner must be configured to run Docker, usually with either the Docker or Kubernetes executors, with privileged mode enabled. The runners don't need to be installed in the Kubernetes cluster, but the Kubernetes executor is easy to use and automatically autoscales. You can configure Docker-based runners to autoscale as well, using Docker Machine.

    If you've configured the GitLab integration with Kubernetes in the first step, you can deploy it to your cluster by installing the GitLab-managed app for GitLab Runner.

    Runners should be registered as shared runners for the entire GitLab instance, or specific runners that are assigned to specific projects (the default if you've installed the GitLab Runner managed application).

  • Prometheus (for Auto Monitoring)

    To enable Auto Monitoring, you need Prometheus installed either inside or outside your cluster, and configured to scrape your Kubernetes cluster. If you've configured the GitLab integration with Kubernetes, you can deploy it to your cluster by installing the GitLab-managed app for Prometheus.

    The Prometheus service integration must be enabled for the project, or enabled as a default service template for the entire GitLab installation.

    To get response metrics (in addition to system metrics), you must configure Prometheus to monitor NGINX.

  • cert-manager (optional, for TLS/HTTPS)

    To enable HTTPS endpoints for your application, you must install cert-manager, a native Kubernetes certificate management controller that helps with issuing certificates. Installing cert-manager on your cluster issues a Let's Encrypt certificate and ensures the certificates are valid and up-to-date. If you've configured the GitLab integration with Kubernetes, you can deploy it to your cluster by installing the GitLab-managed app for cert-manager.

If you don't have Kubernetes or Prometheus installed, then Auto Review Apps, Auto Deploy, and Auto Monitoring are skipped.

After all requirements are met, you can enable Auto DevOps.

Auto DevOps requirements for Amazon ECS

Introduced in GitLab 13.0.

You can choose to target AWS ECS as a deployment platform instead of using Kubernetes.

To get started on Auto DevOps to AWS ECS, you must add a specific CI/CD variable. To do so, follow these steps:

  1. In your project, go to Settings > CI/CD and expand the Variables section.

  2. Specify which AWS platform to target during the Auto DevOps deployment by adding the AUTO_DEVOPS_PLATFORM_TARGET variable with one of the following values:

    • FARGATE if the service you're targeting must be of launch type FARGATE.
    • ECS if you're not enforcing any launch type check when deploying to ECS.

When you trigger a pipeline, if you have Auto DevOps enabled and if you have correctly entered AWS credentials as variables, your application is deployed to AWS ECS.

GitLab Managed Apps are not available when deploying to AWS ECS. You must manually configure your application (such as Ingress or Help) on AWS ECS.

If you have both a valid AUTO_DEVOPS_PLATFORM_TARGET variable and a Kubernetes cluster tied to your project, only the deployment to Kubernetes runs.

WARNING: Setting the AUTO_DEVOPS_PLATFORM_TARGET variable to ECS triggers jobs defined in the Jobs/Deploy/ECS.gitlab-ci.yml template. However, it's not recommended to include it on its own. This template is designed to be used with Auto DevOps only. It may change unexpectedly causing your pipeline to fail if included on its own. Also, the job names within this template may also change. Do not override these jobs' names in your own pipeline, as the override stops working when the name changes.

Auto DevOps requirements for Amazon EC2

Introduced in GitLab 13.6.

You can target AWS EC2 as a deployment platform instead of Kubernetes. To use Auto DevOps with AWS EC2, you must add a specific CI/CD variable.

For more details, see Custom build job for Auto DevOps for deployments to AWS EC2.